---
title: "POST /sandboxes"
method: POST
path: "/sandboxes"
tags: ["sandboxes"]
---

# POST /sandboxes

`POST /sandboxes`

Create a sandbox from the template

## Request body

- NewSandbox
  - `templateID` string, required — Identifier of the required template
  - `timeout` integer — Time to live for the sandbox in seconds.
  - `autoPause` boolean — Automatically pauses the sandbox after the timeout
  - `autoPauseMemory` boolean — 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).
  - `autoResume` SandboxAutoResumeConfig — Auto-resume configuration for paused sandboxes.
    - `enabled` boolean, required — Auto-resume enabled flag for paused sandboxes. Default false.
  - `secure` boolean — Secure all system communication with sandbox
  - `allow_internet_access` boolean — 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.
  - `network` SandboxNetworkConfig
    - `allowPublicTraffic` boolean — Specify if the sandbox URLs should be accessible only with authentication.
    - `allowOut` 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.
    - `denyOut` string[] — List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.
    - `maskRequestHost` string — Specify host mask which will be used for all sandbox requests
    - `rules` object — Per-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.
  - `metadata` unknown
  - `envVars` unknown
  - `mcp` Mcp, nullable — MCP configuration for the sandbox
  - `volumeMounts` SandboxVolumeMount[]
    - `name` string, required — Name of the volume
    - `path` string, required — Path of the volume

## Response `201`

The sandbox was created successfully

- Sandbox
  - `templateID` string, required — Identifier of the template from which is the sandbox created
  - `sandboxID` string, required — Identifier of the sandbox
  - `alias` string — Alias of the template
  - `clientID` string, required — Identifier of the client
  - `envdVersion` string, required — Version of the envd running in the sandbox
  - `envdAccessToken` string — Access token used for envd communication
  - `trafficAccessToken` string, nullable — Token required for accessing sandbox via proxy.
  - `domain` string, nullable — Base domain where the sandbox traffic is accessible

## Other responses

- `400` — Bad request
- `401` — Authentication error
- `500` — Server error

## Changes

- **2026-06-25** `cea884caee43` — 1 info
  - added the new optional request property `autoPauseMemory`
- **2026-05-27** `e13ef89d456c` — 1 info
  - the endpoint scheme security `AuthProviderBearerAuth AND AuthProviderTeamAuth` was added to the API
- **2026-05-26** `6c40e6f50bad` — 1 info
  - added the new optional request property `network/rules`
- **2026-03-04** `dd405b95b0bd` — 1 warning, 1 info
  - removed the request property `autoResume/policy`
  - added the new required request property `autoResume/enabled` with a default value
- **2026-02-24** `0bcb69c4169b` — 2 info
  - added the new optional request property `autoResume`
  - added the new optional request property `volumeMounts`

[Full history](https://skmtc.dev/e2b-dev/apis/e2b-api/changes/sandboxes/post.md)

---

[API](https://skmtc.dev/e2b-dev/apis/e2b-api.md) · [All operations](https://skmtc.dev/e2b-dev/apis/e2b-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/e2b-dev/e2b-api/revisions/edf2d2943a24/schema)
