---
title: "Fork sandbox"
method: POST
path: "/sandboxes/{sandboxID}/fork"
tags: ["sandboxes"]
---

# Fork sandbox

`POST /sandboxes/{sandboxID}/fork`

Fork the sandbox: checkpoint the running sandbox in place (it is briefly paused, snapshotted with its full memory state, and resumed on its node, keeping its ID and expiration untouched) and create count new sandboxes from that snapshot. Returns one result per requested fork, each carrying either the created sandbox or the error that prevented it from starting. A non-201 status means the request failed before any fork was attempted.

## Path parameters

- `sandboxID` string, required

## Request body

- SandboxForkRequest
  - `timeout` integer — Time to live for the new forked sandboxes in seconds.
  - `count` integer — Number of forked sandboxes to create. All forks boot from the same snapshot, so the snapshot is captured once regardless of count. Each fork succeeds or fails independently; the outcome of each is reported in its entry of the response list.

## Response `201`

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

- SandboxForkResult[]
  - `sandbox` 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
  - `error` Error
    - `code` integer, required — Error code
    - `error_code` string — Machine-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.
    - `message` string, required — Error

## Other responses

- `401` — Authentication error
- `404` — Not found
- `409` — Conflict
- `500` — Server error
- `503` — Service unavailable

## Changes

> 53 revisions in range; 3 could not be searched.

- **2026-07-24** `93ed246a4c10` — 2 info
  - the endpoint scheme security `AdminApiKeyAuth AND AdminTeamAuth` was added to the API
  - the endpoint scheme security `Supabase1TokenAuth AND Supabase2TeamAuth` was removed from the API
- **2026-07-17** `edf2d2943a24` — 1 info
  - endpoint added
- **2023-11-15** `897ba2f1c7b6` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/e2b-dev/apis/e2b-api/changes/sandboxes/:sandboxID/fork/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/e01b3f5506fe/schema)
