Sandbox

Upgrade to a full sandbox

Upgrade a light instance to a full sandbox, terminating programs, processes and terminals. Files, sandbox ID and name are preserved. Returns HTTP 200 with sandbox detail and a new envdAccessToken; reconnect with it because the old token is revoked. Migration failure preserves source files but does not restart programs. Own face only; E2B ingress returns 404.

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST /sandbox/v1/sandboxes/{sandboxID}/upgrade● Supported

Request parameters

  • sandboxIDstring必填

    path: Sandbox ID.

  • templateIDstring可选
    默认 "base"

    Target template, default base (node22 alias). Requires an E2B image or returns INVALID_PARAMS. File, process and data-plane operations return 409 during upgrade.

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Upgraded sandbox detail with a replacement access token

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
aliasstringAlias of the template
sandboxIDstringIdentifier of the sandbox
clientIDstringIdentifier of the client
startedAtstringTime when the sandbox was started
endAtstringTime when the sandbox will expire
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
allowInternetAccessbooleanWhether internet access was explicitly enabled or disabled for the sandbox. Null means it was not explicitly set.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.
cpuCountintegerCPU cores for the sandbox
memoryMBintegerMemory for the sandbox in MiB
diskSizeMBintegerDisk size for the sandbox in MiB
metadataanyYour own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes.
statestringState of the sandbox
networkobjectNetwork policy of the sandbox: public access, egress allow and deny lists and proxy.
network.allowPublicTrafficbooleanSpecify if the sandbox URLs should be accessible only with authentication.
network.allowOutarray<string>List 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.denyOutarray<string>List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.
network.egressProxyobjectSOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched flows use remote DNS (ATYP=domain).
network.maskRequestHoststringSpecify host mask which will be used for all sandbox requests
network.httpsPortsarray<integer>Unlike E2B, network.httpsPorts is rejected; omit it and serve plaintext HTTP inside the sandbox. The public port URL still uses HTTPS. The upstream field denotes HTTPS-speaking internal ports, permits self-signed certificates and excludes envd port 49983.
network.rulesobjectPer-domain transform rules applied to matching outbound HTTPS requests. Keys may be exact DNS names (for example, "api.example.com") or a leading wildcard (for example, ".example.com"), and are normalized to lowercase on write. Wildcards match subdomains at any depth but not the apex domain; a bare "" is invalid. Exact rules take precedence, followed by the longest matching wildcard suffix, and matching rule sets are not merged. Broad wildcards such as "*.com" are allowed and may expose transformed credentials to every matching destination the sandbox contacts. Rules do not grant network access; configure allowOut separately to permit the destination.
lifecycleobjectSandbox lifecycle policy returned by sandbox info.
lifecycle.autoResumebooleanWhether the sandbox can auto-resume.
lifecycle.onTimeoutstringAction taken when the sandbox times out.
volumeMountsarray<object>Volumes mounted into the sandbox.
volumeMounts[].namestringName of the volume
volumeMounts[].pathstringPath of the volume