Sandbox

Connect to a sandbox

Connect to a sandbox, resuming it if paused.

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

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

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path: Sandbox ID.

  • timeoutinteger可选
    默认 300

    Requested remaining lifetime in seconds from the connection. Defaults to 300 seconds; an existing later expiry is preserved.

  • memoryboolean可选

    Defaults to true. When false and the sandbox is paused, resume from disk state only: the sandbox cold-boots fresh and any memory in the snapshot is ignored, never modified or deleted. Disk state has crash-recovery semantics — writes not flushed before the pause may be lost. A no-op for snapshots that contain no memory. Rejected with an error in environments where this capability is not enabled, never silently downgraded to a memory restore.

Returns

201

Errors follow the E2B format — see error codes

Response

HTTP 200

The sandbox was already running

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
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.

HTTP 201

The sandbox was resumed successfully

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
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.