diff --git a/api-reference/openapi.json b/api-reference/openapi.json index ce9c491..a463275 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -2367,6 +2367,84 @@ } } }, + "/api/sandboxes/files": { + "post": { + "description": "Upload one or more files to the authenticated account's GitHub org submodule repository. Resolves the target path through git submodules (e.g. `.openclaw/workspace/orgs/myorg/`) and commits each file directly to GitHub. Authentication is handled via the x-api-key header or Authorization Bearer token.", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "required": ["files", "folder"], + "properties": { + "files": { + "type": "array", + "items": { "type": "string", "format": "binary" }, + "description": "One or more files to upload." + }, + "folder": { + "type": "string", + "description": "Target folder path within the repository (e.g. `.openclaw/workspace/orgs/myorg`).", + "example": ".openclaw/workspace/orgs/myorg" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Files uploaded successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { "type": "string", "example": "success" }, + "uploaded": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { "type": "string", "description": "File path in the repository." }, + "success": { "type": "boolean" }, + "error": { "type": "string" } + } + } + } + } + } + } + } + }, + "400": { + "description": "Bad request - missing folder or no files provided", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SandboxErrorResponse" } + } + } + }, + "401": { + "description": "Unauthorized - invalid or missing API key", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SandboxErrorResponse" } + } + } + }, + "404": { + "description": "Not found - no snapshot or GitHub repository for account", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SandboxErrorResponse" } + } + } + } + } + } + }, "/api/x/search": { "get": { "servers": [ diff --git a/api-reference/sandboxes/upload.mdx b/api-reference/sandboxes/upload.mdx new file mode 100644 index 0000000..bc6990a --- /dev/null +++ b/api-reference/sandboxes/upload.mdx @@ -0,0 +1,4 @@ +--- +title: 'Upload Files' +openapi: 'POST /api/sandboxes/files' +--- diff --git a/docs.json b/docs.json index 82ba776..7089db8 100644 --- a/docs.json +++ b/docs.json @@ -223,7 +223,8 @@ "api-reference/sandboxes/snapshot", "api-reference/sandboxes/delete", "api-reference/sandboxes/setup", - "api-reference/sandboxes/file" + "api-reference/sandboxes/file", + "api-reference/sandboxes/upload" ] }, {