sandboxes

Create a sandbox from the template. All system communication with the sandbox is secured. Use POST /v2/sandboxes instead.

post/sandboxes

Request

  • Base URL
    https://api.e2b.app
  • URL
    https://api.e2b.app/sandboxes
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer and API key in header X-Team-ID
    • or API key in header X-Admin-Token and API key in header X-Team-ID
    • or HTTP bearer and API key in header X-Team-ID

Request body

templateIDstring required

Identifier of the required template

timeoutinteger

Time to live for the sandbox in seconds.

autoPauseboolean

Automatically pauses the sandbox after the timeout

autoPauseMemoryboolean

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).

secureboolean

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

allow_internet_accessboolean

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.

metadataunknown
envVarsunknown
mcpMcp nullable

MCP configuration for the sandbox

Response

The sandbox was created successfully

templateIDstring required

Identifier of the template from which is the sandbox created

sandboxIDstring required

Identifier of the sandbox

aliasstring

Alias of the template

clientIDstring required

Identifier of the client

envdVersionstring required

Version of the envd running in the sandbox

envdAccessTokenstring

Access token used for envd communication

trafficAccessTokenstring nullable

Token required for accessing sandbox via proxy.

domainstring nullable

Base domain where the sandbox traffic is accessible

Changes

    • info

      the request property / became nullable

    • info

      the request property default value true was removed

    • info

      added the new optional request property /

    • info

      request property deprecated