EndpointsList sandboxes

Sandboxes

List sandboxes

Sandboxes visible through the caller’s own grant or a grant to every current Workspace member, newest first.

GET/sandboxes
Authorizationstringheaderrequired

Bearer token for the authenticated caller.

Optional workspace/scope context for the request. Carries a single workspace wire id (ws_…) today. Only needed for broad tokens - a workspace-owned token implies its workspace.

Required string length: 1 - 53

Example: "ws_j572abc123def4"

cursorstring

Pagination cursor from a previous response's next_cursor.

Maximum string length: 512

limitintegerdefault:50

Items per page (1-100, default 50)

Required range: 1 <= x <= 100

Example: 50

stateenum<string>

ACTIVE sandboxes run commands and file operations. SUSPENDED sandboxes keep their files and cost only storage. -ING states are in flight; FAILED sandboxes can only be deleted.

Available options: PROVISIONING, ACTIVE, SUSPENDING, SUSPENDED, RESUMING, DELETING, FAILED

opencodestring

Only sandboxes this OpenCode Server (oc_...) has a grant on.

Required string length: 1 - 100

Response

application/json

SandboxList

dataobject[]required
child attributes
data.idstringrequired

Sandbox id (sbx_...).

Pattern: ^sbx_[A-Za-z0-9]{1,64}$

Example: "sbx_j572abc123def456"

data.workspace_idstringrequired

Required string length: 1 - 53

data.namestringrequired

Display name.

Required string length: 1 - 100

Example: "checkout-service"

data.stateenum<string>required

ACTIVE sandboxes run commands and file operations. SUSPENDED sandboxes keep their files and cost only storage. -ING states are in flight; FAILED sandboxes can only be deleted.

Available options: PROVISIONING, ACTIVE, SUSPENDING, SUSPENDED, RESUMING, DELETING, FAILED

data.sizeenum<string>required

Compute size. standard is the only size today; larger sizes are added as new values.

Available options: standard

data.sourceobject | nullrequired

null for a sandbox created empty. Where the sandbox content comes from. sandbox: a copy of another sandbox from its latest snapshot (a fork). Repository, snapshot and template sources are added as new type values.

child attributes
data.source.typeenum<string>required

Available options: sandbox

Sandbox id (sbx_...).

Pattern: ^sbx_[A-Za-z0-9]{1,64}$

Example: "sbx_j572abc123def456"

data.network_policyobjectrequired

Outbound network access. allow_all means public internet only: HTTP on TCP port 80, TLS on TCP port 443 (including HTTPS), and public DNS. Private, link-local, cluster-internal and execution-cluster node addresses are blocked. Cluster DNS names and other ports or protocols are unavailable.

child attributes
data.network_policy.modeenum<string>required

Available options: allow_all

data.idle_timeout_secondsintegerrequireddefault:600

Seconds without API activity after which the sandbox suspends itself. Commands that are still running keep it awake. 300 to 86400; default 600.

Required range: 300 <= x <= 86400

Example: 600

data.envrecord<string, string>required
data.labelsrecord<string, string>required
data.created_byobjectrequired
child attributes
data.created_by.typeenum<string>required

user: a workspace member. opencode: an OpenCode Server (oc_...).

Available options: user, opencode

data.created_by.idstringrequired

Required string length: 1 - 100

data.usageobjectrequired
child attributes

Seconds the sandbox has spent ACTIVE, including the current active period.

Required range: x >= 0

data.usage.cpu_secondsinteger | nullrequired

CPU seconds used. null until CPU accounting is available.

Required range: x >= 0

data.usage.egress_bytesinteger | nullrequired

Bytes sent to the network. null until network accounting is available.

Required range: x >= 0

data.usage.ingress_bytesinteger | nullrequired

Bytes received from the network. null until network accounting is available.

Required range: x >= 0

data.conditionsobject[]required

What needs attention now; empty when nothing does. Reasons:

  • create-failed (error): the sandbox could not be created; it is FAILED and can only be deleted.
  • suspend-failed (warning): the last suspend failed; the sandbox stays ACTIVE.
  • resume-failed (warning): the last resume failed; the sandbox stays SUSPENDED.

Maximum array length: 32 elements

child attributes

Kebab-case reason; the resource documents the reasons it reports.

Maximum string length: 64

Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$

Example: "agent-offline"

data.conditions.severityenum<string>required

error: the resource failed; the condition says why. warning: it is limited or held until the person acts or it recovers. info: worth knowing, nothing to do.

Available options: error, warning, info

Safe to show the person as is.

Maximum string length: 512

data.conditions.remedyobject | nullrequired

What the person can do; null when nothing they do helps.

data.conditions.remedy.kindenum<string>required

Available options: free-capacity

data.conditions.remedy.metricenum<string>required

Available options: kaas/clusters, compute/machines, compute/cpu, compute/memory, compute/machines_concurrency, compute/managed_vm_trial, agents/turns_concurrency, agents/sandboxes, agents/sandboxes_running, agents/retained_filesystem_lifetime, codemode/executions, api/secrets_access, api/secrets_write, domain_routing/preview_hostnames, domain_routing/custom_domains, source_control/repositories

Maximum string length: 256

Unix timestamp (seconds) when this condition last changed.

Required range: x >= 0

data.last_active_atinteger | nullrequired

Last API activity (Unix seconds).

Required range: x >= 0

data.created_atintegerrequired

Creation time (Unix seconds).

Required range: x >= 0

data.updated_atintegerrequired

Last change (Unix seconds).

Required range: x >= 0

data.etagstringrequired

Opaque version token. Send it as If-Match on writes.

has_morebooleanrequired

True if more items exist after this page.

next_cursorstring | nullrequired

Opaque cursor for the next page, or null if no more pages.