E2B

Fork a sandbox

Create independent copies of a running sandbox.

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

POST /e2b/sandboxes/{sandboxID}/fork● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • timeoutinteger可选
    默认 15

    Time to live for each fork in seconds.

  • countinteger可选
    默认 1

    Number of independent forks from one snapshot; each entry reports its own result or error.

Returns

201

Errors follow the E2B format — see error codes

Response

HTTP 201

The sandbox was snapshotted and the forks were attempted; each entry reports one fork's outcome

application/json

NameTypeDescription
[].sandboxobject
[].sandbox.templateIDstringIdentifier of the template from which is the sandbox created
[].sandbox.sandboxIDstringIdentifier of the sandbox
[].sandbox.aliasstringAlias of the template
[].sandbox.clientIDstringIdentifier of the client
[].sandbox.envdVersionstringVersion of the envd running in the sandbox
[].sandbox.envdAccessTokenstringAccess token used for envd communication
[].sandbox.trafficAccessTokenstringToken required for accessing sandbox via proxy.
[].sandbox.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.
[].errorobject
[].error.codeintegerError code
[].error.error_codestringMachine-readable semantic error code. Not a closed set; initial values: sandbox_capacity_unavailable, sandbox_placement_timeout, sandbox_no_compatible_node, sandbox_create_failed, internal_server_error.
[].error.messagestringError