EndpointsWrite several files

Sandboxes

Write several files

Writes a batch of small files (UTF-8 text or base64) in one request of at most 4 MiB, for example a set of agent edits. Files are written in order; a failure stops the batch and earlier files stay written. Requires files. Commands and file operations need an ACTIVE sandbox; on any other state they answer 409.

POST/sandboxes/{id}:writeFiles
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"

Body

application/json
filesobject[]required

Required array length: 1 - 1000 elements

child attributes
files.pathstringrequired

Absolute path inside the sandbox.

Required string length: 1 - 4096

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

Example: "/workspace/README.md"

files.contentstringrequired
files.encodingenum<string>default:utf8

Available options: utf8, base64

create_parentsbooleandefault:true

Response

application/json

SandboxFileInfos

filesobject[]required
child attributes
files.pathstringrequired
files.typeenum<string>required

Available options: file, directory, symlink, other

files.sizeintegerrequired

Required range: x >= 0

files.modestringrequired

Permission bits in octal.

Example: "0644"

files.modified_atintegerrequired

Last modification (Unix seconds).

Required range: x >= 0