v13

OpenAPI 3.0.32026-07-31359869.4 MB
sandboxes

Create a snapshot

Creates a point-in-time snapshot of a running session's filesystem. Snapshots can be used to quickly restore a session to a previous state or to create new sessions with pre-configured environments. The session must be running and able to accept commands for a snapshot to be created. The session will be terminated after the snapshot is created.

post/v2/sandboxes/sessions/{sessionId}/snapshot

Path parameters

sessionIdstring required

The unique identifier of the session to snapshot.

Example:sbx_abc123

The unique identifier of the session to snapshot.

Query parameters

teamIdstring
Example:team_1a2b3c4d5e6f7g8h9i0j1k2l

The Team identifier to perform the request on behalf of.

slugstring
Example:my-team-url-slug

The Team slug to perform the request on behalf of.

Request body

Response

Example response

{
  "snapshot": {
    "id": "snap_123a6c5209bc3778245d011443644c8d27dc2c50",
    "sourceSessionId": "sbx_123a6c5209bc3778245d011443644c8d27dc2c50",
    "region": "iad1",
    "status": "created",
    "sizeBytes": 104857600,
    "expiresAt": 1750344501629,
    "createdAt": 1750344501629,
    "updatedAt": 1750344501629,
    "lastUsedAt": 1750344501629,
    "creationMethod": "manual",
    "parentId": "snap_parent123"
  },
  "session": {
    "sourceSandboxName": "my-sandbox",
    "projectId": "prj_123a6c5209bc3778245d011443644c8d27dc2c50",
    "id": "sbx_123a6c5209bc3778245d011443644c8d27dc2c50",
    "memory": 2048,
    "vcpus": 2,
    "region": "iad1",
    "runtime": "node22",
    "timeout": 3600000,
    "status": "running",
    "requestedAt": 1750344501629,
    "startedAt": 1750344501629,
    "cwd": "/vercel/sandbox",
    "requestedStopAt": 1750344501629,
    "stoppedAt": 1750344501629,
    "abortedAt": 1750344501629,
    "duration": 3600000,
    "sourceSnapshotId": "snap_123a6c5209bc3778245d011443644c8d27dc2c50",
    "snapshottedAt": 1750344501629,
    "createdAt": 1750344501629,
    "updatedAt": 1750344501629,
    "networkPolicy": {
      "mode": "custom",
      "allowedDomains": [
        "api.vercel.com",
        "*.example.com"
      ],
      "allowedCIDRs": [
        "10.0.0.0/8"
      ],
      "deniedCIDRs": [
        "10.0.0.0/8"
      ],
      "injectionRules": [
        {
          "domain": "api.vercel.com",
          "headerNames": [
            "Authorization",
            "X-API-Key"
          ]
        }
      ]
    },
    "activeCpuDurationMs": 42,
    "networkTransfer": {
      "in": 12543852,
      "out": 15368
    }
  }
}