v3

latestOpenAPI 3.0.0Apache-2.02026-07-27184128410.6 KB
sandbox

Fork a sandbox

post/sandbox/{sandboxIdOrName}/fork

Path parameters

sandboxIdOrNamestring required

Headers

X-Daytona-Organization-IDstring

Use with JWT to specify the organization ID

Request body

namestring

The name for the forked sandbox. If not provided, a unique name will be generated.

Example request

{
  "name": "my-forked-sandbox"
}

Response

Fork operation has been initiated

idstring required

The ID of the sandbox

organizationIdstring required

The organization ID of the sandbox

namestring required

The name of the sandbox

snapshotstring

The snapshot used for the sandbox

userstring required

The user associated with the project

envobject required

Environment variables for the sandbox

labelsobject required

Labels for the sandbox

publicboolean required

Whether the sandbox http preview is public

networkBlockAllboolean required

Whether to block all network access for the sandbox

networkAllowListstring

Comma-separated list of allowed CIDR network addresses for the sandbox

domainAllowListstring

Comma-separated list of allowed domains for the sandbox

targetstring required

The target environment for the sandbox

cpunumber required

The CPU quota for the sandbox

gpunumber required

The GPU quota for the sandbox

gpuType'H100' | 'H200' | 'RTX-PRO-6000' | 'RTX-4090' | 'RTX-5090'
memorynumber required

The memory quota for the sandbox

disknumber required

The disk quota for the sandbox

state'creating' | 'restoring' | 'destroyed' | 'destroying' | 'started' | 'stopped' | 'starting' | 'stopping' | 'error' | 'build_failed' | 'pending_build' | 'building_snapshot' | 'unknown' | 'pulling_snapshot' | 'archived' | 'archiving' | 'resizing' | 'snapshotting' | 'forking' | 'pausing' | 'paused' | 'resuming'
desiredState'destroyed' | 'started' | 'stopped' | 'resized' | 'archived' | 'paused'

The desired state of the sandbox

errorReasonstring

The error reason of the sandbox

recoverableboolean

Whether the sandbox error is recoverable.

warmPoolIdstring

Id of the warm pool this sandbox waits in; set only while it is an unclaimed member.

backupState'None' | 'Pending' | 'InProgress' | 'Completed' | 'Error'

The state of the backup

backupCreatedAtstring

The creation timestamp of the last backup

autoStopIntervalnumber

Auto-stop interval in minutes (0 means disabled)

autoPauseIntervalnumber

Auto-pause interval in minutes (0 means disabled)

autoArchiveIntervalnumber

Auto-archive interval in minutes

autoDeleteIntervalnumber

Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)

autoDestroyAtstring

When the sandbox will be automatically destroyed, regardless of its state (only set when a TTL is configured)

createdAtstring

The creation timestamp of the sandbox

updatedAtstring

The last update timestamp of the sandbox

lastActivityAtstring

The last activity timestamp of the sandbox

sandboxClass'linux-vm' | 'container' | 'android' | 'windows'

The class of the sandbox

daemonVersionstring

The version of the daemon running in the sandbox

runnerIdstring

The runner ID of the sandbox

linkedSandboxIdstring

ID of the sandbox this sandbox is linked to. When set, the sandbox is co-located on the same runner as the linked sandbox.

toolboxProxyUrlstring required

The toolbox proxy URL for the sandbox

Example response

{
  "id": "sandbox123",
  "organizationId": "organization123",
  "name": "MySandbox",
  "snapshot": "daytonaio/sandbox:latest",
  "user": "daytona",
  "env": {
    "NODE_ENV": "production"
  },
  "labels": {
    "daytona.io/public": "true"
  },
  "networkAllowList": "192.168.1.0/16,10.0.0.0/24",
  "domainAllowList": "example.com,*.daytona.io",
  "target": "local",
  "cpu": 2,
  "memory": 4,
  "disk": 10,
  "errorReason": "The sandbox is not running",
  "recoverable": true,
  "backupState": "None",
  "backupCreatedAt": "2024-10-01T12:00:00Z",
  "autoStopInterval": 30,
  "autoPauseInterval": 60,
  "autoArchiveInterval": 10080,
  "autoDeleteInterval": 30,
  "autoDestroyAt": "2026-07-15T12:00:00.000Z",
  "volumes": [
    {
      "volumeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "mountPath": "/data",
      "subpath": "users/alice"
    }
  ],
  "buildInfo": {
    "dockerfileContent": "FROM node:14\nWORKDIR /app\nCOPY . .\nRUN npm install\nCMD [\"npm\", \"start\"]",
    "contextHashes": [
      "hash1",
      "hash2"
    ],
    "snapshotRef": "daytonaio/sandbox:latest"
  },
  "createdAt": "2024-10-01T12:00:00Z",
  "updatedAt": "2024-10-01T12:00:00Z",
  "lastActivityAt": "2024-10-01T12:00:00Z",
  "sandboxClass": "linux-vm",
  "daemonVersion": "1.0.0",
  "runnerId": "runner123",
  "linkedSandboxId": "sandbox123",
  "toolboxProxyUrl": "https://proxy.app.daytona.io/toolbox"
}