Read logs for an owned Sandbox with the sandbox:read scope:
const logs = await boxcompute.sandboxes.logs("sbx_REDACTED", {
since: "2026-09-06T00:00:00Z",
stream: "stderr",
source: "process",
limit: 100,
});logs = boxcompute.sandboxes.logs(
"sbx_REDACTED",
since="2026-09-06T00:00:00Z",
stream="stderr",
source="process",
limit=100,
)The equivalent direct HTTP request is:
curl --get 'https://api.boxcompute.ai/api/v2/sandboxes/sbx_REDACTED/logs' \
-H 'Authorization: Bearer bc_live_REDACTED' \
--data-urlencode 'since=2026-09-06T00:00:00Z' \
--data-urlencode 'stream=stderr' \
--data-urlencode 'source=process' \
--data-urlencode 'limit=100'Log reads do not start stopped compute. Output remains queryable after compute becomes idle and stops, for as long as the provider retains it. Deleting the Sandbox removes the active instance, but retained logs can remain available through its read-only deletion record.
Filters
| Query | Behavior |
|---|---|
since |
Inclusive RFC 3339 timestamp; defaults to Sandbox creation |
until |
Exclusive RFC 3339 timestamp; defaults to now and must be later than since |
stream |
stdout or stderr |
source |
workload, execute, or process |
limit |
1–5,000 entries; defaults to 1,000 |
Results are ordered by timestamp. workload is Sandbox workload output, execute is synchronous command output, and process includes observable-operation output. Interactive shell transcripts are not included.
The response contains the customer-facing Sandbox ID, entries, a truncated flag, and retention_seconds:
{
"logs": {
"sandboxId": "sbx_REDACTED",
"entries": [
{
"timestamp": "2026-09-06T01:02:03.000Z",
"stream": "stderr",
"source": "process",
"message": "database ready"
}
],
"truncated": false,
"retention_seconds": 2592000
}
}If truncated is true, the result is incomplete. retention_seconds reports the configured
retention window—nominally 30 days today—but storage pressure can shorten availability, so retained
logs are not an archive.
After deletion
First use GET /api/v2/deleted-sandboxes to find the deletion record. Read logs with that record’s
id (dsb_…), not its original sandboxId:
curl --get 'https://api.boxcompute.ai/api/v2/deleted-sandboxes/dsb_REDACTED/logs' \
-H 'Authorization: Bearer bc_live_REDACTED' \
--data-urlencode 'source=process' \
--data-urlencode 'limit=100'This route accepts the same since, until, stream, source, and limit filters. It defaults to
the newest recorded runtime. To inspect an earlier one, pass an unchanged opaque value from the
record’s runtimes array as runtime:
curl --get 'https://api.boxcompute.ai/api/v2/deleted-sandboxes/dsb_REDACTED/logs' \
-H 'Authorization: Bearer bc_live_REDACTED' \
--data-urlencode 'runtime=REDACTED_OPAQUE_RUNTIME'The read does not restore, start or bill compute. Deletion history lasts about 15 months, but its logs remain readable only while the log provider retains them—nominally about 30 days and potentially less under storage pressure. Download anything you need before deletion; retained logs are not a replacement for files or an archive. The current SDKs and CLI do not expose this route.
Host CLI
The host-side BoxCompute CLI exposes the same query:
bxc sandbox logs SANDBOX_ID --source execute
bxc --json sandbox logs SANDBOX_ID \
--since 2026-09-06T00:00:00Z --limit 100CLI filters are:
--sinceand--untilfor timestamps;--streamforstdoutorstderr;--sourcefor the output source; and--limitfor the maximum entry count.
Without --json, the CLI prints entries to standard output and a count, retention value, and truncation indicator to standard error.