sandboxes

Create snapshot

Changed on

Create a persistent snapshot from the sandbox's current state. Snapshots can be used to create new sandboxes and persist beyond the original sandbox's lifetime.

post/sandboxes/{sandboxID}/snapshots

Request

  • Base URL
    https://api.e2b.app
  • URL
    https://api.e2b.app/sandboxes/{sandboxID}/snapshots
  • 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

Path parameters

sandboxIDstring required

Request body

namestring

Optional name for the snapshot template. If a snapshot template with this name already exists, a new build will be assigned to the existing template instead of creating a new one.

memoryboolean

Whether to capture a full memory snapshot. When false, only the filesystem is persisted: the snapshot is smaller and faster to take, and sandboxes created from it cold-boot (start fresh from disk) instead of restoring memory, so they begin without the source sandbox's running processes, in-memory state, and open connections. The source sandbox keeps running in both cases. Defaults to true.

Response

Snapshot created successfully

snapshotIDstring required

Identifier of the snapshot template including the tag. Uses namespace/alias when a name was provided (e.g. team-slug/my-snapshot:default), otherwise falls back to the raw template ID (e.g. abc123:default).

namesstring[] required

Full names of the snapshot template including team namespace and tag (e.g. team-slug/my-snapshot:v2)

Changes