Skip to main content
PATCH
Rename, resize (vCPUs, memory, disk) a stopped sandbox, or set its idle pause and metadata.

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

A body key that is none of these is refused with 400 unknown_field (keys match case-insensitively). The retired lifetime timeout (timeoutSeconds, onTimeout or timeout, any value but null) is 400 unknown_field naming maxRunMinutes and autoSuspendAfterSeconds instead (to an instabox-cli/<version> User-Agent, that the CLI is out of date and the commands instabox max-run, auto-suspend and rm), and nothing changes.

maxRunMinutes
integer

Maximum continuous runtime in minutes. -1 is unlimited; 0 sleeps immediately. Independent of idle auto-pause; whichever condition is reached first pauses the sandbox. Free machines default to 480 and only an admin session can change them. The service manages free runtime and may pause a run earlier. The response reports the current limit from runStartedAt; it can change during the run. Paid machines default to -1 and their users can change this setting. Max-run suspension starts a cooldown, returning 409 machine_cooldown with Retry-After on every wake path. By default it is 5 to 20 minutes (5 plus a random 0 to 15) on a paid plan and for the first such pause in a row on the free plan. Back-to-back pauses on the free plan rest longer (60 to 75, then 120 to 135 minutes): "Longer cooldowns on the free plan" at https://instabox.sh/docs/machines/auto-pause#longer-cooldowns-on-the-free-plan. Once cooldown ends, 0 still refuses wake with 409 max_run_disabled until changed.

Required range: -1 <= x <= 2147483647
name
string

New name, unique among the org's live sandboxes; 1-63 of a-z, 0-9, '-', starting with a letter or digit. Absent: unchanged.

rootDiskGiB
integer

Admins only: new root filesystem size in GiB (the template sizes it). From anyone else it is 400 spec_not_allowed; grow the disk with persistentDiskGiB.

Required range: 0 <= x <= 1024
vcpus
integer

New vCPUs of a stopped paid sandbox: with memMiB, one of the workspace's allowedSpecs (alone: the one size with that many vCPUs); 0 or absent: unchanged. Applied at its next start (see the operation). Running is 409 operation_conflict (stop it first), and so is paused (resume it, then stop it); another size, or the free sandbox, is 400 spec_not_allowed.

Required range: 0 <= x <= 32
memMiB
integer

New memory (MiB) of a stopped paid sandbox, as vcpus; 0 or absent: unchanged.

Required range: 0 <= x <= 131072
persistentDiskGiB
integer

New disk (/data) size in GiB, 1-1024, up to the plan's maxDiskGiB; 0 or absent: unchanged. Grow: a running box grows online (no restart, processes keep running); if it can't (rare: the box is unreachable or its host is older), 409 grow_needs_stop (stop it and send the size again); a stopped box grows at its next start. Shrink: only while stopped (else 409 operation_conflict), and only when the used data plus 10% (at least 1 GiB) fits; else 409 disk_too_small, with the smallest size that fits in the message, and the box unchanged. Past 1024 is 400 bad_request, and so is growing on a template without the root-grow capability (a shrink needs none); a free box's disk is fixed (400 spec_not_allowed, running or stopped). The Python SDK's machines.resize(m, disk_gib) sends this field.

Required range: 0 <= x <= 1024
metadata
object | null

Replaces the metadata (same limits as Metadata); {} clears it; null or absent: unchanged.

autoSuspendAfterSeconds
integer

The plan's rule (AutoSuspendAfterSeconds): a paid sandbox takes 300-1800 in whole minutes, as sent, or 0 (off) where the plan allows always on; below 300, above 1800 or not a multiple of 60 is 400 bad_request; the free sandbox takes only 1800 (else 403 spec_not_allowed), and 0 without always on is 403 spec_not_allowed too. A refused value leaves the setting unchanged; the reply shows the effective value. API keys follow the owner's policy. Separately, with manual lifecycle (GET /v1/me) or an admin sign-in session: 120-86400, or 0 (off). Absent: unchanged.

vault
boolean

False disables legacy Vault delivery; true cannot re-enable the legacy flag; absent is unchanged. Org Secret selections are independent.

apply
enum<string>

restart: a running or paused sandbox whose change needs a stop is stopped, resized and started again by one resize operation (202); see the operation. Absent: such a change is 409. Anything else is 400 bad_request.

Available options:
restart

Response

The sandbox, updated.

A sandbox.

id
string
required
name
string
required
desiredState
enum<string>
required
Available options:
creating,
starting,
running,
stopping,
stopped,
suspending,
suspended,
resuming,
deleting,
deleted,
error
state
enum<string>
required
Available options:
creating,
starting,
running,
stopping,
stopped,
suspending,
suspended,
resuming,
deleting,
deleted,
error
revision
integer<int64>
required

Increases with each accepted change.

operationId
string | null
required

The active operation, if any.

template
object
required
spec
object
required

A sandbox's size.

storage
object
required

The sandbox's storage (/data, where HOME lives).

