Skip to content

Fork sandboxes from a snapshot

POST/snapshots/{id}/fork

Creates count sandboxes from the snapshot (query param or body; body wins). All-or-nothing: a mid-fork failure rolls back. The optional body's publish maps host ports onto the fork (docker -p semantics); publish requires count 1 because host ports are exclusive.

path parameters
object
idstringrequired

Snapshot ID, e.g. snap_ab12cd34.

query parameters
object
countinteger

Number of sandboxes to fork (default 1). The body's count wins when both are set.

Request bodyapplication/json
ForkReq
countinteger
publisharray
items
PortMapping
guest_portinteger
host_ipstring
host_portinteger
protocolstring
Responses
201 CreatedCreated
ForkResponse
sandboxesarray | null
items
SandboxResponse
created_atstringdate-time
idstring
memory_mibinteger
networkNetworkResponse
allowlistarray
items
string
enabledboolean
gatewaystring
guest_ipstring
profilestring
publishedarray
items
PortMapping
guest_portinteger
host_ipstring
host_portinteger
protocolstring
source_snapshot_idstring
vcpusinteger
workdirstring
400 Bad requestBad Request
ErrorResponse
errorstring
403 ForbiddenForbidden
ErrorResponse
errorstring
404 Not foundNot Found
ErrorResponse
errorstring
Authentication
bearerAuthHTTP bearer. Daemon API key. Omit on a keyless loopback daemon.
Request
POST/snapshots/{id}/fork
cURL
curl '/snapshots/{id}/fork?count=' \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{}'
Response
201 Created
{
  "sandboxes": [
    {
      "created_at": "2026-01-02T15:04:05Z",
      "id": "string",
      "memory_mib": 0,
      "network": {
        "allowlist": [
          "string"
        ],
        "enabled": false,
        "gateway": "string",
        "guest_ip": "string"
      },
      "profile": "string",
      "published": [
        {
          "guest_port": 0,
          "host_ip": "string",
          "host_port": 0,
          "protocol": "string"
        }
      ],
      "source_snapshot_id": "string",
      "vcpus": 0,
      "workdir": "string"
    }
  ]
}
Was this page helpful?