v13

OpenAPI 3.0.32026-07-31359869.4 MB
sandboxes

Update a sandbox

Updates the configuration of a sandbox. Only the provided fields will be modified; omitted fields remain unchanged.

patch/v2/sandboxes/{name}

Path parameters

namestring required

The sandbox to update.

Example:my-sandbox

The sandbox to update.

Query parameters

projectIdstring

The project ID that owns the named sandbox. When provided, takes precedence over OIDC project context.

The project ID that owns the named sandbox. When provided, takes precedence over OIDC project context.

resumeboolean

Whether to automatically resume a stopped named sandbox by creating a new instance from its snapshot. Defaults to false.

Whether to automatically resume a stopped named sandbox by creating a new instance from its snapshot. Defaults to false.

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

runtime'node22' | 'node24' | 'node26' | 'python3.13'

The runtime environment for the sandbox. Determines the pre-installed language runtimes and tools available.

timeoutinteger

Maximum duration in milliseconds that the sandbox can run before being automatically stopped.

persistentboolean

Whether the sandbox persists its state across restarts via automatic snapshots.

envobject

Default environment variables for the sandbox. Set to empty object to clear.

currentSnapshotIdstring

The snapshot ID to set as the current snapshot. Must be active and belong to the same project.

tagsobject

Key-value tags to associate with the sandbox. Replaces existing tags. Set to empty object to clear. Maximum 5 tags.

Example request

{
  "resources": {
    "vcpus": 2,
    "memory": 4096
  },
  "runtime": "node24",
  "timeout": 300000,
  "networkPolicy": {
    "mode": "custom",
    "allowedDomains": [
      "api.github.com",
      "*.npmjs.org"
    ],
    "allowedCIDRs": [
      "35.192.0.0/12",
      "104.16.0.0/12"
    ],
    "deniedCIDRs": [
      "35.192.0.0/12"
    ]
  },
  "env": {
    "NODE_ENV": "production",
    "HELLO": "world"
  },
  "tags": {
    "env": "staging",
    "team": "platform"
  }
}

Response

OR

Example response

{
  "sandbox": {
    "name": "my-sandbox",
    "status": "running",
    "statusUpdatedAt": 1750344501629,
    "persistent": true,
    "region": "iad1",
    "vcpus": 2,
    "memory": 1024,
    "runtime": "node22",
    "image": "my-repo@sha256:2c4e8f9a1b3d5e7f091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708",
    "timeout": 300000,
    "snapshotExpiration": 604800000,
    "keepLastSnapshots": {
      "count": 5,
      "expiration": 604800000,
      "deleteEvicted": true
    },
    "totalEgressBytes": 4096,
    "totalIngressBytes": 2048,
    "totalActiveCpuDurationMs": 5000,
    "totalDurationMs": 60000,
    "cwd": "/vercel/sandbox",
    "tags": {
      "team": "hive",
      "user": "bob"
    },
    "createdAt": 1750344501629,
    "updatedAt": 1750344501629,
    "expiresAt": 1750344801629
  }
}