Hanzo
OpenapiSandbox

Read a file from a sandbox you hold

Reads one path in the caller's sandbox: a file's bytes, or a directory's entries when the path names one.

POST /v1/sandbox/read

Addresshttps://api.hanzo.ai/v1/sandbox/read
MethodPOST
Operationread_sandbox_file
AuthAuthorization: Bearer $HANZO_API_KEY

Reads one path in the caller's sandbox: a file's bytes, or a directory's entries when the path names one.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
idbodystringID is the sandbox to read from, from an earlier lease.
pathbodystringPath is read relative to the sandbox's working directory unless it is absolute, and a path that climbs out of it is refused rather than rewritten.

Response

StatusBodyMeaning
200Blobok

200 body — 4 fields.

FieldInTypeAlwaysDescription
databodystringData is the file's bytes, verbatim, base64 on the wire.
dirbodybooleanDir says which of the two answers this is: true and the path is a directory, so read Entries; false and it is a file, so read Data.
entriesbodystring[]Entries is a directory's contents as bare NAMES, not paths — one level, no recursion, dotfiles included, "." and ".." excluded (ls -1A).
pathbodystringPath is the RESOLVED absolute path that was read — the caller's relative path joined onto the sandbox's working directory (Leased.Workdir), so it names the…

Failure carries the platform error shape — see Errors.

Examples

hanzo sandboxes read

Sandbox API · All Hanzo APIs · Interactive reference

How is this guide?

On this page