POST /sandboxes
Create sandbox
Create a sandbox from the template
Request body
Required: yes
application/json
Schema: NewSandbox
templateID·string· requiredIdentifier of the required template
timeout·integer· optionalTime to live for the sandbox in seconds.
Format:
int32Default:
15Minimum:
0autoPause·boolean· optionalAutomatically pauses the sandbox after the timeout
Default:
falseautoPauseMemory·boolean· optionalControls 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).
Default:
trueautoResume·SandboxAutoResumeConfig· optionalAuto-resume configuration for paused sandboxes.
autoResume.enabled·SandboxAutoResumeEnabled· requiredAuto-resume enabled flag for paused sandboxes. Default false.
Default:
falsesecure·boolean· optionalSecure all system communication with sandbox
allow_internet_access·boolean· optionalAllow 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·SandboxNetworkConfig· optionalnetwork.allowPublicTraffic·boolean· optionalSpecify if the sandbox URLs should be accessible only with authentication.
Default:
truenetwork.allowOut·array<string>· optionalList of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries.
network.denyOut·array<string>· optionalList of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.
network.maskRequestHost·string· optionalSpecify host mask which will be used for all sandbox requests
network.rules·object· optionalPer-domain transform rules applied to matching egress HTTP/HTTPS requests. Keys are domains (e.g. "api.example.com", "example.com"). A domain listed here is not automatically allowed - use allowOut to permit the traffic.
network.rules.*·array<SandboxNetworkRule>· additional propertynetwork.rules.*.transform·SandboxNetworkTransform· optionalTransformations applied to matching egress requests before forwarding.
network.rules.*.transform.headers·object· optionalHTTP headers to inject or override in matching requests. An existing header with the same name is replaced. Values are plain strings; secret resolution happens client-side before sending to the API.
network.rules.*.transform.headers.*·string· additional propertymetadata·SandboxMetadata· optionalmetadata.*·string· additional propertyMetadata of the sandbox
envVars·EnvVars· optionalenvVars.*·string· additional propertyEnvironment variables for the sandbox
iam·SandboxIam· optionalSandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.
iam.tokens·SandboxIamTokens· optionalNamed workload-token definitions, keyed by a caller-chosen token name.
iam.tokens.*·SandboxIamToken· additional propertyiam.tokens.*.audience·string· requiredAudience of the workload token, stored exactly as provided.
iam.tokens.*.tokenType·string· requiredWorkload token type.
Responses
201
The sandbox was created successfully
Content-Type: application/json
Schema: Sandbox
templateID·string· requiredIdentifier of the template from which is the sandbox created
sandboxID·string· requiredIdentifier of the sandbox
alias·string· optionalAlias of the template
envdVersion·EnvdVersion· requiredVersion of the envd running in the sandbox
domain·string | null· optionalBase domain where the sandbox traffic is accessible
401
Authentication error
Content-Type: application/json
Schema: Error
code·integer· requiredError code
Format:
int32message·string· requiredError
400
Bad request
Content-Type: application/json
Schema: Error
code·integer· requiredError code
Format:
int32message·string· requiredError
500
Server error
Content-Type: application/json
Schema: Error
code·integer· requiredError code
Format:
int32message·string· requiredError