Skip to main content
POST
Create a copy of a sandbox on its host, without a snapshot.

Authorizations

Authorization
string
header
required

Opaque instabox access token (1 hour). Refresh with /v1/auth/refresh (refresh token valid 30 days, rotates on use).

Headers

Idempotency-Key
string
required

Client-generated key, 1-200 printable ASCII characters, scoped to the user. Same key and same method+path+body returns the original response; same key with a different request returns 409 idempotency_conflict. Records are kept for 7 days.

Required string length: 1 - 200
Pattern: ^[\x21-\x7e]+$

Path Parameters

id
string
required

Sandbox ID (m_ + 26 lowercase base32 characters).

Pattern: ^m_[a-z2-7]{26}$

Body

application/json
name
string

The new sandbox's name (as in CreateMachineRequest). Absent: <source>-fork- and 4 random hex digits.

vcpus
integer

With memMiB, one of the org's sizes. Absent: the source's size.

memMiB
integer
metadata
object

Labels added to the source's (a key here replaces the source's), at most 31 keys here and 32 in all (instabox-fork-of is set to the source's ID). Absent: the source's labels.

deleteAfterSeconds
integer

As in CreateMachineRequest (60-86400). Absent or 0: the source's delete deadline, the same instant (none if the source has none); a source due within 60 seconds is then refused with 400.

autoSuspendAfterSeconds
integer

As in CreateMachineRequest. Absent: the source's (0, off, when it has none), checked against the plan as a create's.

maxRunMinutes
integer

As in CreateMachineRequest. Absent: the source's (the plan default when it has none), checked as a create's.

secrets

The fork's own proxy selection, as in CreateMachineRequest. Absent together with envSecrets and directSecrets: the source's selection is copied.

Allowed value: "all"
envSecrets
string[]

As in CreateMachineRequest.

A unique environment variable name within an org. The names a sandbox's env reserves are reserved (shell variables such as PATH, HOME, BASH_ENV, ENV and IFS, session and trust-store variables, and INSTABOX_ and SSH_ prefixes). A Secret saved under a name before it was reserved is not delivered: the machine's guest status names it.

Pattern: ^[A-Za-z_][A-Za-z0-9_]{0,127}$
directSecrets
object[]

As in CreateMachineRequest; alone, it selects no proxy Secrets.

Maximum array length: 64

Response

The fork's create operation.

The progress of a change to a sandbox (suspend is pause; restore puts its disks back to a snapshot's; move, admin only, copies it to another host pool). It does not return the request it was queued with (a start's vcpus/memMiB show in the sandbox's spec).

id
string
required
machineId
string
required
type
enum<string>
required
Available options:
create,
start,
stop,
suspend,
resume,
delete,
restore,
resize,
move
state
enum<string>
required

succeeded and failed are terminal.

Available options:
queued,
running,
succeeded,
failed
error
object | null
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
phase
string

Free text progress, e.g. scheduling, booting, waiting_ready, snapshotting.

forkInherited
boolean

On the answer to POST /v1/machines/{id}/fork: the control host that took it keeps the source's delete deadline, idle auto-suspend, max run and metadata, and takes autoSuspendAfterSeconds and maxRunMinutes. Absent: a host from before that (during a rolling control deploy), which gave the fork its defaults with only the request's metadata and deleteAfterSeconds; set the idle auto-suspend and max run with PATCH /v1/machines/{id}.

trigger
enum<string>

Set when instabox started the operation itself: idle (paused when idle), max_run (maximum continuous runtime), memory_pressure (paused, its processes kept, because the host it ran on was running out of memory; the next use wakes it, as after idle), request (wake on use), wake (POST /v1/machines/{id}/wake), timeout, archive, delete_at (the sandbox's deleteAt passed), drain (maintenance by an admin), user_delete (an admin deleted the owner), user_disable (an admin disabled the owner), admin (an admin stopped or paused the sandbox), admin_delete (an admin deleted the sandbox), credit (its free-tier org used up the month's included usage), spend_cap, downgrade, subscription_ended, payment_method (its free workspace has no card on file), members (its free workspace has more members than the free plan allows), early_allowance_ended (paused because the account's early free-sandbox allowance ended and it has more free sandboxes than the free plan runs), abuse_pool (paused because the sandbox tried to connect to a blocked destination on the egress blocklist, such as a crypto-mining pool; a DNS lookup of a listed domain never suspends) or abuse_cpu (paused by the CPU abuse detector: a restricted account's sandbox ran flat out for an hour with no memory use, no public port, nobody using it and a connection to a mining port) or abuse_scan (paused by the flow detector: a restricted account's sandbox swept one port across many hosts, scanned many ports of one host or brute-forced a login port). Absent: a client request.

Available options:
idle,
max_run,
memory_pressure,
timeout,
archive,
delete_at,
drain,
request,
wake,
user_delete,
user_disable,
admin,
admin_delete,
credit,
spend_cap,
downgrade,
subscription_ended,
payment_method,
members,
early_allowance_ended,
abuse_pool,
abuse_cpu,
abuse_scan,
abuse_proxy
machine
object

The sandbox as it is when GET /v1/operations/{id} is read. Included when the operation succeeded, the sandbox still exists, and the caller may read sandboxes (machines:read for API keys). Later operations can change it; it is not a record of the state at completion. Absent otherwise, and from older servers.