runtime
object
required
autoSuspendAfterSeconds
integer | null
required

The running sandbox is paused once it has been idle this many seconds (no agent working, no terminal input or output, little CPU); null: off. Pause, resume, stop and start keep it.

maxRunMinutes
integer
required

Maximum continuous runtime in minutes. -1 is unlimited; 0 sleeps immediately. Independent of idle auto-pause; whichever condition is reached first pauses the sandbox. Free machines default to 480 and only an admin session can change them. The service manages free runtime and may pause a run earlier. The response reports the current limit from runStartedAt; it can change during the run. Paid machines default to -1 and their users can change this setting. Max-run suspension starts a cooldown, returning 409 machine_cooldown with Retry-After on every wake path. By default it is 5 to 20 minutes (5 plus a random 0 to 15) on a paid plan and for the first such pause in a row on the free plan. Back-to-back pauses on the free plan rest longer (60 to 75, then 120 to 135 minutes): "Longer cooldowns on the free plan" at https://instabox.sh/docs/machines/auto-pause#longer-cooldowns-on-the-free-plan. Once cooldown ends, 0 still refuses wake with 409 max_run_disabled until changed.

Required range: -1 <= x <= 2147483647
runStartedAt
string<date-time> | null
required

Start of the current continuous run, conservatively initialized on a first error observation too; resets only after confirmed sleep.

cooldownUntil
string<date-time> | null
required

All wake paths are refused until this deadline, including admin actions: after a max-run suspension, or the 24-hour lock of an automatic abuse check's pause (cooldownReason).

metadata
object
required

String labels. At most 32 keys of 1-64 characters [A-Za-z0-9_.-], values of at most 512 characters, 8 KiB as JSON.

vault
boolean
required

Whether legacy Vault delivery is enabled. Independent of org Secret selections and delivery status at the sandbox's /secrets endpoint.

guestUser
string
required
read-only

The Linux user in the sandbox that SSH sessions, exec and the terminal log in as, fixed at create: the guestUser the create named, else user (a create from a snapshot: the snapshot's user). dev on sandboxes from templates without the guest-user capability, and on every sandbox created before the field.

Example:

"alice"

orgId
string
required
read-only

The org the sandbox counts against (docs/orgs.md).

createdAt
string<date-time>
required
updatedAt
string<date-time>
required
snapshot
object
image
object
deprecated

Deprecated: snapshot, under its old name (same value).

lastError
object
archiveAt
string<date-time> | null

When the sandbox is stopped if it is running (set at creation with archiveSeconds): its files are kept and a start brings it back. Resuming does not clear it; a sandbox that is not running when it passes only has it cleared. Absent: none.

deleteAt
string<date-time> | null

When the sandbox is deleted, whatever its state (set at creation with deleteAfterSeconds). The delete is an ordinary delete operation (trigger: delete_at), queued at deleteAt (within about a second) once no other operation is in progress. Absent: never.

readyAt
string<date-time>
read-only

When the running sandbox last became ready (runtime.ready turned true: SSH, exec and files work). For a new sandbox, readyAt minus createdAt is its create time; after a start or resume it is that start's. Absent while the sandbox is not ready, and on a sandbox that was already ready before the field existed (until its next start or resume).

cooldownReason
enum<string>

While cooldownUntil has not passed, the automatic abuse check whose pause locks the sandbox, the same as a wake's 409 machine_cooldown Error.reason: abuse_egress_blocklist (it tried to connect to a blocked destination on the egress blocklist, not a DNS lookup), abuse_network_flows (scanning or attack traffic), abuse_cpu (mining). Absent for a max-run cooldown, and once the lock ends.

Available options:
abuse_egress_blocklist,
abuse_network_flows,
abuse_cpu
abuseLock
object

With cooldownReason: what the owner is told about the pause behind the lock. Absent when cooldownReason is.

autoSuspendedAt
string<date-time>

When the sandbox was queued to pause automatically; a successful automatic resume or its next explicit operation clears it. Absent: none.

envNames
string[]

The names of the sandbox's create-time env, sorted. Absent when it has none. The values are never shown: read them in the sandbox.

free
boolean
read-only

A free-tier org's sandbox (docs/pricing.md): never billed, pauses after 30 idle minutes (another autoSuspendAfterSeconds is refused with 403). On a paid plan every sandbox is billed.

earlyAllowanceEnded
boolean
read-only

Set on a stopped or paused free sandbox that cannot be started because its org's early free-sandbox allowance ended and as many free sandboxes as the standard limit allows are running: a start is refused (402 early_allowance_ended) until one is paused or deleted. Absent otherwise.

oomKills
integer<int64>
read-only

Processes the sandbox's kernel OOM killer killed since the sandbox was created (out of memory, or a memory cgroup's limit). Read from the sandbox about once a minute while it runs, and after an exec that exits non-zero; 0 on sandboxes whose host or guest agent predates the reading (absent from older servers).

lastOom
object

The newest OOM kill (absent until one is seen, or when the kernel log no longer held it).