Experimental
WriteFile accepts raw content with path and mode query parameters.
/v1/files/content Connection and access
API connection and authentication guidance
{endpoint}
endpoint: The sandbox API base URL from Sandbox.core.endpoint.uri; preserve its path prefix when appending /v1 routes. HTTP endpoints require a scoped endpoint bearer; direct Unix sockets use socket access control.
Use one of these alternatives. Requirements within an alternative apply together.
sandboxBearer
Parameters
path
query
Required
Type:
string
All schema constraints and annotations
{
"minLength": 1,
"title": "path",
"type": "string"
}mode
query
Type:
integer
All schema constraints and annotations
{
"title": "mode",
"type": "integer"
}Request and responses
Request
application/octet-stream
All schema constraints and annotations
{
"contentMediaType": "application/octet-stream"
}Response
200
application/json
Schema:
FilesWriteFileResponse
Response
default
application/json
Schema:
Error
Schema example
{
"code": "notFound",
"details": [],
"message": "sandbox not found"
}Referenced schemas
#/components/schemas/FilesWriteFileRequest
#/components/schemas/FilesWriteFileResponse
Complete operation contract
{
"description": "WriteFile accepts raw content with path and mode query parameters.\nIt replaces the complete target state and carries no request_id.",
"operationId": "writeFile",
"parameters": [
{
"description": "path is the sandbox path.",
"in": "query",
"name": "path",
"required": true,
"schema": {
"minLength": 1,
"title": "path",
"type": "string"
}
},
{
"description": "mode carries Unix permission bits. Upload applies mode \u0026 0777, or 0644 when\nthat value is zero, without subtracting umask; Download reports stored bits.",
"in": "query",
"name": "mode",
"required": false,
"schema": {
"title": "mode",
"type": "integer"
}
}
],
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"contentMediaType": "application/octet-stream"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FilesWriteFileResponse"
}
}
},
"description": "Success"
},
"default": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "The structured Error body identifies the failure with a stable code and optional typed details."
}
},
"security": [
{
"sandboxBearer": []
}
],
"servers": [
{
"url": "{endpoint}",
"variables": {
"endpoint": {
"default": "https://sandbox.invalid",
"description": "The sandbox API base URL from Sandbox.core.endpoint.uri; preserve its path prefix when appending /v1 routes. HTTP endpoints require a scoped endpoint bearer; direct Unix sockets use socket access control."
}
}
}
],
"summary": "WriteFile accepts raw content with path and mode query parameters.",
"tags": [
"Files"
],
"x-sbx-authenticated-only": false,
"x-sbx-conditional-permissions": [],
"x-sbx-http-transfer": {
"request": {
"bytesField": "data",
"mediaType": "application/octet-stream"
}
},
"x-sbx-plane": "data",
"x-sbx-request-schema": {
"$ref": "#/components/schemas/FilesWriteFileRequest"
},
"x-sbx-required-permissions": [
"sandboxesFilesWrite"
],
"x-sbx-response-schema": {
"$ref": "#/components/schemas/FilesWriteFileResponse"
},
"x-sbx-serving-surface": "sandboxEndpoint"
}