subjectId. That workspace is the same sandbox volume the agent mounts
during sessions and automations.
You do not need an active session. All endpoints require an x-api-key header.
Paths are workspace-relative, use / separators, and must not contain ...
A leading slash is optional and is stripped.
See Files and workspaces for volume layout, reserved paths, and
when to use attachments or memory instead.
List files
A subject with no volume yet returns an empty list, not
404.
Get file metadata
The response is a single
file object. Missing paths return 404 not_found.
Read file content
encoding: "utf-8". Binary files
use encoding: "base64".
Accept: application/octet-stream.
Directories cannot be downloaded and return 400 validation_error.
Each file is capped at 40 MiB. Larger objects return 400 validation_error.
Write file content
The first write for a subject creates the volume if needed. Writing a path that
already exists with
overwrite: false returns 409 conflict. Writing a
directory path, a reserved memories/ or skills/ path, or a body over 40 MiB
returns 400 validation_error.
The response is the updated file metadata object.
Upload binary files
For images, PDFs, and other binaries, sendencoding: "base64" or use
multipart:
path and overwrite apply to octet-stream uploads. createParents
defaults to true.
Create a directory
409 conflict.
Move or rename
to are created
when missing. overwrite: false (the default) returns 409 conflict when the
destination exists. Reserved memories/ and skills/ paths cannot be moved.
Copy
Delete
Deleting a missing path returns
404 not_found. Deleting a non-empty directory
without recursive=true returns 409 conflict. Reserved memory and skill
paths cannot be deleted through this endpoint.
Response:
Search files
Search skips binary files. Each match includes the path, a short excerpt, and
whether the query hit the name, the contents, or both.
Get volume usage
Volumes start at 512 MiB and expand automatically toward 4 GiB as usage
approaches capacity. See Volume capacity.
Visibility during sessions
Writes from this API land on the same volume the agent mounts. A running turn may not observe a write until the next turn. Prefer writing beforePOST /v1/sessions, after the
session is idle, or while using
POST /v1/sandboxes/warm so the
sandbox is already attached.
File operations count against the organization API key request ceiling, not the
per-subject conversation or message allowances.