Skip to main content
POST
Create sandbox (v2)

Authorizations

X-API-Key
string
header
required

Headers

Idempotency-Key
string

Optional team-scoped key for retrying sandbox creation. Use 1 to 255 lowercase ASCII letters, digits, or hyphens (a-z, 0-9, -), such as a lowercase UUID. When idempotency is enabled, matching retries replay the original status and body, including errors, for the retention period. Different request parameters return 409 with error_code idempotency_request_mismatch. An in-progress request returns 409 with error_code idempotency_in_progress; an unknown outcome returns 422 with error_code idempotency_outcome_unknown. These retries do not execute the request again. Retries do not extend retention. After the key expires, it can start a new creation.

Required string length: 1 - 255
Pattern: ^[a-z0-9-]+$

Body

application/json

Sandbox creation request. All system communication with the sandbox is always secured; the template's envd version must support secured access.

templateID
string
required

Identifier of the required template

timeout
integer<int32>
default:300

Time to live for the sandbox in seconds.

Required range: x >= 1
autoPause
boolean
default:false

Automatically pauses the sandbox after the timeout

autoPauseMemory
boolean
default:true

Controls the snapshot kind taken when the sandbox auto-pauses on timeout (only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with autoResume. Defaults to true (full memory snapshot).

autoResume
object

Auto-resume configuration for paused sandboxes.

allow_internet_access
boolean

Allow sandbox to access the internet. When set to false, it behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.

network
object
metadata
object
envVars
object
mcp
object | null

MCP configuration for the sandbox

iam
object

Sandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.

volumeMounts
object[]

Response

The sandbox was created successfully

templateID
string
required

Identifier of the template from which is the sandbox created

sandboxID
string
required

Identifier of the sandbox

clientID
string
required
deprecated

Identifier of the client

envdVersion
string
required

Version of the envd running in the sandbox

alias
string

Alias of the template

envdAccessToken
string

Access token used for envd communication

trafficAccessToken
string | null

Token required for accessing sandbox via proxy.

domain
string | null

Base domain where the sandbox traffic is accessible