EndpointsWrite a file

Sandboxes

Write a file

Replaces one file with the raw request body (application/octet-stream, at most 100 MiB) and returns its new metadata. The body is streamed to the sandbox, never buffered whole. Requires files. Commands and file operations need an ACTIVE sandbox; on any other state they answer 409.

POST/sandboxes/{id}:writeFile
Authorizationstringheaderrequired

Bearer token for the authenticated caller.

Optional workspace/scope context for the request. Carries a single workspace wire id (ws_…) today. Only needed for broad tokens - a workspace-owned token implies its workspace.

Required string length: 1 - 53

Example: "ws_j572abc123def4"

idstringrequired

Sandbox id (sbx_...).

Pattern: ^sbx_[A-Za-z0-9]{1,64}$

Example: "sbx_j572abc123def456"

pathstringrequired

Absolute path inside the sandbox.

Required string length: 1 - 4096

Pattern: ^\/[^\0]*$

Example: "/workspace/README.md"

Create missing directories. Default true.

Body

application/octet-stream

Type: string<binary>

Response

application/json

SandboxFileInfo

pathstringrequired
typeenum<string>required

Available options: file, directory, symlink, other

sizeintegerrequired

Required range: x >= 0

modestringrequired

Permission bits in octal.

Example: "0644"

modified_atintegerrequired

Last modification (Unix seconds).

Required range: x >= 0