Creates a new sandbox instance with the specified configuration including resources, environment variables, and network settings.
X-Daytona-Organization-ID
Use with JWT to specify the organization ID
Body Parameters
The name of the sandbox. If not provided, the sandbox ID will be used as the nameExample: MySandbox
The ID or name of the snapshot used for the sandboxExample: ubuntu-4vcpu-8ram-100gb
The user associated with the sandboxExample: daytona
Environment variables for the sandbox as key-value pairsExample: {"NODE_ENV": "production"}
Labels for the sandbox as key-value pairsExample: {"daytona.io/public": "true"}
Whether the sandbox HTTP preview is publicly accessibleDefault: false
Whether to block all network access for the sandboxDefault: false
Comma-separated list of allowed CIDR network addresses for the sandboxExample: 192.168.1.0/16,10.0.0.0/24
The sandbox class typeOptions: small, medium, large
The target (region) where the sandbox will be createdExample: us
CPU cores allocated to the sandboxExample: 2
GPU units allocated to the sandboxExample: 1
Memory allocated to the sandbox in GBExample: 4
Disk space allocated to the sandbox in GBExample: 10
Auto-stop interval in minutes (0 means disabled)Example: 30
Auto-archive interval in minutes (0 means the maximum interval will be used)Example: 10080
Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)Example: 30
Array of volumes to attach to the sandbox
Build information for the sandbox
Response
The unique identifier of the sandbox
The organization ID of the sandbox
The snapshot used for the sandbox
The user associated with the sandbox
Environment variables for the sandbox
Whether the sandbox HTTP preview is public
The target environment for the sandbox
The CPU quota for the sandbox
The GPU quota for the sandbox
The memory quota for the sandbox in GB
The disk quota for the sandbox in GB
The current state of the sandboxOptions: creating, restoring, destroyed, destroying, started, stopped, starting, stopping, error, build_failed, pending_build, building_snapshot, unknown, pulling_snapshot, archived, archiving, resizing
The desired state of the sandbox
The creation timestamp of the sandbox
The last update timestamp of the sandbox
The runner ID of the sandbox
curl -X POST https://api.daytona.io/sandbox \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Daytona-Organization-ID: your-org-id" \
-d '{
"name": "my-development-sandbox",
"snapshot": "ubuntu-4vcpu-8ram-100gb",
"user": "daytona",
"cpu": 4,
"memory": 8,
"disk": 100,
"env": {
"NODE_ENV": "development"
},
"labels": {
"project": "my-app",
"environment": "dev"
},
"autoStopInterval": 60
}'
{
"id": "sandbox123",
"organizationId": "org456",
"name": "my-development-sandbox",
"snapshot": "ubuntu-4vcpu-8ram-100gb",
"user": "daytona",
"env": {
"NODE_ENV": "development"
},
"labels": {
"project": "my-app",
"environment": "dev"
},
"public": false,
"networkBlockAll": false,
"target": "us-east-1",
"cpu": 4,
"gpu": 0,
"memory": 8,
"disk": 100,
"state": "creating",
"desiredState": "started",
"autoStopInterval": 60,
"createdAt": "2024-10-01T12:00:00Z",
"updatedAt": "2024-10-01T12:00:00Z",
"runnerId": "runner789"
}