Skip to main content
Every sandbox exposes a filesystem API under /v1/sandbox/{sandbox_id}/fs. Read and write bodies are raw bytes — not tar archives, not multipart form data — so each call moves exactly one file. See Files for the full field reference; this guide is workflow-focused.

Upload a file

fs/write returns 204 with no body on success. The SDKs stream in 64 KiB chunks through a guest-side temp file and publish atomically, so a reader never observes a partially written file.

Download a file

fs/read returns the raw bytes as application/octet-stream — there’s no envelope to unwrap.
There’s no directory/tar transfer mode in this API. upload/download (CLI and SDKs) and fs/read/fs/write (REST) each move exactly one file. To move a directory tree, upload or download its files individually, or run a command via exec that packs/unpacks an archive on the sandbox side.

Write small content directly

For short text content you don’t want to stage as a local file first, read/write on the SDK take bytes or a string directly rather than a file path:

List a directory

The response is { "files": [ ...FsFileInfo ] } — immediate children only, sorted by name, each carrying path, name, kind (FILE/DIRECTORY/SYMLINK/OTHER), size, mode, and modified_at_unix_nanos.

Stat a file

stat returns lstat-style metadata — a symlink is reported as a symlink, not followed.

Directories, renaming, and deleting

move/rename is same-filesystem and atomic — it doesn’t overwrite an existing destination, and won’t move across filesystems. remove with recursive set removes a non-empty directory without following symlinks.

Files

Sandboxes