Skip to content

Read a single file from the snapshot as JSON

GET
/workspaces/{id}/snapshot/files/{path}
curl --request GET \
--url 'https://your-org.evershell.ai/v1/workspaces/example/snapshot/files/example?max_bytes=524288' \
--header 'Authorization: Bearer <token>'

Permissions: workspace:read or workspace:read:own (creator-match on :own).

Capped at 512 KB by default; pass max_bytes to override. Binary files return content: null — use the /snapshot/download/{path} endpoint to stream raw bytes.

id
required
string
path
required
string

Slash-separated path inside the snapshot tar root.

max_bytes
integer
default: 524288

OK

Media type application/json
object
entry
required

A single entry in the workspace sandbox or snapshot tree. Shape matches the agent’s FileEntry so the same renderer works on both live (/sandbox/files) and stopped (/snapshot/files) sources.

object
path
required
string
size
required
integer format: int64
is_dir
required
boolean
mtime
required

Unix-epoch seconds with fractional milliseconds.

number
readonly
required
boolean
mime_type
string
content
required

File contents as a UTF-8 string when textual; null for binary files. Use /sandbox/download/{path} or /snapshot/download/{path} to stream raw bytes.

string
nullable
truncated
required

True when the response was capped at max_bytes (default 512 KB).

boolean
Example generated
{
"entry": {
"path": "example",
"size": 1,
"is_dir": true,
"mtime": 1,
"readonly": true,
"mime_type": "example"
},
"content": "example",
"truncated": true
}

Resource not found in the caller’s org

Media type application/json
object
error
required
object
code
required

Closed-enum slug (e.g. permission_denied, validation_error, workspace_not_found)

string
message
required

Human-readable summary

string
request_id
required

Server-generated request id for correlating logs

string
details

Optional structured context. Validation errors land at details.fields as a per-field map.

object
key
additional properties
any
Example
{
"error": {
"code": "permission_denied",
"message": "caller lacks required scope",
"request_id": "7f3a9c2e"
}
}