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
idstringrequiredSnapshot ID, e.g. snap_ab12cd34.
query parameters
object
countintegerNumber of sandboxes to fork (default 1). The body's count wins when both are set.
Request bodyapplication/json
ForkReq
countintegerpublisharray
items
PortMapping
guest_portintegerhost_ipstringhost_portintegerprotocolstringResponses
201 CreatedCreated
ForkResponse
sandboxesarray | null
items
SandboxResponse
created_atstringdate-timeidstringmemory_mibintegernetworkNetworkResponse
allowlistarray
items
string
enabledbooleangatewaystringguest_ipstringprofilestringpublishedarray
items
PortMapping
guest_portintegerhost_ipstringhost_portintegerprotocolstringsource_snapshot_idstringvcpusintegerworkdirstring400 Bad requestBad Request
ErrorResponse
errorstring403 ForbiddenForbidden
ErrorResponse
errorstring404 Not foundNot Found
ErrorResponse
errorstringAuthentication
bearerAuthHTTP bearer. Daemon API key. Omit on a keyless loopback daemon.Request
▍POST/snapshots/{id}/fork
curl '/snapshots/{id}/fork?count=' \
-X POST \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch("/snapshots/{id}/fork?count=", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: "{}",
});
const data = await response.json();import requests
response = requests.post(
"/snapshots/{id}/fork?count=",
headers={
"Content-Type": "application/json",
},
data="{}",
)
data = response.json()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"
}
]
}