> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# InstaBox API reference

> API reference for the InstaBox plugin in Corsair: every `instabox.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Exports

### download

`exports.download`

Download a ready export as a .tar.gz (returned as a file)

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.exports.download({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentBase64` | `string` | No | The file, base64-encoded. Missing when the file came back as text or contentOmitted is set. |
| `text` | `string` | No | The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8. |
| `contentType` | `string` | Yes | Media type of the file, for example application/pdf. |
| `byteLength` | `number` | Yes | Size of the file in bytes. |
| `filename` | `string` | No | The file name, when known. |
| `contentOmitted` | `not_requested \| over_limit` | No | Set when the content was left out: the caller did not ask for it, or the file was over the limit. |
| `fileId` | `string` | No | Where the host saved the file. Over the limit it comes in place of the content; a host that keeps every file sets it beside the content too. On Corsair it is a Files id (fil\_…): pass it to another app wherever that app takes a file URL, or read a text file or PDF with files.read\_text. |

***

### get

`exports.get`

Get an export

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.exports.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `bytes` | `number \| null` | No | The archive's size, once ready. |
| `createdAt` | `string \| null` | No | — |
| `error` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | When a ready archive is deleted, 7 days after it was built and never after the workspace's data. |
| `fileName` | `string \| null` | No | The archive's download name: `<name>-data-<date>.tar.gz`. |
| `id` | `string \| null` | No | `exp_...` |
| `machineId` | `string \| null` | No | — |
| `name` | `string \| null` | No | The sandbox's or snapshot's name when the export was asked for. |
| `orgId` | `string \| null` | No | — |
| `readyAt` | `string \| null` | No | — |
| `requestedBy` | `number \| null` | No | — |
| `savedAt` | `string \| null` | No | When the disk was saved: the sandbox's last stop or pause, or the snapshot. |
| `sha256` | `string \| null` | No | The archive's SHA-256 (hex), once ready; also its download ETag. |
| `snapshotId` | `string \| null` | No | — |
| `status` | `string \| null` | No | `ready`: download it. `failed`: `error` says why; ask again. `expired`: deleted; ask again while the workspace is paused or disabled. |

***

## Feedback

### send

`feedback.send`

File an `instabox feedback` report, which opens the account's support ticket

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.feedback.send({
	type: 'bug',
	component: 'cli',
	title: 'example',
	detail: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `area` | `string` | No | — |
| `client_version` | `string` | No | — |
| `command` | `string` | No | — |
| `component` | `cli \| api \| sandbox \| dashboard \| skills \| docs \| other` | Yes | — |
| `detail` | `string` | Yes | — |
| `doc_ref` | `string` | No | — |
| `error` | `string` | No | — |
| `expected` | `string` | No | — |
| `os` | `string` | No | — |
| `sandbox` | `string` | No | — |
| `severity` | `blocker \| major \| minor` | No | — |
| `title` | `string` | Yes | — |
| `type` | `bug \| feature-request \| friction \| other` | Yes | — |
| `workaround` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `ticket` | `object \| null` | No | — |

> [accordion] ticket full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   url?: string | null
> } | null
> ```

***

## Gpu Queue

### cancel

`gpuQueue.cancel`

Cancel a live GPU queue entry

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.gpuQueue.cancel({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The entry's ID (`gq_...`). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `cancelling` | `boolean \| null` | No | As in `MachineQueue`. |
| `enqueuedAt` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | — |
| `gpuType` | `string \| null` | No | — |
| `gpus` | `number \| null` | No | — |
| `id` | `string \| null` | No | — |
| `kind` | `string \| null` | No | As in `MachineQueue`. |
| `machineId` | `string \| null` | No | — |
| `machineName` | `string \| null` | No | The sandbox's name; absent once it is deleted. |
| `orgId` | `string \| null` | No | — |
| `position` | `number \| null` | No | As in `MachineQueue`; absent unless queued. |
| `reason` | `string \| null` | No | Why an ended entry ended: `queue_expired`; `user` (a cancel or a stop) or `machine_deleted` for a cancel; for `failed`, the refusal's error code. |
| `resolvedAt` | `string \| null` | No | When the entry ended; absent while live. |
| `state` | `string \| null` | No | `queued` and `dispatched` are live; `placed` (the sandbox ran), `expired`, `cancelled` and `failed` are ends. |

***

### list

`gpuQueue.list`

List an org's GPU queue entries

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.gpuQueue.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `orgId` | `string` | No | The org whose entries to list. |
| `state` | `queued \| dispatched \| placed \| expired \| cancelled \| failed` | No | Only the entries in this state. |
| `limit` | `number` | No | Page size (1-200, default 50). |
| `cursor` | `string` | No | Opaque `nextCursor` from a previous page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entries` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null` | No | Pass as `cursor` for the next page; absent on the last page. |

> [accordion] entries full type
>
> ```ts theme={null}
> {
>   cancelling?: boolean | null,
>   enqueuedAt?: string | null,
>   expiresAt?: string | null,
>   gpuType?: string | null,
>   gpus?: number | null,
>   id?: string | null,
>   kind?: string | null,
>   machineId?: string | null,
>   machineName?: string | null,
>   orgId?: string | null,
>   position?: number | null,
>   reason?: string | null,
>   resolvedAt?: string | null,
>   state?: string | null
> }[] | null
> ```

***

## Machines

### activityLeases.release

`machines.activityLeases.release`

Release a task's activity lease

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.activityLeases.release({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', leaseID: 'build-42' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `leaseID` | `string` | Yes | Caller-chosen task identifier. Reusing it renews the same lease. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### activityLeases.renew

`machines.activityLeases.renew`

Keep a task's machine awake for a bounded period

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.activityLeases.renew({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', leaseID: 'build-42' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `leaseID` | `string` | Yes | Caller-chosen task identifier. Reusing it renews the same lease. |
| `ttlSeconds` | `number` | No | 30-3600 seconds; 0 or absent uses 300. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `expiresAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `machineId` | `string \| null` | No | — |

***

### claimOomKill

`machines.claimOomKill`

The OOM kill of a background job's processes (instabox jobs wait)

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.claimOomKill({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', cgroup: 'example', bootId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `bootId` | `string` | Yes | The sandbox boot the job ran in (/proc/sys/kernel/random/boot\_id): only that boot's kills are returned, since session scope names repeat after a restart. |
| `cgroup` | `string` | Yes | A background job's cgroup in the sandbox: a session scope such as /user.slice/user-1000.slice/session-3.scope. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `oomKill` | `object \| null` | No | A process the sandbox's kernel OOM killer killed. |

> [accordion] oomKill full type
>
> ```ts theme={null}
> {
>   anonRssBytes?: number | null,
>   at?: string | null,
>   cgroup?: boolean | null,
>   pid?: number | null,
>   process?: string | null,
>   rssBytes?: number | null,
>   uid?: number | null
> } | null
> ```

***

### connectionInfo

`machines.connectionInfo`

How to reach the sandbox over SSH. No side effects

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.connectionInfo({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `capabilities` | `string[] \| null` | No | `mosh`: mosh works (a session that runs `mosh-server new` gets a relay UDP port in its `MOSH CONNECT` line). |
| `host` | `string \| null` | No | — |
| `hostTrust` | `object \| null` | No | — |
| `machineId` | `string \| null` | No | — |
| `moshHost` | `string \| null` | No | Optional separate Mosh gateway host; defaults to host when absent. |
| `moshPort` | `number \| null` | No | SSH port for Mosh session bootstrap; defaults to port when absent. The UDP relay port is negotiated during bootstrap. |
| `port` | `number \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `username` | `string \| null` | No | The sandbox ID. |

> [accordion] hostTrust full type
>
> ```ts theme={null}
> {
>   principals?: string[] | null,
>   publicKey?: string | null,
>   type?: string | null
> } | null
> ```

***

### create

`machines.create`

Create a sandbox

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.create({ name: 'build-42', templateId: 'agent-browser' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `acceptMinimumLease` | `boolean` | No | Accepts the Mac lease of a macOS sandbox (the template's `minimumLease`, `GET /v1/templates`): a whole Mac for the org for at least 24 hours, billed whatever the sandbox does. Required to create one: without it the create is `400 minimum_lease_required` and nothing is placed. |
| `archiveSeconds` | `number` | No | Sets `archiveAt` to now plus this many seconds: the sandbox is stopped then if it is running. 0 or absent: none. |
| `autoSuspendAfterSeconds` | `number` | No | Absent: 1800 (30 minutes). The plan decides, and a value is honoured or refused, never silently replaced: a paid sandbox takes 300-1800 (5 to 30 minutes) in whole minutes, as sent, and 0 (off) where the plan allows always on (else `403 spec_not_allowed`); below 300 (1-299), above 1800, negative or not a multiple of 60 is `400 bad_request`. The free sandbox is fixed at 1800: any other value is `403 spec_not_allowed`, a plan limit (older servers: `403 permission_denied`). A refused create makes no sandbox. The reply's `autoSuspendAfterSeconds` shows the effective value. Separately, an account an admin gave manual lifecycle (`GET /v1/me` `manualLifecycle`) sends 120-86400 idle seconds, or 0 never (docs/idle-suspend.md). |
| `deleteAfterSeconds` | `number` | No | Sets `deleteAt` to now plus this many seconds (60-86400, else 400): the sandbox is then deleted, whatever its state, so it cannot outlive a client that died (`instabox run` sets it). 0 or absent: never. A server without this field ignores it. |
| `desiredState` | `running \| stopped` | No | Default: running. |
| `directSecrets` | `object[]` | No | Direct (delivery env) Secrets from this org, each as a variable and/or a home file. Real values enter the sandbox; prefer proxy Secrets for HTTPS API keys. A fork that sends none of secrets, envSecrets and directSecrets copies its source's selection. |
| `env` | `Record<string, string>` | No | Environment variables for the whole sandbox: every login shell exports them (exec, SSH, the terminal and what they start), from the first command on and again after each start and resume. Names match `^[A-Za-z_][A-Za-z0-9_]{0,127}$`; `BASH_ENV`, `ENV`, `HOME`, `HOSTNAME`, `IFS`, `LOGNAME`, `OLDPWD`, `PATH`, `PWD`, `SHELL`, `SHLVL`, `USER`, bash's readonly `BASHOPTS`, `BASH_VERSINFO`, `EUID`, `PPID`, `SHELLOPTS` and `UID`, the session's `TERM`, `XDG_RUNTIME_DIR` and `DBUS_SESSION_BUS_ADDRESS`, the trust roots `SSL_CERT_FILE`, `SSL_CERT_DIR`, `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE` and `NODE_EXTRA_CA_CERTS`, and names starting `INSTABOX_` or `SSH_` are reserved (set them per exec); values have no NUL bytes; names and values at most 32 KiB together. Not on Windows templates (400). On macOS, bash and zsh login shells export them, and zsh's special parameters (`status`, `path`, `options`, `HISTSIZE`, `USERNAME`, ...) and `ZDOTDIR` are reserved too. Fixed at create: a fork takes its source's, a create from a snapshot only its own. An exec's `envs`, a Vault item and an env Secret of the same name win. Not Secrets: anything in the sandbox can read the values, and the sandbox shows only the names (`envNames`). The values are stored encrypted at rest; a site without the Secret master key refuses env (400 bad\_request). |
| `envSecrets` | `string[]` | No | Explicit env Secret names from this org; omitted or \[] selects none. No all mode; null is rejected. Real values enter the sandbox. Shorthand for directSecrets entries with env = the Secret's name; not sent together with directSecrets. |
| `failFast` | `boolean` | No | When no host has room for the sandbox right now, refuse the create at once with `503 no_capacity` (`retryable`; nothing is created, there is no operation and the `Idempotency-Key` is not kept) instead of answering 202 with an operation that then fails with `no_capacity`. Every other check and the rest of the create are unchanged; a host that had room can still fill up before the operation places the sandbox. The check does not ask for a host with the secret proxy, which a create with `secrets` or `envSecrets` needs: if only hosts without it have room, the create is accepted and its operation fails with `no_capacity`. A create from a snapshot that no host can start now is refused too, instead of being created stopped. A server without this field ignores it, or, if it already refuses unknown body keys, answers `400 unknown_field`. |
| `gpu` | `string` | No | GPUs for the sandbox: `TYPE` (one GPU) or `TYPE:COUNT`, such as `l4` or `l4:2`, a type of the GPU template's `gpuTypes` (`GET /v1/templates`). GPU sandboxes are for paid plans: a free org's create is `403 template_not_allowed`. The count is one of the type's `counts`: the powers of two up to its `maxPerMachine`, such as 1, 2 or 4 (a count of 3 would leave a 4-GPU host one GPU that no pair fits). An org's running sandboxes hold at most 20 GPUs in all (`403 template_limit` past it, also on a start, resume or wake; a stopped or paused sandbox holds none). The template defaults to `gpu`, and the size comes from the type: one of its `sizes`, per GPU (`l4:2` gets twice the vCPUs and memory, the same disk; `vcpus` and `memMiB` pick another of its sizes, multiplied). An unknown type, a template without GPU support or a count not in `counts` (`l4:3`) is `400 bad_request` naming the counts. With `snapshotId` of a GPU sandbox's snapshot, the snapshot's GPU type with any of its `counts` (`l4:4` from a one-GPU snapshot), sized from that count; another type is `400 bad_request`, and absent `gpu` gets the snapshot's own count (a snapshot of a 3-GPU sandbox, from before the rule, is `400 bad_request` until `gpu` names one of the counts). GPUs are billed per GPU-hour while the sandbox runs, on top of its vCPUs and memory. Absent: no GPU (from a snapshot: the snapshot's GPU). |
| `guestUser` | `string` | No | The sandbox's Linux user (`Machine.guestUser`), so `ssh <sandbox>` over your own network (Tailscale) logs in as the same name as on your computer. Lowercase letters, digits, `_` and `-`, starting with a letter or `_`, at most 32 characters; reserved names (`root`, `instabox`, the Debian base system's users and groups such as `sudo`, `systemd-*`) are refused with `400 invalid_guest_user`. Clients send the local username normalized (`DOMAIN\\alice` and `alice@corp.example` become `alice`, lowercase, spaces become `_`) and nothing when that is not a valid name. Absent: `user`; with `snapshotId`, the snapshot's user. Ignored (the sandbox gets `dev`) for templates without the `guest-user` capability. Fixed at create. |
| `imageId` | `string` | No | Deprecated: `snapshotId` under its old name (both: they must be equal). The reply carries a `Deprecation` header. |
| `maxRunMinutes` | `number` | No | Maximum continuous runtime in minutes. -1 is unlimited; 0 sleeps immediately. Independent of idle auto-pause; whichever condition is reached first pauses the sandbox. On a free machine the service sets it and only an admin session can change it: each run starts at 120 minutes and grows with use up to 480 (commands, file access, port requests, terminal or SSH traffic and CPU load count as use; activity leases and wake calls do not): [https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan](https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan). A free machine that is not running reports 480, the most a run can last. 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, except on Pro and higher plans, which have none. By default it is 5 to 20 minutes (5 plus a random 0 to 15) 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](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. |
| `memMiB` | `number` | No | Like vcpus: the memory (MiB) of one of your sizes, such as 8192 with vcpus 4; 0 or a negative is `400 bad_request`. |
| `metadata` | `Record<string, string>` | No | String labels. At most 32 keys of 1-64 characters `[A-Za-z0-9_.-]`, values of at most 512 characters, 8 KiB as JSON. |
| `model` | `string` | No | The Mac model of a macOS template with `models`, by its `name`: the sandbox runs on that model's Macs, at one of that model's sizes. Absent: the template's `pool`, or its first open model when that pool's model is `closed`. With `snapshotId`: the model to run the snapshot on, at that model's sizes; absent, the snapshot's own `model` unless it is closed. |
| `name` | `string` | No | 1-63 lowercase letters, digits or `-`, starting with a letter or digit; unique among the org's sandboxes. Absent or empty: `box-` and 8 random hex digits (the operation's `machineId` and the sandbox carry it). |
| `networkPolicy` | `object` | No | A sandbox's outbound network policy: where it may connect to on the internet. It only narrows: a destination the platform blocks stays blocked. Inbound access (SSH, exec, published ports) is not affected. A fork starts with its source's policy. Domains are allowed through DNS: the sandbox's resolver answers only the listed names and opens the firewall for the addresses it returns, for as long as the DNS record lives, so a program must use the system resolver, and a connection to an address that no allowed name resolved to is refused unless a range lists it. It is not strict data-loss prevention: a site that shares an address with an allowed one (a CDN) is reachable too. |
| `orgId` | `string` | No | The org the sandbox counts against and is shared with (`GET /v1/orgs`); you must be a member. Absent: your personal org, or with `snapshotId` the snapshot's org (a sandbox from a snapshot lives in the snapshot's org; another is `400 bad_request`). Secret selections always resolve within this org. The org's sandbox limit and, on the free tier, its monthly included usage apply (`429 quota_exceeded`, `402 credit_exhausted`). |
| `persistentDiskGiB` | `number` | No | Storage (`/data`) size in GiB. The disks come with the size: storage gets the size's (20 GiB on api.instabox.sh), or a snapshot's storage size when that is larger. Absent or exactly that size: accepted; any other is `400 spec_not_allowed` whose message names the size's storage next to what was asked; 0 or a negative is `400 bad_request`. To get more storage, grow it later with `PATCH /v1/machines/{id}`: a running sandbox's storage grows live, and a shrink applies while it is stopped, at its next boot. The SDKs' `diskGiB` (TypeScript) and `persistent_disk_gib` (Python) are this field; `diskGiB` in a REST body is `400 unknown_field`. |
| `pool` | `string` | No | Admins only: the host pool to place the sandbox in and no other (docs/hybrid-pools.md), "default" included. With snapshotId it must be the snapshot's pool. Absent: the user's pool assignment, else the server's placement.createPools. |
| `queue` | `object` | No | Wait in the GPU queue, or for a macOS sandbox in the Mac queue (`CreateMachineRequest.queue`, `StartMachineRequest.queue`); `{}` waits up to an hour for a GPU, up to 7 days for a Mac. |
| `rootDiskGiB` | `number` | No | System files size in GiB. Like persistentDiskGiB: system files get the template's size (or the snapshot's); naming any other is `400 spec_not_allowed` (the message names the size's root disk), 0 or a negative `400 bad_request`; grow it later with `PATCH /v1/machines/{id}`. |
| `secrets` | `all \| string[]` | No | Proxy selection only. All includes current and future proxy Secrets in the sandbox's org. Explicit names resolve to stable IDs. An empty array selects none. Deleting and recreating a name does not restore an explicit grant. Null is rejected. |
| `snapshotId` | `string` | No | Create from this snapshot of yours: its system files and storage (empty storage for a system-files-only snapshot). |
| `templateId` | `string` | No | The template to create from (`GET /v1/templates`, one with `creatable` true), optionally with a version as `id@version` (e.g. `agent-browser@2026-10-15.4`, the same as `templateVersion`). Absent (and no `snapshotId` or `templateVersion`): agent-browser. An unknown or retired one is refused with `400 bad_request` whose message lists the templates your plan can create from. The free plan creates from agent-browser, android, omarchy or ci only; another template is refused with `403 template_not_allowed`. A create from a snapshot is not limited. |
| `templateVersion` | `string` | No | Default: the version `GET /v1/templates` marks `latest`. `templateId` may name it instead, as `id@version` (e.g. `agent-browser@2026-10-15.4`); both at once must agree. A version the template does not have is `400 bad_request` whose message lists its versions, newest first, the `latest` (or `default`) one tagged. |
| `vault` | `boolean` | No | False disables legacy Vault delivery. Org Secret selections are independent. |
| `vcpus` | `number` | No | Absent: the default size (4 vCPUs, 8 GiB memory; `limits.machineSpec`). From a snapshot with `sizeLocked` (not of a GPU sandbox): the vCPUs and memory of the sandbox it was saved from (the snapshot's `defaultSpec`), absent or named; any other is `400 spec_not_allowed` stating the snapshot's size, and that size is `403 spec_not_allowed` while the org's plan does not offer it (upgrade the plan). A snapshot without `sizeLocked` (saved before this rule) takes any size below. Else one of the org's sizes (`GET /v1/orgs` `allowedSpecs`: the default, its plan's others and any size an admin granted the org; on api.instabox.sh free 4/8192 only, Pro 2/4096, 4/8192, 8/16384, Builder 2/4096 up to 16/32768, Team and Enterprise 2/4096 up to 32/65536), or, from a template with a `pool` (macOS, Windows), its `defaultSpec` or one of its `sizes`, whatever the plan; name memMiB too when two of them have this many vCPUs. Anything else is refused with `400 spec_not_allowed`; 0 or a negative (no size) with `400 bad_request`. |

> [accordion] directSecrets full type
>
> ```ts theme={null}
> {
>   env?: string,
>   file?: string,
>   secret: string
> }[]
> ```

> [accordion] networkPolicy full type
>
> ```ts theme={null}
> {
>   allowCidrs?: string[],
>   allowDomains?: string[],
>   outbound: restricted | open
> }
> ```

> [accordion] queue full type
>
> ```ts theme={null}
> {
>   autoLease?: boolean,
>   maxWaitSeconds?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### createAccess

`machines.createAccess`

Get a Terminal or VNC connection URL and short-lived admission ticket

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.createAccess({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', kind: 'terminal' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `kind` | `terminal \| vnc` | Yes | — |
| `requireTicket` | `boolean` | No | Issue a ticket even when routing points to the combined API, for reconnecting an existing access watch. |
| `webUrl` | `string` | No | Optional access origin for pre-cutover validation. Requires an administrator sign-in (API keys cannot use it). Only this response targets that origin; global routing is unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `expiresAt` | `string \| null` | No | — |
| `protocol` | `string \| null` | No | — |
| `token` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `watchUrl` | `string \| null` | No | — |

***

### createSnapshot

`machines.createSnapshot`

Save a sandbox's system files and storage as a snapshot

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.createSnapshot({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', name: 'OPENAI_API_KEY' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `description` | `string` | No | — |
| `forFork` | `boolean` | No | Saved to fork its source (`instabox fork`, when the native fork cannot run). For a free source, the server records its max-run window as activity extended it, and a sandbox the same user creates from this snapshot in the next 30 minutes starts with that window, as a native fork does. Names no window. |
| `name` | `string` | Yes | Unique among the workspace's snapshots; 1-128 letters, digits, '.', '*' or '-', starting with a letter or digit and not with sn* or im\_. |
| `rootOnly` | `boolean` | No | Save the system files only, not the storage (`/data`). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `dataSizeBytes` | `number \| null` | No | The logical size of the storage disk (`/data`) a sandbox created from it gets, not the bytes stored (the saved data is sparse and compressed); absent for system-files-only snapshots. Sandboxes created from it get at least this much storage. |
| `defaultSpec` | `object \| null` | No | The size a sandbox created from this snapshot gets when the create names none: with `sizeLocked`, the vCPUs and memory of the sandbox it was saved from, the only size a create from it may name; without (saved before this rule), the default size (`limits.machineSpec`, 4 vCPU / 8 GiB on api.instabox.sh); a GPU snapshot: its GPU type's size for the count, which a create may change with `gpu`. Plus the storage (`/data`) and system disk sizes the snapshot was saved with, which a created sandbox gets at least. Absent when its template is unknown. |
| `description` | `string \| null` | No | — |
| `error` | `string \| null` | No | Why a `failed` snapshot failed. |
| `exclusiveBytes` | `number \| null` | No | No longer computed; servers leave it out. (Was the stored bytes only this snapshot references.) |
| `guestUser` | `string \| null` | No | The source sandbox's Linux user (`Machine.guestUser`), which a sandbox created from this snapshot keeps unless the create names another. `dev` for snapshots of sandboxes from older templates. |
| `id` | `string \| null` | No | `sn_...` (`im_...` for older snapshots). |
| `model` | `string \| null` | No | The Mac model (`TemplateModel.name`) a macOS snapshot was saved on. A create from it runs there unless it names another `model` or that model is closed. |
| `name` | `string \| null` | No | Unique among the org's live snapshots. |
| `orgId` | `string \| null` | No | The org the snapshot belongs to (its source sandbox's). |
| `publishedAt` | `string \| null` | No | When the visibility became community or official. |
| `publisherLogin` | `string \| null` | No | Who shared or published it. |
| `rootSizeBytes` | `number \| null` | No | The logical size of the system disk a sandbox created from it gets (its provisioned capacity), not the bytes stored: a snapshot is saved sparse and compressed. |
| `sizeLocked` | `boolean \| null` | No | True for a snapshot (not of a GPU sandbox) saved since a create from a snapshot gets its source's size one to one: a create from it gets `defaultSpec`'s vCPUs and memory only (another is `400 spec_not_allowed`). Absent for older snapshots, which create at any size. |
| `sourceMachineId` | `string \| null` | No | — |
| `sourceSnapshotSeq` | `number \| null` | No | The source sandbox's saved state (`storage.snapshotSeq`) this snapshot was taken from; 0 for a live snapshot of a sandbox that was never stopped. |
| `status` | `string \| null` | No | `ready` can be used. A snapshot of a running sandbox is `pending` while it uploads (its sizes are the sandbox's until then), then `ready` or `failed`. |
| `template` | `object \| null` | No | — |
| `visibility` | `string \| null` | No | Who can create from the snapshot (docs/community-templates.md): `private` (the default, its org's members), `community` (every signed-in account) or `official` (listed next to the built-in templates). Absent on older servers: treat as private. Handlers do not set community or official yet. |

> [accordion] defaultSpec full type
>
> ```ts theme={null}
> {
>   gpuType?: string | null,
>   gpus?: number | null,
>   memMiB?: number | null,
>   persistentDiskGiB?: number | null,
>   rootDiskGiB?: number | null,
>   vcpus?: number | null
> } | null
> ```

> [accordion] template full type
>
> ```ts theme={null}
> {
>   digest?: string | null,
>   id?: string | null,
>   kernel?: string | null,
>   version?: string | null
> } | null
> ```

***

### delete

`machines.delete`

Delete a sandbox, its system files and its storage

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.delete({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `confirm_delete` | `string` | No | X-Confirm-Delete header: the ID or exact name of what is deleted. Left out, the plugin sends the id from the path. |
| `now` | `boolean` | No | `true` deletes a macOS sandbox at once inside its Mac lease's minimum, which is still billed. Without it such a delete is scheduled for the minimum's end (the sandbox's `deleteAt`, the operation's `scheduledAt`). No effect on other sandboxes. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### desktop.createLink

`machines.desktop.createLink`

A short-lived link to watch (or use) the machine's desktop in a browser

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.desktop.createLink({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `ttlSeconds` | `number` | No | How long the link opens the desktop. |
| `viewOnly` | `boolean` | No | The link only shows the desktop; the server drops the viewer's input. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `expiresAt` | `string \| null` | No | — |
| `url` | `string \| null` | No | The dashboard's full-screen viewer, `<dashboard>/desktop/{id}#token=...`; open it or embed it in an iframe. |

***

### desktop.get

`machines.desktop.get`

The state of a running machine's desktop; install or start it

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.desktop.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `action` | `status \| install \| start \| takeover \| handback` | No | — |
| `height` | `number` | No | Screen height in pixels for start, 600-1600 (default 800). |
| `width` | `number` | No | Screen width in pixels for start, 800-2560 (default 1280). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `actions` | `object[] \| null` | No | The computer-use MCP's last tool calls (at most 20, oldest first), as its proxy logged them. |
| `agentPausable` | `boolean \| null` | No | The sandbox's computer-use MCP honors the control (its wrapper runs the server through the proxy). False on a sandbox made before the proxy existed: a takeover would not pause its agent, so clients should offer watching only. |
| `controlError` | `string \| null` | No | The control file in the sandbox could not be written (its runtime directory is missing or not writable): takeover and handback cannot take effect. The reason, from the sandbox. |
| `controller` | `string \| null` | No | Who drives the desktop: `agent` (the default; viewers watch) or `human` (a viewer took over, and the computer-use MCP refuses input until they hand back or 30 s pass without a call from them). |
| `failed` | `boolean \| null` | No | The last install failed; log holds its last lines. |
| `hint` | `string \| null` | No | Only on a `start` that started nothing because the desktop is not installed (`start` never installs), is still installing, or failed to install: what to send next. Absent otherwise. |
| `installed` | `boolean \| null` | No | — |
| `installing` | `boolean \| null` | No | — |
| `kind` | `string \| null` | No | The desktop the sandbox has. `vm` (a Windows or Mac sandbox): its VM's own screen, always running and controlled by every viewer (`controller` `human`, `yours`); `install`, `start`, `takeover` and `handback` change nothing. `x11` (absent from servers before this field): Xvnc and Xfce, installed on first use, driven by the computer-use MCP. `wayland` (the omarchy template): a compositor that starts at boot and is in the image: `install` changes nothing, `start` only brings the session and its VNC server up and sizes the display, and there is no computer-use MCP (`agentPausable` is false); watch and use it through VNC. |
| `log` | `string \| null` | No | — |
| `os` | `string \| null` | No | Only on `kind` `vm`: the guest OS. Clients map keys by it: on `macos`, a Mac's Command is the guest's Command (keysym Alt\_L) and Option its Option (Meta\_L). |
| `running` | `boolean \| null` | No | The VNC server answers: GET /v1/machines/\{id}/vnc connects. |
| `yours` | `boolean \| null` | No | The caller (its sign-in session or API key) is the viewer in control. Absent when false. |

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   args?: {
>   } | null,
>   refused?: boolean | null,
>   time?: string | null,
>   tool?: string | null
> }[] | null
> ```

***

### desktop.revokeLinks

`machines.desktop.revokeLinks`

Revoke every desktop link of the machine and end their open sessions

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.desktop.revokeLinks({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### disk

`machines.disk`

How full the running sandbox's disks are (/data and /), with a near-full warning

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.disk({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `filesystems` | `object[] \| null` | No | `/data`, then `/` (`/` alone where `/data` is not a filesystem of its own). |
| `measuredAt` | `string \| null` | No | — |
| `warning` | `object \| null` | No | — |

> [accordion] filesystems full type
>
> ```ts theme={null}
> {
>   availableBytes?: number | null,
>   inodesUsedPct?: number | null,
>   level?: string | null,
>   mount?: string | null,
>   sizeBytes?: number | null,
>   usedBytes?: number | null,
>   usedPct?: number | null
> }[] | null
> ```

> [accordion] warning full type
>
> ```ts theme={null}
> {
>   level?: string | null,
>   message?: string | null,
>   mount?: string | null,
>   noSpace?: boolean | null,
>   usedPct?: number | null
> } | null
> ```

***

### exec

`machines.exec`

Run a command in a running machine (cmd through bash -lc, or argv with no shell) and get exitCode, stdout and stderr

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.exec({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', cmd: 'uname -a && nproc', timeoutSeconds: 60 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |
| `argv` | `string[]` | No | The program and its arguments, run with no shell: each element reaches the program exactly as sent (no expansion of `$`, `*` or `~`, no word splitting, quotes or redirections; `""` is an empty argument). `argv[0]` must not be empty and is looked up on the login profile's `PATH`; the login profile, `envs` and `cwd` apply as for `cmd`. A program that is not found exits 127, one that cannot run 126. At most 64 KiB counting each element's length plus one, no NUL bytes. The command sent to the sandbox (`envs`, `cwd` and `argv`, quoted for the shell: about 9 bytes per element plus its text) must also stay under 128 KiB, so many short elements can be `400 bad_request` below the 64 KiB cap; send bulk data on `stdin`. Set this or `cmd`. |
| `cmd` | `string` | No | Shell command, run with `bash -lc`. At most 64 KiB, no NUL bytes. Set this or `argv`; an empty `cmd` is no `cmd`. |
| `cwd` | `string` | No | Working directory (default HOME, `/data/home`). |
| `envs` | `Record<string, string>` | No | Environment variables exported before the command (after the login profile). Names match `^[A-Za-z_][A-Za-z0-9_]*$`. |
| `historyCommand` | `string` | No | How the command appears in the sandbox's history instead of `cmd` or `argv`, for a wrapper that runs something else (the CLI's `exec --background`). Cut at 4096 bytes like them; no NUL bytes. |
| `noHistory` | `boolean` | No | Leave the command out of the sandbox's history (`GET /v1/machines/{id}/history`): for a client's own housekeeping commands, such as the CLI's job polls. Does not go with `historyCommand`. |
| `secretEnvs` | `Record<string, string>` | No | Direct (delivery env) Secrets of the sandbox's org exported for this command only: variable name -> Secret name. Resolved at exec time, never stored or written into the sandbox; each use is audited by name. A name may not also be in `envs`; reserved variables are refused. A proxy or missing Secret is 400. Only where `GET /v1/me` has `directSecretRefs`; elsewhere 400 (a control host from before secretEnvs would run the command without them). |
| `stdin` | `string` | No | Text fed to the command, then EOF. It is a JSON string, so the command reads its UTF-8 bytes: NUL, CR and LF arrive unchanged (escaped as `\\u0000`, `\\r`, `\\n`). At most 1 MiB (1048576 bytes) of UTF-8, counted in bytes, not characters (`é` is 2): more is `400 bad_request` `stdin is longer than 1048576 bytes`. The schema sets no `maxLength` here, because `maxLength` counts characters. JSON cannot carry bytes that are not UTF-8; any in the request body reach the command as U+FFFD (`ef bf bd`), with no error. For binary input, send it base64-encoded and decode it in the command (`base64 -d \| ...`; up to 768 KiB of binary fits), or write the file first with `PUT /v1/machines/{id}/files` and redirect it in (`cmd < file`). The CLI's `exec --stdin` does that upload itself for input past 1 MiB or not UTF-8, up to 5 GiB. |
| `timeoutSeconds` | `number` | No | Default 60, max 600. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `diskWarning` | `object \| null` | No | — |
| `exitCode` | `number \| null` | No | Exit status; 128+N if killed by standard signal N, otherwise 255 with `signal` set; 124 if timed out. |
| `invalidUtf8` | `boolean \| null` | No | stdout or stderr had bytes that are not UTF-8 (binary output), replaced with U+FFFD, so the output is not what the command wrote. Absent when false; also set on a streamed exec's exit event. |
| `oomKill` | `object \| null` | No | A process the sandbox's kernel OOM killer killed. |
| `oomKilled` | `boolean \| null` | No | The command exited non-zero and the sandbox's kernel OOM killer killed one of its own processes (the command or a child: its SSH session's cgroup; never another command's process, and each kill is reported once). `oomKill` says which, when the sandbox named it. Checked only for exit code 137, a signal, or stderr saying a process was killed. False when none was seen, the exec's session scope could not be read, or the sandbox's host or guest agent cannot report kills; a kill whose kernel log record was lost is still true when the session scope's oom\_kill count shows it (`oomKill` absent). Absent from older servers. Also set on a streamed exec's exit event. |
| `signal` | `string \| null` | No | The signal that killed the command, as the sandbox named it (absent otherwise). |
| `stderr` | `string \| null` | No | First 1 MiB of standard error. |
| `stdout` | `string \| null` | No | First 1 MiB of standard output. |
| `timedOut` | `boolean \| null` | No | The command ran past `timeoutSeconds` and was killed. |
| `truncated` | `boolean \| null` | No | stdout or stderr was longer than 1 MiB and was cut. |

> [accordion] diskWarning full type
>
> ```ts theme={null}
> {
>   level?: string | null,
>   message?: string | null,
>   mount?: string | null,
>   noSpace?: boolean | null,
>   usedPct?: number | null
> } | null
> ```

> [accordion] oomKill full type
>
> ```ts theme={null}
> {
>   anonRssBytes?: number | null,
>   at?: string | null,
>   cgroup?: boolean | null,
>   pid?: number | null,
>   process?: string | null,
>   rssBytes?: number | null,
>   uid?: number | null
> } | null
> ```

***

### files.createUploadUrl

`machines.files.createUploadUrl`

Get a short-lived signed URL that uploads one file

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.files.createUploadUrl({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', path: '/data/home/notes.md' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `expiresInSeconds` | `number` | No | Lifetime; default 900. |
| `mode` | `string` | No | Octal permissions, for example 0755 (default an existing file's, else 0644). |
| `parents` | `boolean` | No | Create missing parent directories. |
| `path` | `string` | Yes | Absolute path of the file to write. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `expiresAt` | `string \| null` | No | — |
| `maxBytes` | `number \| null` | No | The largest body the URL takes (5 GiB). |
| `method` | `string \| null` | No | — |
| `path` | `string \| null` | No | — |
| `url` | `string \| null` | No | PUT the file's raw bytes here; it carries its own credential. |

***

### files.download

`machines.files.download`

Download a file's raw bytes from a running machine (returned as a file)

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.files.download({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', path: '/data/home/notes.md' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `path` | `string` | Yes | Absolute path of the file, at most 4096 bytes. |
| `range` | `string` | No | Range header, such as bytes=0-1048575, to download part of the file. |
| `if_range` | `string` | No | If-Range header: the ETag of the earlier part, so a changed file comes back whole. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentBase64` | `string` | No | The file, base64-encoded. Missing when the file came back as text or contentOmitted is set. |
| `text` | `string` | No | The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8. |
| `contentType` | `string` | Yes | Media type of the file, for example application/pdf. |
| `byteLength` | `number` | Yes | Size of the file in bytes. |
| `filename` | `string` | No | The file name, when known. |
| `contentOmitted` | `not_requested \| over_limit` | No | Set when the content was left out: the caller did not ask for it, or the file was over the limit. |
| `fileId` | `string` | No | Where the host saved the file. Over the limit it comes in place of the content; a host that keeps every file sets it beside the content too. On Corsair it is a Files id (fil\_…): pass it to another app wherever that app takes a file URL, or read a text file or PDF with files.read\_text. |

***

### files.read

`machines.files.read`

Read a file or directory of a running sandbox

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.files.read({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `path` | `string` | No | Absolute path, at most 4096 bytes (default "/"). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `binary` | `boolean \| null` | No | The file is not UTF-8 text; content is empty. |
| `content` | `string \| null` | No | A text file's content (UTF-8). |
| `entries` | `object[] \| null` | No | A directory's entries, directories first, then by name. |
| `modTime` | `string \| null` | No | — |
| `mode` | `string \| null` | No | As ls -l, for example drwxr-xr-x. |
| `path` | `string \| null` | No | The path read, with symbolic links resolved. |
| `size` | `number \| null` | No | Bytes; 0 for a directory. |
| `truncated` | `boolean \| null` | No | The directory has more entries, or the file more bytes, than returned. |
| `type` | `string \| null` | No | — |

> [accordion] entries full type
>
> ```ts theme={null}
> {
>   modTime?: string | null,
>   mode?: string | null,
>   name?: string | null,
>   size?: number | null,
>   target?: string | null,
>   type?: string | null
> }[] | null
> ```

***

### files.write

`machines.files.write`

Write (upload) a file to a running sandbox

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.files.write({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', path: '/data/home/notes.md', content: 'hello from Corsair' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `path` | `string` | Yes | Absolute path of the file, at most 4096 bytes; not ending in "/". |
| `mode` | `string` | No | Octal permissions, for example 0755 (default an existing file's, else 0644). |
| `parents` | `boolean` | No | Create missing parent directories (mkdir -p). |
| `token` | `string` | No | An upload URL's signed token; replaces the credential. |
| `content` | `string` | Yes | The file content: UTF-8 text, or base64 when encoding is base64. |
| `encoding` | `utf8 \| base64` | No | How content is written: 'utf8' (default) or 'base64' for binary data. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `created` | `boolean \| null` | No | The file is new (201); false when it replaced one (200). |
| `mode` | `string \| null` | No | Octal permissions, for example 0644. |
| `path` | `string \| null` | No | The file written, with symbolic links resolved. |
| `sha256` | `string \| null` | No | Hex SHA-256 of the bytes the server received and wrote. |
| `size` | `number \| null` | No | Bytes written. |

***

### fork

`machines.fork`

Create a copy of a sandbox on its host, without a snapshot

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.fork({
	id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd',
	networkPolicy: { outbound: 'restricted' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `acceptMinimumLease` | `boolean` | No | As in CreateMachineRequest: required to fork a macOS sandbox (`400 minimum_lease_required` without it). |
| `autoSuspendAfterSeconds` | `number` | No | As in CreateMachineRequest. Absent: the source's (0, off, when it has none), checked against the plan as a create's. |
| `deleteAfterSeconds` | `number` | No | 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. |
| `directSecrets` | `object[]` | No | As in CreateMachineRequest; alone, it selects no proxy Secrets. |
| `envSecrets` | `string[]` | No | As in CreateMachineRequest. |
| `maxRunMinutes` | `number` | No | As in CreateMachineRequest. Absent: the source's (the plan default when it has none), checked as a create's. |
| `memMiB` | `number` | No | — |
| `metadata` | `Record<string, string>` | No | 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. |
| `name` | `string` | No | The new sandbox's name (as in CreateMachineRequest). Absent: `<source>-fork-` and 4 random hex digits. |
| `networkPolicy` | `object` | No | A sandbox's outbound network policy: where it may connect to on the internet. It only narrows: a destination the platform blocks stays blocked. Inbound access (SSH, exec, published ports) is not affected. A fork starts with its source's policy. Domains are allowed through DNS: the sandbox's resolver answers only the listed names and opens the firewall for the addresses it returns, for as long as the DNS record lives, so a program must use the system resolver, and a connection to an address that no allowed name resolved to is refused unless a range lists it. It is not strict data-loss prevention: a site that shares an address with an allowed one (a CDN) is reachable too. |
| `secrets` | `all \| string[]` | No | Proxy selection only. All includes current and future proxy Secrets in the sandbox's org. Explicit names resolve to stable IDs. An empty array selects none. Deleting and recreating a name does not restore an explicit grant. Null is rejected. |
| `vcpus` | `number` | No | With `memMiB`, one of the org's sizes, or of the template's `defaultSpec` and `sizes` when it has a `pool`. Absent: the source's size. |

> [accordion] directSecrets full type
>
> ```ts theme={null}
> {
>   env?: string,
>   file?: string,
>   secret: string
> }[]
> ```

> [accordion] networkPolicy full type
>
> ```ts theme={null}
> {
>   allowCidrs?: string[],
>   allowDomains?: string[],
>   outbound: restricted | open
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### get

`machines.get`

Get a sandbox

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `abuseLock` | `object \| null` | No | The owner's account of the abuse check's pause behind a sandbox's cooldownReason: when, what the sandbox did in a sentence (explanation) and in detail (what, with the exact address of a blocked destination, the address and port of a brute force, the swept port or scanned host and the count of a scan, the CPU share and, when the check confirmed it, the mining program and its pool), and how to appeal. |
| `archiveAt` | `string \| null \| null` | No | 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. |
| `autoSuspendAfterSeconds` | `number \| null \| null` | No | 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. |
| `autoSuspendedAt` | `string \| null` | No | When the sandbox was queued to pause automatically; a successful automatic resume or its next explicit operation clears it. Absent: none. |
| `cooldownReason` | `string \| null` | No | 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. |
| `cooldownUntil` | `string \| null \| null` | No | 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). |
| `createdAt` | `string \| null` | No | — |
| `createdByApp` | `object \| null` | No | The public part of an OAuth app, shown on consent pages, grants and sandboxes. |
| `deleteAt` | `string \| null \| null` | No | 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. |
| `desiredState` | `string \| null` | No | — |
| `earlyAllowanceEnded` | `boolean \| null` | No | 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. |
| `envNames` | `string[] \| null` | No | 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 \| null` | No | 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. |
| `guestUser` | `string \| null` | No | 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. |
| `id` | `string \| null` | No | — |
| `image` | `object \| null` | No | Deprecated: `snapshot`, under its old name (same value). |
| `lastError` | `object \| null` | No | — |
| `lastOom` | `object \| null` | No | A process the sandbox's kernel OOM killer killed. |
| `lease` | `object \| null` | No | The Mac lease a macOS sandbox runs under. Absent on every other sandbox, and while a macOS sandbox runs under none (stopped after its lease ended). |
| `maxRunMinutes` | `number \| null` | No | Maximum continuous runtime in minutes. -1 is unlimited; 0 sleeps immediately. Independent of idle auto-pause; whichever condition is reached first pauses the sandbox. On a free machine the service sets it and only an admin session can change it: each run starts at 120 minutes and grows with use up to 480 (commands, file access, port requests, terminal or SSH traffic and CPU load count as use; activity leases and wake calls do not): [https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan](https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan). A free machine that is not running reports 480, the most a run can last. 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, except on Pro and higher plans, which have none. By default it is 5 to 20 minutes (5 plus a random 0 to 15) 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](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. |
| `metadata` | `Record<string, string> \| null` | No | String labels. At most 32 keys of 1-64 characters `[A-Za-z0-9_.-]`, values of at most 512 characters, 8 KiB as JSON. |
| `name` | `string \| null` | No | — |
| `networkPolicy` | `object \| null` | No | A sandbox's outbound network policy: where it may connect to on the internet. It only narrows: a destination the platform blocks stays blocked. Inbound access (SSH, exec, published ports) is not affected. A fork starts with its source's policy. Domains are allowed through DNS: the sandbox's resolver answers only the listed names and opens the firewall for the addresses it returns, for as long as the DNS record lives, so a program must use the system resolver, and a connection to an address that no allowed name resolved to is refused unless a range lists it. It is not strict data-loss prevention: a site that shares an address with an allowed one (a CDN) is reachable too. |
| `oomKills` | `number \| null` | No | 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). |
| `operationId` | `string \| null \| null` | No | The active operation, if any. |
| `orgId` | `string \| null` | No | The org the sandbox counts against (docs/orgs.md). |
| `queue` | `object \| null` | No | A sandbox's live GPU queue or Mac queue entry (`Machine.queue`). A GPU entry has `gpuType` and `gpus`; a Mac entry has `pool`. |
| `readyAt` | `string \| null` | No | 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). |
| `revision` | `number \| null` | No | Increases with each accepted change. |
| `runStartedAt` | `string \| null \| null` | No | Start of the current continuous run, conservatively initialized on a first error observation too; resets only after confirmed sleep. |
| `runtime` | `object \| null` | No | — |
| `snapshot` | `object \| null` | No | — |
| `spec` | `object \| null` | No | A sandbox's size. |
| `state` | `string \| null` | No | — |
| `storage` | `object \| null` | No | The sandbox's storage (`/data`, where HOME lives; `/` on macOS, whose disk is the root volume). |
| `suspendable` | `boolean \| null` | No | false: the sandbox cannot be paused, since its hosts keep no memory of a running sandbox (macOS). Stop the sandbox instead; its files are kept. Absent: it can. |
| `template` | `object \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `vault` | `boolean \| null` | No | Whether legacy Vault delivery is enabled. Independent of org Secret selections and delivery status at the sandbox's /secrets endpoint. |

> [accordion] abuseLock full type
>
> ```ts theme={null}
> {
>   appeal?: string | null,
>   at?: string | null,
>   coreShare?: number | null,
>   count?: number | null,
>   dst?: string | null,
>   explanation?: string | null,
>   kind?: string | null,
>   pool?: string | null,
>   port?: number | null,
>   process?: string | null,
>   what?: string | null
> } | null
> ```

> [accordion] createdByApp full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   logo?: string | null,
>   name?: string | null,
>   publisher?: string | null,
>   verified?: boolean | null
> } | null
> ```

> [accordion] image full type
>
> ```ts theme={null}
> {
>   id?: string | null
> } | null
> ```

> [accordion] lastError full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null
> ```

> [accordion] lastOom full type
>
> ```ts theme={null}
> {
>   anonRssBytes?: number | null,
>   at?: string | null,
>   cgroup?: boolean | null,
>   pid?: number | null,
>   process?: string | null,
>   rssBytes?: number | null,
>   uid?: number | null
> } | null
> ```

> [accordion] lease full type
>
> ```ts theme={null}
> {
>   chargeUntil?: string | null,
>   hourUSD?: number | null,
>   id?: number | null,
>   startedAt?: string | null
> } | null
> ```

> [accordion] networkPolicy full type
>
> ```ts theme={null}
> {
>   allowCidrs?: string[] | null,
>   allowDomains?: string[] | null,
>   outbound?: string | null
> } | null
> ```

> [accordion] queue full type
>
> ```ts theme={null}
> {
>   autoLease?: boolean | null,
>   cancelling?: boolean | null,
>   enqueuedAt?: string | null,
>   expiresAt?: string | null,
>   gpuType?: string | null,
>   gpus?: number | null,
>   id?: string | null,
>   kind?: string | null,
>   offerExpiresAt?: string | null,
>   pool?: string | null,
>   position?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] runtime full type
>
> ```ts theme={null}
> {
>   hostLastSeenAt?: string | null,
>   hostUnreachable?: boolean | null,
>   processesPreserved?: boolean | null,
>   ready?: boolean | null
> } | null
> ```

> [accordion] snapshot full type
>
> ```ts theme={null}
> {
>   id?: string | null
> } | null
> ```

> [accordion] spec full type
>
> ```ts theme={null}
> {
>   gpuType?: string | null,
>   gpus?: number | null,
>   memMiB?: number | null,
>   persistentDiskGiB?: number | null,
>   rootDiskGiB?: number | null,
>   vcpus?: number | null
> } | null
> ```

> [accordion] storage full type
>
> ```ts theme={null}
> {
>   mountPath?: string | null,
>   persistent?: boolean | null,
>   sizeGiB?: number | null,
>   snapshotSeq?: number | null,
>   synced?: boolean | null
> } | null
> ```

> [accordion] template full type
>
> ```ts theme={null}
> {
>   digest?: string | null,
>   id?: string | null,
>   kernel?: string | null,
>   version?: string | null
> } | null
> ```

***

### history.get

`machines.history.get`

One past command with its stored output

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.history.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', execId: 'ex_3n8w1c' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |
| `execId` | `string` | Yes | A command ID (`ex_…`) from the history, or `latest` for the newest command. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `command` | `string \| null` | No | The request's `cmd`, its `argv` quoted for a shell, or its `historyCommand`; cut at 4096 bytes. |
| `cwd` | `string \| null` | No | The request's `cwd` (absent: HOME). |
| `durationMs` | `number \| null` | No | — |
| `endedAt` | `string \| null` | No | — |
| `exitCode` | `number \| null` | No | The `ExecResult`'s exit code; -1 for `lost`, `cancelled` and `unreachable`. |
| `id` | `string \| null` | No | Command ID (`ex_…`). |
| `machineId` | `string \| null` | No | — |
| `outputTruncated` | `boolean \| null` | No | The stored output is cut: the history keeps the first 64 KiB of each stream. |
| `signal` | `string \| null` | No | The signal that killed the command, as the sandbox named it (absent otherwise). |
| `startedAt` | `string \| null` | No | — |
| `status` | `string \| null` | No | How the command ended: `exited` (exit code reported; `signal` set if a signal killed it), `timed_out` (killed after `timeoutSeconds`), `lost` (the connection to the sandbox ended before the exit status; it may have run), `cancelled` (the client closed the request; the command was killed) or `unreachable` (the sandbox could not be reached; nothing ran). |
| `stderr` | `string \| null` | No | The stored stderr (`GET /v1/machines/{id}/history/{execId}` only). |
| `stderrBytes` | `number \| null` | No | Size of the stored stderr. |
| `stdout` | `string \| null` | No | The stored stdout (`GET /v1/machines/{id}/history/{execId}` only). |
| `stdoutBytes` | `number \| null` | No | Size of the stored stdout. |
| `streamed` | `boolean \| null` | No | The client streamed the output (`Accept: text/event-stream`). |
| `timedOut` | `boolean \| null` | No | — |
| `truncated` | `boolean \| null` | No | The exec's result had its output cut at 1 MiB per stream (never for a streamed exec). |
| `userId` | `number \| null` | No | The account that ran it. |

***

### history.list

`machines.history.list`

The commands run in the sandbox through exec, newest first

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.history.list({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |
| `limit` | `number` | No | Default 50. |
| `cursor` | `string` | No | The previous page's nextCursor. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `commands` | `object[] \| null` | No | Newest first. |
| `nextCursor` | `string \| null` | No | The `cursor` of the next (older) page; absent on the last page. |

> [accordion] commands full type
>
> ```ts theme={null}
> {
>   command?: string | null,
>   cwd?: string | null,
>   durationMs?: number | null,
>   endedAt?: string | null,
>   exitCode?: number | null,
>   id?: string | null,
>   machineId?: string | null,
>   outputTruncated?: boolean | null,
>   signal?: string | null,
>   startedAt?: string | null,
>   status?: string | null,
>   stderr?: string | null,
>   stderrBytes?: number | null,
>   stdout?: string | null,
>   stdoutBytes?: number | null,
>   streamed?: boolean | null,
>   timedOut?: boolean | null,
>   truncated?: boolean | null,
>   userId?: number | null
> }[] | null
> ```

***

### list

`machines.list`

List the sandboxes of your orgs

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.list({ limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string` | No | Opaque `nextCursor` from a previous page. |
| `limit` | `number` | No | Page size. |
| `metadata` | `string[]` | No | `key:value` (split at the first `:`); only sandboxes whose metadata has the key with exactly that value. Repeatable; all terms must match (AND). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `machines` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Pass as `cursor` for the next page; null on the last page. |

> [accordion] machines full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> }[] | null
> ```

***

### logs

`machines.logs`

The sandbox's console log and recent operations, to see why it did not boot or is unreachable

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.logs({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `tail` | `number` | No | Lines of console output to return (default 200, at most 5000), fewer when the lines are long (see `consoleTruncated`). Ignored with `after`. |
| `after` | `number` | No | A `cursor` from a previous response: return only the console output written since (up to 1 MiB). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `console` | `string \| null` | No | Console output: the last `tail` lines, or with `after`, the output written since that cursor. Empty when there is none or with `consoleUnavailable`. |
| `consoleReset` | `boolean \| null` | No | `after` was past the end of the log because it was rotated and the kept previous 8 MiB no longer reach back to the cursor, so `console` starts again at the beginning of the current log and output in between is missing. A rotation the kept copy covers carries on without it. Absent when false. |
| `consoleTruncated` | `boolean \| null` | No | There is older console output than `console`: the log goes back further than `tail` lines, or than the bytes read for them (256 per line, at least 64 KiB, at most 1 MiB), so long lines give fewer than `tail`. Absent when false and with `after`. |
| `consoleUnavailable` | `string \| null` | No | Why there is no console output, e.g. the sandbox's disks are in storage or its host is not answering. Absent when the console was read. |
| `cursor` | `number \| null` | No | Where `console` ends; pass it as `after` to read only newer output. |
| `machineId` | `string \| null` | No | — |
| `operations` | `object[] \| null` | No | The last 20 operations, oldest first. |
| `state` | `string \| null` | No | The sandbox's state, as on Machine. |

> [accordion] operations full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   error?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null | null,
>   forkInherited?: boolean | null,
>   id?: string | null,
>   machine?: {
>     abuseLock?: {
>       appeal?: string | null,
>       at?: string | null,
>       coreShare?: number | null,
>       count?: number | null,
>       dst?: string | null,
>       explanation?: string | null,
>       kind?: string | null,
>       pool?: string | null,
>       port?: number | null,
>       process?: string | null,
>       what?: string | null
>     } | null,
>     archiveAt?: string | null | null,
>     autoSuspendAfterSeconds?: number | null | null,
>     autoSuspendedAt?: string | null,
>     cooldownReason?: string | null,
>     cooldownUntil?: string | null | null,
>     createdAt?: string | null,
>     createdByApp?: {
>       id?: string | null,
>       logo?: string | null,
>       name?: string | null,
>       publisher?: string | null,
>       verified?: boolean | null
>     } | null,
>     deleteAt?: string | null | null,
>     desiredState?: string | null,
>     earlyAllowanceEnded?: boolean | null,
>     envNames?: string[] | null,
>     free?: boolean | null,
>     guestUser?: string | null,
>     id?: string | null,
>     image?: {
>       id?: string | null
>     } | null,
>     lastError?: {
>       at?: string | null,
>       code?: string | null,
>       docs?: string | null,
>       docs_url?: string | null,
>       hint?: string | null,
>       message?: string | null,
>       operationId?: string | null | null,
>       reason?: string | null,
>       requestId?: string | null,
>       requiredScopes?: string[] | null,
>       retryAfterSeconds?: number | null,
>       retryable?: boolean | null
>     } | null,
>     lastOom?: {
>       anonRssBytes?: number | null,
>       at?: string | null,
>       cgroup?: boolean | null,
>       pid?: number | null,
>       process?: string | null,
>       rssBytes?: number | null,
>       uid?: number | null
>     } | null,
>     lease?: {
>       chargeUntil?: string | null,
>       hourUSD?: number | null,
>       id?: number | null,
>       startedAt?: string | null
>     } | null,
>     maxRunMinutes?: number | null,
>     metadata?: Record<string, string> | null,
>     name?: string | null,
>     networkPolicy?: {
>       allowCidrs?: string[] | null,
>       allowDomains?: string[] | null,
>       outbound?: string | null
>     } | null,
>     oomKills?: number | null,
>     operationId?: string | null | null,
>     orgId?: string | null,
>     queue?: {
>       autoLease?: boolean | null,
>       cancelling?: boolean | null,
>       enqueuedAt?: string | null,
>       expiresAt?: string | null,
>       gpuType?: string | null,
>       gpus?: number | null,
>       id?: string | null,
>       kind?: string | null,
>       offerExpiresAt?: string | null,
>       pool?: string | null,
>       position?: number | null,
>       state?: string | null
>     } | null,
>     readyAt?: string | null,
>     revision?: number | null,
>     runStartedAt?: string | null | null,
>     runtime?: {
>       hostLastSeenAt?: string | null,
>       hostUnreachable?: boolean | null,
>       processesPreserved?: boolean | null,
>       ready?: boolean | null
>     } | null,
>     snapshot?: {
>       id?: string | null
>     } | null,
>     spec?: {
>       gpuType?: string | null,
>       gpus?: number | null,
>       memMiB?: number | null,
>       persistentDiskGiB?: number | null,
>       rootDiskGiB?: number | null,
>       vcpus?: number | null
>     } | null,
>     state?: string | null,
>     storage?: {
>       mountPath?: string | null,
>       persistent?: boolean | null,
>       sizeGiB?: number | null,
>       snapshotSeq?: number | null,
>       synced?: boolean | null
>     } | null,
>     suspendable?: boolean | null,
>     template?: {
>       digest?: string | null,
>       id?: string | null,
>       kernel?: string | null,
>       version?: string | null
>     } | null,
>     updatedAt?: string | null,
>     vault?: boolean | null
>   } | null,
>   machineId?: string | null,
>   phase?: string | null,
>   scheduledAt?: string | null,
>   state?: string | null,
>   trigger?: string | null,
>   twin?: {
>     machineId?: string | null,
>     name?: string | null,
>     operationId?: string | null
>   } | null,
>   type?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### metrics

`machines.metrics`

The sandbox's recent CPU, memory, network and disk I/O, one sample per 30 seconds

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.metrics({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `since` | `string` | No | RFC 3339 time, in the last 24 hours. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `disk` | `object \| null` | No | — |
| `metrics` | `object[] \| null` | No | Oldest first. |

> [accordion] disk full type
>
> ```ts theme={null}
> {
>   filesystems?: {
>     availableBytes?: number | null,
>     inodesUsedPct?: number | null,
>     level?: string | null,
>     mount?: string | null,
>     sizeBytes?: number | null,
>     usedBytes?: number | null,
>     usedPct?: number | null
>   }[] | null,
>   measuredAt?: string | null,
>   warning?: {
>     level?: string | null,
>     message?: string | null,
>     mount?: string | null,
>     noSpace?: boolean | null,
>     usedPct?: number | null
>   } | null
> } | null
> ```

> [accordion] metrics full type
>
> ```ts theme={null}
> {
>   cpuCount?: number | null,
>   cpuUsedPct?: number | null,
>   diskReadBytesPerSec?: number | null,
>   diskTotal?: number | null,
>   diskUsed?: number | null,
>   diskWriteBytesPerSec?: number | null,
>   gpuCount?: number | null,
>   gpuMemTotal?: number | null,
>   gpuMemUsed?: number | null,
>   gpuUsedPct?: number | null,
>   memTotal?: number | null,
>   memUsed?: number | null,
>   netInBytesPerSec?: number | null,
>   netOutBytesPerSec?: number | null,
>   timestamp?: string | null
> }[] | null
> ```

***

### ports.create

`machines.ports.create`

Give one HTTP port of a sandbox an HTTPS URL, public or private

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.ports.create({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', port: 3000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `access` | `public \| private` | No | Omitted: the current access, or public for a new port. Changing it ends the old publication's connections. `private` is for `http` ports only. |
| `name` | `string` | No | Omitted: the current name, or "Port N" for a new port. |
| `port` | `number` | Yes | Desktop port 5901 and Orca port 6768 (plus the configured Orca port) are reserved. |
| `protocol` | `http \| tcp` | No | Omitted: the current protocol, or `http` for a new port. `tcp` publishes a raw TCP service behind TLS when the server enables it (403 otherwise; admins only while in preview); paid plans only, at most 5 per org by default (429). A port already published with the other protocol answers 409 until it is unpublished. A `tcp` port cannot be private (400). |
| `rotateToken` | `boolean` | No | With a private port: a new token, returned in the response; connections that used the old one close. 400 for a public port. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `access` | `string \| null` | No | `public`: anyone with the URL. `private`: only requests that carry the port's token (`_token` query parameter once, the cookie it sets, or `Authorization: Bearer`). |
| `address` | `string \| null` | No | `tcp` only: the TLS endpoint `host:port`; the client must send the host as SNI. psql: `host=<host> port=<port> sslmode=require`. |
| `createdAt` | `string \| null` | No | — |
| `expiresAt` | `null \| null` | No | Always null (public ports do not expire); kept for older in-guest instabox-port agents. |
| `id` | `string \| null` | No | The publication's ID; a new one after an unpublish, an access change or a token rotation. The URL does not change. |
| `machineId` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `port` | `number \| null` | No | — |
| `protocol` | `string \| null` | No | `http`: an HTTPS URL. `tcp`: a raw TCP service behind TLS at `address`, routed by SNI, always public (docs/public-ports.md, "Raw TCP ports"). |
| `token` | `string \| null` | No | A private port's token (`ibp_...`), only in the publish response that created or rotated it. |
| `tokenUrl` | `string \| null` | No | `url` with `?_token=<token>`: the link to share. Present with `token`. |
| `url` | `string \| null` | No | `https://<port>-<sandbox>.<domain>` for `http`, `tls://<address>` for `tcp`. Empty when public ports (or raw TCP ports) are not configured. |

***

### ports.delete

`machines.ports.delete`

Remove a port's public URL and close its active connections

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.ports.delete({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', port: 3000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `port` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### ports.installAgent

`machines.ports.installAgent`

Install instabox-port in a running sandbox and rotate its credential

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.ports.installAgent({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### ports.list

`machines.ports.list`

List a sandbox's public ports

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.ports.list({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | Whether the server has public ports configured. |
| `ports` | `object[] \| null` | No | — |

> [accordion] ports full type
>
> ```ts theme={null}
> {
>   access?: string | null,
>   address?: string | null,
>   createdAt?: string | null,
>   expiresAt?: null | null,
>   id?: string | null,
>   machineId?: string | null,
>   name?: string | null,
>   port?: number | null,
>   protocol?: string | null,
>   token?: string | null,
>   tokenUrl?: string | null,
>   url?: string | null
> }[] | null
> ```

***

### processes

`machines.processes`

The sandbox's processes, live or as last seen

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.processes({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |
| `all` | `boolean` | No | Also list kernel threads and the listing's own processes. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `capturedAt` | `string \| null` | No | When the list was read. |
| `live` | `boolean \| null` | No | The list was read from the running sandbox for this request; false: the list the server stored last, for a stopped or paused sandbox. |
| `machineId` | `string \| null` | No | — |
| `processes` | `object[] \| null` | No | Without `all`, kernel threads and the listing's own processes are left out. |
| `state` | `string \| null` | No | The sandbox's state now. |
| `trigger` | `string \| null` | No | What read it: a client's request, or the server just before a stop or a pause. |
| `truncated` | `boolean \| null` | No | The listing was cut; processes are missing. |

> [accordion] processes full type
>
> ```ts theme={null}
> {
>   command?: string | null,
>   cpuPercent?: number | null,
>   elapsedSeconds?: number | null,
>   memPercent?: number | null,
>   pid?: number | null,
>   ppid?: number | null,
>   user?: string | null
> }[] | null
> ```

***

### restore

`machines.restore`

Put a sandbox's disks back to a snapshot's, in place

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.restore({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `acceptMinimumLease` | `boolean` | No | As in StartMachineRequest: required when the restore boots a macOS sandbox whose Mac lease ended. |
| `desiredState` | `running \| stopped` | No | `running` (default) boots the restored disks; `stopped` leaves the sandbox stopped with them. |
| `snapshotId` | `string` | No | The snapshot whose disks the sandbox gets (`sn_...`, or an older `im_...` ID). Absent: the snapshot the sandbox was created from; a sandbox created from a template needs it (`400`). |
| `timeoutSeconds` | `number` | No | For a running sandbox: how long to wait for a clean shutdown before it is forced off (0-600; 0: the server default), as for stop. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### resume

`machines.resume`

Resume a paused sandbox where it left off

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.resume({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `vault` | `boolean` | No | False disables legacy Vault delivery without changing org Secret selections. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### secrets.get

`machines.secrets.get`

Read a sandbox's Secret selections and delivery status

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.secrets.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `directSecrets` | `object[] \| null` | No | Direct references (names and paths, never values), envSecrets included. |
| `envSecrets` | `string[] \| null` | No | Direct references that are exactly the same-name shorthand (\{secret X, env X}, no file). Renamed and file references appear only in directSecrets. |
| `guest` | `object \| null` | No | Managed environment and public CA installation. This does not prove existing processes reloaded values. Removing env access cannot remove values already copied into process memory, files, or snapshots. |
| `items` | `object[] \| null` | No | Effective selected Secrets, including proxy all. Metadata only. |
| `proxy` | `object \| null` | No | Last node acknowledgement, not continuous health. Policies expire within 60 seconds unless renewed. Revocation is pending until applied or the previous lease expires. Already admitted streams may finish. |
| `secrets` | `string \| string[] \| null` | No | Proxy selection only. All includes current and future proxy Secrets in the sandbox's org. Explicit names resolve to stable IDs. An empty array selects none. Deleting and recreating a name does not restore an explicit grant. Null is rejected. |
| `usage` | `object[] \| null` | No | Present when the server records proxied request counts: one entry per selected proxy Secret. |
| `version` | `number \| null` | No | Version of this sandbox's selection configuration. |

> [accordion] directSecrets full type
>
> ```ts theme={null}
> {
>   env?: string | null,
>   file?: string | null,
>   secret?: string | null
> }[] | null
> ```

> [accordion] guest full type
>
> ```ts theme={null}
> {
>   appliedAt?: string | null,
>   appliedRevision?: number | null,
>   error?: string | null,
>   items?: {
>     delivery?: string | null,
>     env?: string | null,
>     file?: string | null,
>     id?: string | null,
>     name?: string | null,
>     version?: number | null
>   }[] | null,
>   revision?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   delivery?: string | null,
>   hosts?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   orgId?: string | null,
>   size?: number | null,
>   updatedAt?: string | null,
>   version?: number | null
> }[] | null
> ```

> [accordion] proxy full type
>
> ```ts theme={null}
> {
>   appliedRevision?: number | null,
>   expiresAt?: string | null,
>   revision?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   denied?: number | null,
>   lastUsedAt?: string | null,
>   name?: string | null,
>   requests?: number | null
> }[] | null
> ```

***

### secrets.refresh

`machines.secrets.refresh`

Refresh managed Secret delivery in a running sandbox

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.secrets.refresh({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `directSecrets` | `object[] \| null` | No | Direct references (names and paths, never values), envSecrets included. |
| `envSecrets` | `string[] \| null` | No | Direct references that are exactly the same-name shorthand (\{secret X, env X}, no file). Renamed and file references appear only in directSecrets. |
| `guest` | `object \| null` | No | Managed environment and public CA installation. This does not prove existing processes reloaded values. Removing env access cannot remove values already copied into process memory, files, or snapshots. |
| `items` | `object[] \| null` | No | Effective selected Secrets, including proxy all. Metadata only. |
| `proxy` | `object \| null` | No | Last node acknowledgement, not continuous health. Policies expire within 60 seconds unless renewed. Revocation is pending until applied or the previous lease expires. Already admitted streams may finish. |
| `secrets` | `string \| string[] \| null` | No | Proxy selection only. All includes current and future proxy Secrets in the sandbox's org. Explicit names resolve to stable IDs. An empty array selects none. Deleting and recreating a name does not restore an explicit grant. Null is rejected. |
| `usage` | `object[] \| null` | No | Present when the server records proxied request counts: one entry per selected proxy Secret. |
| `version` | `number \| null` | No | Version of this sandbox's selection configuration. |

> [accordion] directSecrets full type
>
> ```ts theme={null}
> {
>   env?: string | null,
>   file?: string | null,
>   secret?: string | null
> }[] | null
> ```

> [accordion] guest full type
>
> ```ts theme={null}
> {
>   appliedAt?: string | null,
>   appliedRevision?: number | null,
>   error?: string | null,
>   items?: {
>     delivery?: string | null,
>     env?: string | null,
>     file?: string | null,
>     id?: string | null,
>     name?: string | null,
>     version?: number | null
>   }[] | null,
>   revision?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   delivery?: string | null,
>   hosts?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   orgId?: string | null,
>   size?: number | null,
>   updatedAt?: string | null,
>   version?: number | null
> }[] | null
> ```

> [accordion] proxy full type
>
> ```ts theme={null}
> {
>   appliedRevision?: number | null,
>   expiresAt?: string | null,
>   revision?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   denied?: number | null,
>   lastUsedAt?: string | null,
>   name?: string | null,
>   requests?: number | null
> }[] | null
> ```

***

### secrets.update

`machines.secrets.update`

Replace supplied Secret selections for a sandbox

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.secrets.update({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |
| `directSecrets` | `object[]` | No | Replaces the direct references in full; \[] clears. Not sent together with envSecrets. Null is rejected. |
| `envSecrets` | `string[]` | No | Explicit env names; \[] clears. Omission keeps the prior list. Null and all are rejected. |
| `secrets` | `all \| string[]` | No | Proxy selection only. All includes current and future proxy Secrets in the sandbox's org. Explicit names resolve to stable IDs. An empty array selects none. Deleting and recreating a name does not restore an explicit grant. Null is rejected. |

> [accordion] directSecrets full type
>
> ```ts theme={null}
> {
>   env?: string,
>   file?: string,
>   secret: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `directSecrets` | `object[] \| null` | No | Direct references (names and paths, never values), envSecrets included. |
| `envSecrets` | `string[] \| null` | No | Direct references that are exactly the same-name shorthand (\{secret X, env X}, no file). Renamed and file references appear only in directSecrets. |
| `guest` | `object \| null` | No | Managed environment and public CA installation. This does not prove existing processes reloaded values. Removing env access cannot remove values already copied into process memory, files, or snapshots. |
| `items` | `object[] \| null` | No | Effective selected Secrets, including proxy all. Metadata only. |
| `proxy` | `object \| null` | No | Last node acknowledgement, not continuous health. Policies expire within 60 seconds unless renewed. Revocation is pending until applied or the previous lease expires. Already admitted streams may finish. |
| `secrets` | `string \| string[] \| null` | No | Proxy selection only. All includes current and future proxy Secrets in the sandbox's org. Explicit names resolve to stable IDs. An empty array selects none. Deleting and recreating a name does not restore an explicit grant. Null is rejected. |
| `usage` | `object[] \| null` | No | Present when the server records proxied request counts: one entry per selected proxy Secret. |
| `version` | `number \| null` | No | Version of this sandbox's selection configuration. |

> [accordion] directSecrets full type
>
> ```ts theme={null}
> {
>   env?: string | null,
>   file?: string | null,
>   secret?: string | null
> }[] | null
> ```

> [accordion] guest full type
>
> ```ts theme={null}
> {
>   appliedAt?: string | null,
>   appliedRevision?: number | null,
>   error?: string | null,
>   items?: {
>     delivery?: string | null,
>     env?: string | null,
>     file?: string | null,
>     id?: string | null,
>     name?: string | null,
>     version?: number | null
>   }[] | null,
>   revision?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   delivery?: string | null,
>   hosts?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   orgId?: string | null,
>   size?: number | null,
>   updatedAt?: string | null,
>   version?: number | null
> }[] | null
> ```

> [accordion] proxy full type
>
> ```ts theme={null}
> {
>   appliedRevision?: number | null,
>   expiresAt?: string | null,
>   revision?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   denied?: number | null,
>   lastUsedAt?: string | null,
>   name?: string | null,
>   requests?: number | null
> }[] | null
> ```

***

### ssh.createToken

`machines.ssh.createToken`

Issue an SSH token, for a plain `ssh` command without a key

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.ssh.createToken({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `name` | `string` | No | Optional display name; whitespace is trimmed, at most 100 UTF-8 bytes. Existing callers may omit it. |
| `noExpiry` | `boolean` | No | A token that works until it is revoked: the reply has no `expiresAt`. Does not go with `ttlSeconds`. |
| `ttlSeconds` | `number` | No | Default 604800 (7 days), max 2592000 (30 days). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `command` | `string \| null` | No | `ssh -p <port> <token>@<host>` (without `-p` on port 22). |
| `expiresAt` | `string \| null` | No | Absent: the token does not expire (`noExpiry`). |
| `host` | `string \| null` | No | — |
| `hostKeyFingerprint` | `string \| null` | No | SHA256 fingerprint of the SSH server's host key, which ssh asks to confirm on the first connection. |
| `id` | `string \| null` | No | Connection ID (`cn_…`) of the token's grant. |
| `machineId` | `string \| null` | No | — |
| `moshCommand` | `string \| null` | No | The same login with mosh: `mosh --ssh="ssh -p <port>" <token>@<host>` (`mosh <token>@<host>` on port 22). Absent when mosh is not available. |
| `name` | `string \| null` | No | — |
| `port` | `number \| null` | No | — |
| `token` | `string \| null` | No | `ibssh_` and 26 lowercase base32 characters (128 bits): the SSH user name. Shown only here. |

***

### ssh.issueCertificate

`machines.ssh.issueCertificate`

Issue a short-lived SSH user certificate for the sandbox

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.ssh.issueCertificate({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', publicKey: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `publicKey` | `string` | Yes | Client public key in authorized\_keys format. |
| `ttlSeconds` | `number` | No | Default 3600, max 86400. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `certificate` | `string \| null` | No | User certificate in authorized\_keys format. |
| `expiresAt` | `string \| null` | No | — |
| `host` | `string \| null` | No | — |
| `hostTrust` | `object \| null` | No | — |
| `id` | `string \| null` | No | Connection ID (`cn_…`), also the certificate key ID. |
| `machineId` | `string \| null` | No | — |
| `port` | `number \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `username` | `string \| null` | No | — |

> [accordion] hostTrust full type
>
> ```ts theme={null}
> {
>   principals?: string[] | null,
>   publicKey?: string | null,
>   type?: string | null
> } | null
> ```

***

### ssh.listTokens

`machines.ssh.listTokens`

List SSH token metadata, including revoked and recently expired tokens

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.ssh.listTokens({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tokens` | `object[] \| null` | No | — |

> [accordion] tokens full type
>
> ```ts theme={null}
> {
>   command?: string | null,
>   createdAt?: string | null,
>   expiresAt?: string | null,
>   host?: string | null,
>   id?: string | null,
>   moshCommand?: string | null,
>   name?: string | null,
>   port?: number | null,
>   revokedAt?: string | null,
>   token?: string | null
> }[] | null
> ```

***

### ssh.revokeAllTokens

`machines.ssh.revokeAllTokens`

Revoke every SSH token of the sandbox and close their connections

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.ssh.revokeAllTokens({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `revoked` | `number \| null` | No | Tokens that were still valid. |

***

### ssh.revokeToken

`machines.ssh.revokeToken`

Revoke one SSH token and close its SSH and mosh connections

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.ssh.revokeToken({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd', tokenID: 'sst_5k1v8x' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `tokenID` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### start

`machines.start`

Start a stopped or paused sandbox

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.start({
	id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd',
	queue: { autoLease: true },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `acceptMinimumLease` | `boolean` | No | As in CreateMachineRequest: required when the start of a macOS sandbox may open a Mac lease (its org's lease of its Mac ended); `400 minimum_lease_required` without it. |
| `host` | `string` | No | Admin only: place the sandbox on this host. While `storage.synced` is false the sandbox can only start on its current host; another host gets `409 operation_conflict`. |
| `memMiB` | `number` | No | New memory (MiB) of the stopped sandbox, as `vcpus`; absent: its current size. |
| `queue` | `object` | No | Wait in the GPU queue, or for a macOS sandbox in the Mac queue (`CreateMachineRequest.queue`, `StartMachineRequest.queue`); `{}` waits up to an hour for a GPU, up to 7 days for a Mac. |
| `rescue` | `boolean` | No | Boot a stopped sandbox without running its data-init.d hooks (`/usr/local/lib/instabox/data-init.d`, the template's and your own), so a hook that blocks the boot can be fixed from inside. Everything else of the boot runs; the next start runs the hooks again. A running sandbox is `409 operation_conflict` (stop it first), and so is a paused one, which resumes without booting (resume it, then stop it), and so is joining an active start that is not a rescue. A sandbox whose host runs a node-agent without rescue starts fails the operation (`host_unavailable`) and stays stopped. |
| `vault` | `boolean` | No | False disables legacy Vault delivery without changing org Secret selections. |
| `vcpus` | `number` | No | Start a stopped paid sandbox at another of the workspace's `allowedSpecs`, as `PATCH` `vcpus`/`memMiB` then `start` would: with `memMiB`, one of them (alone: the one size with that many vCPUs). Absent: its current size. The size is stored before the start and the boot asks for it; read it from the sandbox's `spec` (the start Operation carries no request body). Its current size changes nothing; a running sandbox at another size is `409 operation_conflict` (stop it first), and so is a paused one (resume it, then stop it), as is a sandbox whose start is already active (naming it: only the same size, or none, joins that start); another size, or the free sandbox, is `400 spec_not_allowed`; 0 or a negative is `400 bad_request`. |

> [accordion] queue full type
>
> ```ts theme={null}
> {
>   autoLease?: boolean,
>   maxWaitSeconds?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### stop

`machines.stop`

Stop a running sandbox (shuts it down; running programs end, files are kept)

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.stop({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `now` | `boolean` | No | Stops a macOS sandbox at once inside its Mac lease's minimum, which is still billed. Without it such a stop is scheduled for the minimum's end (the operation's `scheduledAt`). The query `?now=true` does the same, and is how a delete asks for it. |
| `timeoutSeconds` | `number` | No | How long to wait for a clean shutdown before the sandbox is forced off. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### suspend

`machines.suspend`

Pause a running sandbox, keeping its running programs

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.machines.suspend({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

### update

`machines.update`

Rename, resize (vCPUs, memory, disk) a stopped sandbox, or set its idle pause and metadata

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.update({
	id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd',
	networkPolicy: { outbound: 'restricted' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `apply` | `restart` | No | `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`. |
| `autoSuspendAfterSeconds` | `number` | No | 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. |
| `cancelScheduled` | `boolean` | No | `true` clears a stop or delete scheduled for the end of a macOS sandbox's Mac lease minimum (`archiveAt` and `deleteAt`). |
| `maxRunMinutes` | `number` | No | Maximum continuous runtime in minutes. -1 is unlimited; 0 sleeps immediately. Independent of idle auto-pause; whichever condition is reached first pauses the sandbox. On a free machine the service sets it and only an admin session can change it: each run starts at 120 minutes and grows with use up to 480 (commands, file access, port requests, terminal or SSH traffic and CPU load count as use; activity leases and wake calls do not): [https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan](https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan). A free machine that is not running reports 480, the most a run can last. 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, except on Pro and higher plans, which have none. By default it is 5 to 20 minutes (5 plus a random 0 to 15) 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](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. |
| `memMiB` | `number` | No | New memory (MiB) of a stopped paid sandbox, as `vcpus`; 0 or absent: unchanged. |
| `metadata` | `Record<string, string> \| null` | No | Replaces the metadata (same limits as `Metadata`); \{} clears it; null or absent: unchanged. |
| `name` | `string` | No | New name, unique among the org's live sandboxes; 1-63 of a-z, 0-9, '-', starting with a letter or digit. Absent: unchanged. |
| `networkPolicy` | `object` | No | A sandbox's outbound network policy: where it may connect to on the internet. It only narrows: a destination the platform blocks stays blocked. Inbound access (SSH, exec, published ports) is not affected. A fork starts with its source's policy. Domains are allowed through DNS: the sandbox's resolver answers only the listed names and opens the firewall for the addresses it returns, for as long as the DNS record lives, so a program must use the system resolver, and a connection to an address that no allowed name resolved to is refused unless a range lists it. It is not strict data-loss prevention: a site that shares an address with an allowed one (a CDN) is reachable too. |
| `persistentDiskGiB` | `number` | No | 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. |
| `rootDiskGiB` | `number` | No | 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`. |
| `vault` | `boolean` | No | False disables legacy Vault delivery; true cannot re-enable the legacy flag; absent is unchanged. Org Secret selections are independent. |
| `vcpus` | `number` | No | New vCPUs of a stopped paid sandbox: with `memMiB`, one of the workspace's `allowedSpecs`, or of its template's `defaultSpec` and `sizes` when the template has a `pool` (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`. |

> [accordion] networkPolicy full type
>
> ```ts theme={null}
> {
>   allowCidrs?: string[],
>   allowDomains?: string[],
>   outbound: restricted | open
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | {
>   createdAt?: string | null,
>   error?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null | null,
>   forkInherited?: boolean | null,
>   id?: string | null,
>   machine?: {
>     abuseLock?: {
>       appeal?: string | null,
>       at?: string | null,
>       coreShare?: number | null,
>       count?: number | null,
>       dst?: string | null,
>       explanation?: string | null,
>       kind?: string | null,
>       pool?: string | null,
>       port?: number | null,
>       process?: string | null,
>       what?: string | null
>     } | null,
>     archiveAt?: string | null | null,
>     autoSuspendAfterSeconds?: number | null | null,
>     autoSuspendedAt?: string | null,
>     cooldownReason?: string | null,
>     cooldownUntil?: string | null | null,
>     createdAt?: string | null,
>     createdByApp?: {
>       id?: string | null,
>       logo?: string | null,
>       name?: string | null,
>       publisher?: string | null,
>       verified?: boolean | null
>     } | null,
>     deleteAt?: string | null | null,
>     desiredState?: string | null,
>     earlyAllowanceEnded?: boolean | null,
>     envNames?: string[] | null,
>     free?: boolean | null,
>     guestUser?: string | null,
>     id?: string | null,
>     image?: {
>       id?: string | null
>     } | null,
>     lastError?: {
>       at?: string | null,
>       code?: string | null,
>       docs?: string | null,
>       docs_url?: string | null,
>       hint?: string | null,
>       message?: string | null,
>       operationId?: string | null | null,
>       reason?: string | null,
>       requestId?: string | null,
>       requiredScopes?: string[] | null,
>       retryAfterSeconds?: number | null,
>       retryable?: boolean | null
>     } | null,
>     lastOom?: {
>       anonRssBytes?: number | null,
>       at?: string | null,
>       cgroup?: boolean | null,
>       pid?: number | null,
>       process?: string | null,
>       rssBytes?: number | null,
>       uid?: number | null
>     } | null,
>     lease?: {
>       chargeUntil?: string | null,
>       hourUSD?: number | null,
>       id?: number | null,
>       startedAt?: string | null
>     } | null,
>     maxRunMinutes?: number | null,
>     metadata?: Record<string, string> | null,
>     name?: string | null,
>     networkPolicy?: {
>       allowCidrs?: string[] | null,
>       allowDomains?: string[] | null,
>       outbound?: string | null
>     } | null,
>     oomKills?: number | null,
>     operationId?: string | null | null,
>     orgId?: string | null,
>     queue?: {
>       autoLease?: boolean | null,
>       cancelling?: boolean | null,
>       enqueuedAt?: string | null,
>       expiresAt?: string | null,
>       gpuType?: string | null,
>       gpus?: number | null,
>       id?: string | null,
>       kind?: string | null,
>       offerExpiresAt?: string | null,
>       pool?: string | null,
>       position?: number | null,
>       state?: string | null
>     } | null,
>     readyAt?: string | null,
>     revision?: number | null,
>     runStartedAt?: string | null | null,
>     runtime?: {
>       hostLastSeenAt?: string | null,
>       hostUnreachable?: boolean | null,
>       processesPreserved?: boolean | null,
>       ready?: boolean | null
>     } | null,
>     snapshot?: {
>       id?: string | null
>     } | null,
>     spec?: {
>       gpuType?: string | null,
>       gpus?: number | null,
>       memMiB?: number | null,
>       persistentDiskGiB?: number | null,
>       rootDiskGiB?: number | null,
>       vcpus?: number | null
>     } | null,
>     state?: string | null,
>     storage?: {
>       mountPath?: string | null,
>       persistent?: boolean | null,
>       sizeGiB?: number | null,
>       snapshotSeq?: number | null,
>       synced?: boolean | null
>     } | null,
>     suspendable?: boolean | null,
>     template?: {
>       digest?: string | null,
>       id?: string | null,
>       kernel?: string | null,
>       version?: string | null
>     } | null,
>     updatedAt?: string | null,
>     vault?: boolean | null
>   } | null,
>   machineId?: string | null,
>   phase?: string | null,
>   scheduledAt?: string | null,
>   state?: string | null,
>   trigger?: string | null,
>   twin?: {
>     machineId?: string | null,
>     name?: string | null,
>     operationId?: string | null
>   } | null,
>   type?: string | null,
>   updatedAt?: string | null
> }
> ```

***

### usage

`machines.usage`

What the sandbox used over a window, for billing

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.usage({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |
| `from` | `string` | No | — |
| `to` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `diskGiBSeconds` | `number \| null` | No | Disk (`/data`) size, current size, times the seconds the sandbox existed in the window. |
| `egressBytes` | `number \| null` | No | Bytes the sandbox sent to the public internet, by whole hour: every hour from the one `from` falls in up to `to`. Billed or not (the plan's free egress and free sandboxes included). |
| `from` | `string \| null` | No | — |
| `memGiBSeconds` | `number \| null` | No | Memory GiB times running seconds. |
| `runningSeconds` | `number \| null` | No | Seconds the sandbox was running in the window. |
| `to` | `string \| null` | No | — |
| `vcpuSeconds` | `number \| null` | No | vCPUs times running seconds. |

***

### vault.get

`machines.vault.get`

What the Vault writes into this machine (docs/vault.md)

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.machines.vault.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `applied` | `object \| null` | No | The last write into the machine; null: none yet. |
| `enabled` | `boolean \| null` | No | The machine takes the Vault. |
| `items` | `object[] \| null` | No | The items that apply with the machine's current metadata (none when enabled is false). |

> [accordion] applied full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   env?: string[] | null,
>   error?: string | null,
>   files?: {
>     path?: string | null,
>     sha256?: string | null
>   }[] | null,
>   kept?: {
>     path?: string | null,
>     reason?: string | null
>   }[] | null,
>   removed?: string[] | null
> } | null | null
> ```

> [accordion] items full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   name?: string | null,
>   path?: string | null
> }[] | null
> ```

***

### vault.write

`machines.vault.write`

Write the current Vault items into the running machine now

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.machines.vault.write({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters) or the sandbox's name (unique among your sandboxes; names never contain `_`, so the two never collide). Older servers take only the ID and answer `404` for a name. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `at` | `string \| null` | No | — |
| `env` | `string[] \| null` | No | The variables exported. |
| `error` | `string \| null` | No | Why the write failed, when it did. |
| `files` | `object[] \| null` | No | The files written (or, when the write failed, those of the last write, kept for the next reconciliation). |
| `kept` | `object[] \| null` | No | Files that no longer apply but were left (changed in the machine since, or not writable). |
| `removed` | `string[] \| null` | No | Files of an earlier write removed because they no longer apply. |

> [accordion] files full type
>
> ```ts theme={null}
> {
>   path?: string | null,
>   sha256?: string | null
> }[] | null
> ```

> [accordion] kept full type
>
> ```ts theme={null}
> {
>   path?: string | null,
>   reason?: string | null
> }[] | null
> ```

***

### wake

`machines.wake`

Resume an idle-suspended machine before using it

**Risk:** `destructive`

```ts theme={null}
await corsair.instabox.api.machines.wake({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Sandbox ID (`m_` + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `abuseLock` | `object \| null` | No | The owner's account of the abuse check's pause behind a sandbox's cooldownReason: when, what the sandbox did in a sentence (explanation) and in detail (what, with the exact address of a blocked destination, the address and port of a brute force, the swept port or scanned host and the count of a scan, the CPU share and, when the check confirmed it, the mining program and its pool), and how to appeal. |
| `archiveAt` | `string \| null \| null` | No | 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. |
| `autoSuspendAfterSeconds` | `number \| null \| null` | No | 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. |
| `autoSuspendedAt` | `string \| null` | No | When the sandbox was queued to pause automatically; a successful automatic resume or its next explicit operation clears it. Absent: none. |
| `cooldownReason` | `string \| null` | No | 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. |
| `cooldownUntil` | `string \| null \| null` | No | 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). |
| `createdAt` | `string \| null` | No | — |
| `createdByApp` | `object \| null` | No | The public part of an OAuth app, shown on consent pages, grants and sandboxes. |
| `deleteAt` | `string \| null \| null` | No | 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. |
| `desiredState` | `string \| null` | No | — |
| `earlyAllowanceEnded` | `boolean \| null` | No | 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. |
| `envNames` | `string[] \| null` | No | 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 \| null` | No | 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. |
| `guestUser` | `string \| null` | No | 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. |
| `id` | `string \| null` | No | — |
| `image` | `object \| null` | No | Deprecated: `snapshot`, under its old name (same value). |
| `lastError` | `object \| null` | No | — |
| `lastOom` | `object \| null` | No | A process the sandbox's kernel OOM killer killed. |
| `lease` | `object \| null` | No | The Mac lease a macOS sandbox runs under. Absent on every other sandbox, and while a macOS sandbox runs under none (stopped after its lease ended). |
| `maxRunMinutes` | `number \| null` | No | Maximum continuous runtime in minutes. -1 is unlimited; 0 sleeps immediately. Independent of idle auto-pause; whichever condition is reached first pauses the sandbox. On a free machine the service sets it and only an admin session can change it: each run starts at 120 minutes and grows with use up to 480 (commands, file access, port requests, terminal or SSH traffic and CPU load count as use; activity leases and wake calls do not): [https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan](https://instabox.sh/docs/machines/auto-pause#runtime-on-the-free-plan). A free machine that is not running reports 480, the most a run can last. 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, except on Pro and higher plans, which have none. By default it is 5 to 20 minutes (5 plus a random 0 to 15) 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](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. |
| `metadata` | `Record<string, string> \| null` | No | String labels. At most 32 keys of 1-64 characters `[A-Za-z0-9_.-]`, values of at most 512 characters, 8 KiB as JSON. |
| `name` | `string \| null` | No | — |
| `networkPolicy` | `object \| null` | No | A sandbox's outbound network policy: where it may connect to on the internet. It only narrows: a destination the platform blocks stays blocked. Inbound access (SSH, exec, published ports) is not affected. A fork starts with its source's policy. Domains are allowed through DNS: the sandbox's resolver answers only the listed names and opens the firewall for the addresses it returns, for as long as the DNS record lives, so a program must use the system resolver, and a connection to an address that no allowed name resolved to is refused unless a range lists it. It is not strict data-loss prevention: a site that shares an address with an allowed one (a CDN) is reachable too. |
| `oomKills` | `number \| null` | No | 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). |
| `operationId` | `string \| null \| null` | No | The active operation, if any. |
| `orgId` | `string \| null` | No | The org the sandbox counts against (docs/orgs.md). |
| `queue` | `object \| null` | No | A sandbox's live GPU queue or Mac queue entry (`Machine.queue`). A GPU entry has `gpuType` and `gpus`; a Mac entry has `pool`. |
| `readyAt` | `string \| null` | No | 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). |
| `revision` | `number \| null` | No | Increases with each accepted change. |
| `runStartedAt` | `string \| null \| null` | No | Start of the current continuous run, conservatively initialized on a first error observation too; resets only after confirmed sleep. |
| `runtime` | `object \| null` | No | — |
| `snapshot` | `object \| null` | No | — |
| `spec` | `object \| null` | No | A sandbox's size. |
| `state` | `string \| null` | No | — |
| `storage` | `object \| null` | No | The sandbox's storage (`/data`, where HOME lives; `/` on macOS, whose disk is the root volume). |
| `suspendable` | `boolean \| null` | No | false: the sandbox cannot be paused, since its hosts keep no memory of a running sandbox (macOS). Stop the sandbox instead; its files are kept. Absent: it can. |
| `template` | `object \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `vault` | `boolean \| null` | No | Whether legacy Vault delivery is enabled. Independent of org Secret selections and delivery status at the sandbox's /secrets endpoint. |

> [accordion] abuseLock full type
>
> ```ts theme={null}
> {
>   appeal?: string | null,
>   at?: string | null,
>   coreShare?: number | null,
>   count?: number | null,
>   dst?: string | null,
>   explanation?: string | null,
>   kind?: string | null,
>   pool?: string | null,
>   port?: number | null,
>   process?: string | null,
>   what?: string | null
> } | null
> ```

> [accordion] createdByApp full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   logo?: string | null,
>   name?: string | null,
>   publisher?: string | null,
>   verified?: boolean | null
> } | null
> ```

> [accordion] image full type
>
> ```ts theme={null}
> {
>   id?: string | null
> } | null
> ```

> [accordion] lastError full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null
> ```

> [accordion] lastOom full type
>
> ```ts theme={null}
> {
>   anonRssBytes?: number | null,
>   at?: string | null,
>   cgroup?: boolean | null,
>   pid?: number | null,
>   process?: string | null,
>   rssBytes?: number | null,
>   uid?: number | null
> } | null
> ```

> [accordion] lease full type
>
> ```ts theme={null}
> {
>   chargeUntil?: string | null,
>   hourUSD?: number | null,
>   id?: number | null,
>   startedAt?: string | null
> } | null
> ```

> [accordion] networkPolicy full type
>
> ```ts theme={null}
> {
>   allowCidrs?: string[] | null,
>   allowDomains?: string[] | null,
>   outbound?: string | null
> } | null
> ```

> [accordion] queue full type
>
> ```ts theme={null}
> {
>   autoLease?: boolean | null,
>   cancelling?: boolean | null,
>   enqueuedAt?: string | null,
>   expiresAt?: string | null,
>   gpuType?: string | null,
>   gpus?: number | null,
>   id?: string | null,
>   kind?: string | null,
>   offerExpiresAt?: string | null,
>   pool?: string | null,
>   position?: number | null,
>   state?: string | null
> } | null
> ```

> [accordion] runtime full type
>
> ```ts theme={null}
> {
>   hostLastSeenAt?: string | null,
>   hostUnreachable?: boolean | null,
>   processesPreserved?: boolean | null,
>   ready?: boolean | null
> } | null
> ```

> [accordion] snapshot full type
>
> ```ts theme={null}
> {
>   id?: string | null
> } | null
> ```

> [accordion] spec full type
>
> ```ts theme={null}
> {
>   gpuType?: string | null,
>   gpus?: number | null,
>   memMiB?: number | null,
>   persistentDiskGiB?: number | null,
>   rootDiskGiB?: number | null,
>   vcpus?: number | null
> } | null
> ```

> [accordion] storage full type
>
> ```ts theme={null}
> {
>   mountPath?: string | null,
>   persistent?: boolean | null,
>   sizeGiB?: number | null,
>   snapshotSeq?: number | null,
>   synced?: boolean | null
> } | null
> ```

> [accordion] template full type
>
> ```ts theme={null}
> {
>   digest?: string | null,
>   id?: string | null,
>   kernel?: string | null,
>   version?: string | null
> } | null
> ```

***

## Me

### get

`me.get`

The signed-in user and the sandbox size they get

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.me.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activated` | `boolean \| null` | No | This account passed the invite gate (admins always have). When `inviteRequired` and not `activated`, every route but this one, `POST /v1/invites/redeem` and `POST /v1/auth/logout` answers `403 invite_required`. |
| `admin` | `boolean \| null` | No | The user is an admin and may use the admin-only endpoints (`/v1/admin`). |
| `adminUrl` | `string \| null` | No | Admins only: the origin of the admin console when it has its own (the server's `adminUrl`). Absent, the console is `/admin/` on the dashboard's origin. |
| `allowedSpecs` | `object[] \| null` | No | The sizes your new sandboxes may have in your personal org (no `rootDiskGiB`: the template's). The first is the server's `limits.machineSpec` (4 vCPUs and 8 GiB memory by default), what a create naming no size gets; the others are your plan's (Pro: 2/4, 4/8, 8/16; Builder: 2/4 up to 16/32; Team and Enterprise: 2/4 up to 32/64) and sizes an admin granted you, picked by naming their `vcpus` and `memMiB` on create. Any other size is refused with `spec_not_allowed`, admins included. |
| `alwaysOnAllowed` | `boolean \| null` | No | Whether 0 (off) is a choice too, on `org`'s plan (the personal org's for a sign-in session). A sandbox in another org follows that org's plan: see its `workspaces` entry's `alwaysOnAllowed`. |
| `avatarUrl` | `string \| null` | No | — |
| `billingEnabled` | `boolean \| null` | No | Paid plans can be subscribed: the server has Stripe configured. False: the dashboard offers no plan actions and the billing routes answer 503. |
| `csrfToken` | `string \| null` | No | Browser sessions only. Send it as `X-Instabox-CSRF` on every request that is not GET or HEAD. |
| `directSecretRefs` | `boolean \| null` | No | This site takes direct Secret file references and renamed variables (`directSecrets`) and exec `secretEnvs`. Absent: they are refused with 400 (same-name references work); clients should not send them, since a control host from before them would ignore or misread them. |
| `disabled` | `boolean \| null` | No | An administrator disabled the account. Absent otherwise. |
| `diskResize` | `string \| null` | No | An admin's override of disk growth (`PATCH /v1/machines/{id}` `persistentDiskGiB`, `rootDiskGiB`): `allow` grows free sandboxes' disks too, `deny` none. Absent: paid sandboxes grow, free ones are fixed. |
| `email` | `string \| null` | No | The account's email, which an org invite must be sent to for it to join. |
| `emailInvites` | `boolean \| null` | No | This server emails workspace invites (server.json `email`). Absent: creating or resending an invite answers 503. |
| `exportOnly` | `boolean \| null` | No | This session can only export the account's own data (docs/data-export.md, "Disabled accounts"): `GET /v1/orgs`, `GET` and `POST /v1/orgs/{id}/exports`, `GET /v1/exports/{id}` and its download. Every other route answers `403 account_disabled`. Absent otherwise. |
| `fixedAutoSuspendSeconds` | `number \| null` | No | The idle auto-suspend every sandbox of this account gets on a server that offers no choice; absent when the account chooses (`manualLifecycle`, or `idleChoicesSeconds`). |
| `idleChoicesSeconds` | `number[] \| null` | No | The idle times offered (300 to 1800, 5 to 30 minutes; docs/pricing.md): a request may send any whole minute from the first to the last. 0 (off) is never listed: `alwaysOnAllowed` says whether it is a choice too. Absent with `manualLifecycle`. |
| `inviteRequired` | `boolean \| null` | No | This server gates new accounts behind an invite code (docs/invites.md). |
| `login` | `string \| null` | No | GitHub login at last sign-in (display only). |
| `macQueue` | `boolean \| null` | No | The server's Mac queue is on (`macQueue`): a macOS create or start that sends `queue` waits for a Mac when none is free. Absent: off, and `queue` on such a request is refused. |
| `machineMetrics` | `boolean \| null` | No | Clients show this account per-sandbox metrics (the dashboard's Metrics tab, `instabox metrics`): admins always, every account once the server sets `machineMetricsForAll`. Absent: hidden. `GET /v1/machines/{id}/metrics` answers either way. |
| `manualLifecycle` | `boolean \| null` | No | An admin let this account manage its sandboxes' lifecycle (docs/idle-suspend.md): the `autoSuspendAfterSeconds` it sends applies (0: off). Otherwise every sandbox pauses after `fixedAutoSuspendSeconds` idle, whatever a request says. |
| `movePersonal` | `boolean \| null` | No | This account may move its personal plan into a workspace it owns (`POST /v1/orgs/{id}/billing/move-personal`): admins always, every account once the server sets `movePersonalForAll`. |
| `name` | `string \| null` | No | — |
| `networkPolicy` | `boolean \| null` | No | The server offers outbound network policies to this caller: `networkPolicy` is a field of create, fork and `PATCH /v1/machines/{id}`, and clients show the feature. Absent: the field is unknown to the server (`400 unknown_field`). |
| `oauthPublishing` | `boolean \| null` | No | This account may create and edit OAuth apps (`/v1/orgs/{id}/oauth/apps`): admins always, every account once the server sets `oauth.openPublishing`. Absent: hidden; those routes answer `403`. |
| `org` | `object \| null` | No | The org `allowedSpecs`, `idleChoicesSeconds` and `alwaysOnAllowed` describe: your personal org, or a workspace key's workspace. Absent from older servers. |
| `orgId` | `string \| null` | No | Set for a workspace API key: its workspace. The user is then the workspace's owner, whom the key acts as. |
| `paidActivation` | `boolean \| null` | No | An account the invite gate holds back may buy a workspace (`POST /v1/orgs`) instead, and is activated once its plan takes effect (docs/invites.md). Absent: only an invite code lets it in. |
| `plans` | `object[] \| null` | No | The paid plans an org can go on (Pro, Builder, Team) as this server sells them, for plan pickers. |
| `resizeRestart` | `boolean \| null` | No | This server takes `PATCH /v1/machines/{id}` `apply: "restart"` (one stop, resize, start operation). Absent: it answers `400 resize_restart_off`; resize with your own stop, `PATCH`, start. |
| `termsVersion` | `string \| null` | No | The version of the rules of the road (the Terms of Service's acceptable use) this account last agreed to (`PUT /v1/me/terms`). Absent: none. |
| `userId` | `number \| null` | No | Instabox user ID. |
| `waitlist` | `object \| null` | No | The account's place in the line invite codes go out from and its referral link (docs/invites.md, "Referrals"). Absent: not in line (activated, the gate off, or a live code claimed for its email). |
| `webhooksEnabled` | `boolean \| null` | No | This server offers org webhooks (docs/webhooks.md). False: the dashboard hides them, the CLI says they are off and the webhook routes answer 404. |
| `workspaces` | `object[] \| null` | No | Your other orgs, each with its own plan and limits (`GET /v1/usage?org=ID`, `GET /v1/orgs/{id}`). Omitted when there are none, and for a workspace API key, which reaches only its own org. |

> [accordion] allowedSpecs full type
>
> ```ts theme={null}
> {
>   gpuType?: string | null,
>   gpus?: number | null,
>   memMiB?: number | null,
>   persistentDiskGiB?: number | null,
>   rootDiskGiB?: number | null,
>   vcpus?: number | null
> }[] | null
> ```

> [accordion] org full type
>
> ```ts theme={null}
> {
>   alwaysOnAllowed?: boolean | null,
>   id?: string | null,
>   kind?: string | null,
>   name?: string | null,
>   tier?: string | null
> } | null
> ```

> [accordion] plans full type
>
> ```ts theme={null}
> {
>   maxDiskGiB?: number | null,
>   maxMachines?: number | null,
>   maxRunning?: number | null,
>   maxVCPUs?: number | null,
>   monthlyFeeUSD?: number | null,
>   tier?: string | null
> }[] | null
> ```

> [accordion] waitlist full type
>
> ```ts theme={null}
> {
>   position?: number | null,
>   referralUrl?: string | null
> } | null
> ```

> [accordion] workspaces full type
>
> ```ts theme={null}
> {
>   alwaysOnAllowed?: boolean | null,
>   id?: string | null,
>   kind?: string | null,
>   name?: string | null,
>   tier?: string | null
> }[] | null
> ```

***

## Operations

### get

`operations.get`

Get an operation (the progress of a sandbox change)

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.operations.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Operation ID (`op_…`). |
| `wait` | `string` | No | Long-poll for up to this long: a duration such as `25s` or `500ms`, or whole seconds (`25`). Capped at 30s; absent or `0` answers at once. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `error` | `object \| null` | No | — |
| `forkInherited` | `boolean \| null` | No | 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}`. |
| `id` | `string \| null` | No | — |
| `machine` | `object \| null` | No | 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. |
| `machineId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | Free text progress, e.g. scheduling, booting, waiting\_ready, snapshotting. |
| `scheduledAt` | `string \| null` | No | The stop or delete of a macOS sandbox inside its Mac lease's minimum is not done now but at this time (the sandbox's `archiveAt` or `deleteAt`); the operation is `succeeded`. |
| `state` | `string \| null` | No | `succeeded` and `failed` are terminal. |
| `trigger` | `string \| null` | No | 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. |
| `twin` | `object \| null` | No | On the answer to a half-size macOS create that opened a Mac: the second sandbox the create made on it (a Mac runs two sandboxes of half its size). |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] error full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   code?: string | null,
>   docs?: string | null,
>   docs_url?: string | null,
>   hint?: string | null,
>   message?: string | null,
>   operationId?: string | null | null,
>   reason?: string | null,
>   requestId?: string | null,
>   requiredScopes?: string[] | null,
>   retryAfterSeconds?: number | null,
>   retryable?: boolean | null
> } | null | null
> ```

> [accordion] machine full type
>
> ```ts theme={null}
> {
>   abuseLock?: {
>     appeal?: string | null,
>     at?: string | null,
>     coreShare?: number | null,
>     count?: number | null,
>     dst?: string | null,
>     explanation?: string | null,
>     kind?: string | null,
>     pool?: string | null,
>     port?: number | null,
>     process?: string | null,
>     what?: string | null
>   } | null,
>   archiveAt?: string | null | null,
>   autoSuspendAfterSeconds?: number | null | null,
>   autoSuspendedAt?: string | null,
>   cooldownReason?: string | null,
>   cooldownUntil?: string | null | null,
>   createdAt?: string | null,
>   createdByApp?: {
>     id?: string | null,
>     logo?: string | null,
>     name?: string | null,
>     publisher?: string | null,
>     verified?: boolean | null
>   } | null,
>   deleteAt?: string | null | null,
>   desiredState?: string | null,
>   earlyAllowanceEnded?: boolean | null,
>   envNames?: string[] | null,
>   free?: boolean | null,
>   guestUser?: string | null,
>   id?: string | null,
>   image?: {
>     id?: string | null
>   } | null,
>   lastError?: {
>     at?: string | null,
>     code?: string | null,
>     docs?: string | null,
>     docs_url?: string | null,
>     hint?: string | null,
>     message?: string | null,
>     operationId?: string | null | null,
>     reason?: string | null,
>     requestId?: string | null,
>     requiredScopes?: string[] | null,
>     retryAfterSeconds?: number | null,
>     retryable?: boolean | null
>   } | null,
>   lastOom?: {
>     anonRssBytes?: number | null,
>     at?: string | null,
>     cgroup?: boolean | null,
>     pid?: number | null,
>     process?: string | null,
>     rssBytes?: number | null,
>     uid?: number | null
>   } | null,
>   lease?: {
>     chargeUntil?: string | null,
>     hourUSD?: number | null,
>     id?: number | null,
>     startedAt?: string | null
>   } | null,
>   maxRunMinutes?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null,
>   networkPolicy?: {
>     allowCidrs?: string[] | null,
>     allowDomains?: string[] | null,
>     outbound?: string | null
>   } | null,
>   oomKills?: number | null,
>   operationId?: string | null | null,
>   orgId?: string | null,
>   queue?: {
>     autoLease?: boolean | null,
>     cancelling?: boolean | null,
>     enqueuedAt?: string | null,
>     expiresAt?: string | null,
>     gpuType?: string | null,
>     gpus?: number | null,
>     id?: string | null,
>     kind?: string | null,
>     offerExpiresAt?: string | null,
>     pool?: string | null,
>     position?: number | null,
>     state?: string | null
>   } | null,
>   readyAt?: string | null,
>   revision?: number | null,
>   runStartedAt?: string | null | null,
>   runtime?: {
>     hostLastSeenAt?: string | null,
>     hostUnreachable?: boolean | null,
>     processesPreserved?: boolean | null,
>     ready?: boolean | null
>   } | null,
>   snapshot?: {
>     id?: string | null
>   } | null,
>   spec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   state?: string | null,
>   storage?: {
>     mountPath?: string | null,
>     persistent?: boolean | null,
>     sizeGiB?: number | null,
>     snapshotSeq?: number | null,
>     synced?: boolean | null
>   } | null,
>   suspendable?: boolean | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   updatedAt?: string | null,
>   vault?: boolean | null
> } | null
> ```

> [accordion] twin full type
>
> ```ts theme={null}
> {
>   machineId?: string | null,
>   name?: string | null,
>   operationId?: string | null
> } | null
> ```

***

## Orgs

### exports.create

`orgs.exports.create`

Export a sandbox's or a snapshot's /data

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.orgs.exports.create({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be a member. |
| `machineId` | `string` | No | — |
| `snapshotId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `bytes` | `number \| null` | No | The archive's size, once ready. |
| `createdAt` | `string \| null` | No | — |
| `error` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | When a ready archive is deleted, 7 days after it was built and never after the workspace's data. |
| `fileName` | `string \| null` | No | The archive's download name: `<name>-data-<date>.tar.gz`. |
| `id` | `string \| null` | No | `exp_...` |
| `machineId` | `string \| null` | No | — |
| `name` | `string \| null` | No | The sandbox's or snapshot's name when the export was asked for. |
| `orgId` | `string \| null` | No | — |
| `readyAt` | `string \| null` | No | — |
| `requestedBy` | `number \| null` | No | — |
| `savedAt` | `string \| null` | No | When the disk was saved: the sandbox's last stop or pause, or the snapshot. |
| `sha256` | `string \| null` | No | The archive's SHA-256 (hex), once ready; also its download ETag. |
| `snapshotId` | `string \| null` | No | — |
| `status` | `string \| null` | No | `ready`: download it. `failed`: `error` says why; ask again. `expired`: deleted; ask again while the workspace is paused or disabled. |

***

### exports.list

`orgs.exports.list`

List what you can export from a workspace

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.exports.list({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be a member. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `exportable` | `boolean \| null` | No | True while the workspace is paused for a failed payment or disabled: exports can be asked for. |
| `purgeAt` | `string \| null` | No | When the workspace's sandboxes and snapshots are deleted. |
| `sources` | `object[] \| null` | No | The sandboxes and snapshots the caller may export, each with its newest export that has not expired. |

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   dataSizeBytes?: number | null,
>   export?: {
>     bytes?: number | null,
>     createdAt?: string | null,
>     error?: string | null,
>     expiresAt?: string | null,
>     fileName?: string | null,
>     id?: string | null,
>     machineId?: string | null,
>     name?: string | null,
>     orgId?: string | null,
>     readyAt?: string | null,
>     requestedBy?: number | null,
>     savedAt?: string | null,
>     sha256?: string | null,
>     snapshotId?: string | null,
>     status?: string | null
>   } | null,
>   exportable?: boolean | null,
>   id?: string | null,
>   kind?: string | null,
>   name?: string | null
> }[] | null
> ```

***

### get

`orgs.get`

An org you belong to, with its limits and this month's usage

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.get({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowedSpecs` | `object[] \| null` | No | The sizes that may be created in the org, the default first (its plan's, then any an admin granted the org). |
| `billing` | `object \| null` | No | The org's Stripe subscription (docs/pricing.md); absent when it never had one. |
| `cardMissingAt` | `string \| null` | No | Set while a workspace has no card on file. On the free tier its sandboxes then answer `402 payment_method_required` and running ones are paused (`trigger: payment_method`); they run again once one is added (`POST /v1/orgs/{id}/billing/checkout` with no tier, or the portal). |
| `createdAt` | `string \| null` | No | — |
| `disabledAt` | `string \| null` | No | Set while the workspace cannot be used: its plan ended (cancelled, unpaid, or its credits ran out). Its sandboxes answer `402 subscription_required`; they and its snapshots are deleted 30 days later unless it subscribes again. |
| `id` | `string \| null` | No | — |
| `kind` | `string \| null` | No | `personal`: the account's own org, made when it signed up, on any tier but with no other members: it takes no invites. `workspace`: an org to share, on any tier; on the free tier it needs a card on file and has up to `limits.maxMembers` members. |
| `limits` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `personal` | `boolean \| null` | No | `kind` is `personal`. |
| `purgeAt` | `string \| null` | No | Set on a disabled workspace: when its sandboxes and snapshots are deleted. Until then its people can download their `/data` (`POST /v1/orgs/{id}/exports`). |
| `role` | `string \| null` | No | Your role in the org. |
| `tier` | `string \| null` | No | — |
| `usage` | `object \| null` | No | The org's usage this calendar month (UTC) as the hourly rating job priced it: running time by sandbox size, the allocated disk (`/data`) of the paid sandboxes beyond the plan's included disk, and egress beyond the plan's free egress a month, up to `ratedUntil`. Snapshots and the system disk are not billed. |

> [accordion] allowedSpecs full type
>
> ```ts theme={null}
> {
>   gpuType?: string | null,
>   gpus?: number | null,
>   memMiB?: number | null,
>   persistentDiskGiB?: number | null,
>   rootDiskGiB?: number | null,
>   vcpus?: number | null
> }[] | null
> ```

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   cancelAtPeriodEnd?: boolean | null,
>   funding?: string | null,
>   graceUntil?: string | null,
>   pastDueSince?: string | null,
>   periodEnd?: string | null,
>   periodStart?: string | null,
>   scheduledTier?: string | null,
>   status?: string | null,
>   subscribed?: boolean | null,
>   tier?: string | null,
>   unpaidInvoiceIds?: string[] | null
> } | null
> ```

> [accordion] limits full type
>
> ```ts theme={null}
> {
>   alwaysOn?: boolean | null,
>   earlyAllowanceEnded?: boolean | null,
>   extraStarts?: string | null,
>   freeSandboxHours?: number | null,
>   freeSandboxes?: number | null,
>   maxDiskGiB?: number | null,
>   maxMachines?: number | null,
>   maxMembers?: number | null,
>   maxRunning?: number | null,
>   maxSnapshots?: number | null,
>   maxStoredGiB?: number | null,
>   maxVCPUs?: number | null,
>   monthlyCreditUSD?: number | null,
>   overageAlert?: boolean | null,
>   spendCapUSD?: number | null | null,
>   startsPerMinute?: number | null,
>   thresholdBillingUSD?: number | null,
>   usageAlertPercent?: number | null
> } | null
> ```

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   allocatedDiskGiB?: number | null,
>   allowanceUSD?: number | null,
>   billableDiskGiB?: number | null,
>   chargedUSD?: number | null,
>   costUSD?: number | null,
>   creditRemainingUSD?: number | null,
>   creditsExpireAt?: string | null,
>   creditsUSD?: number | null,
>   creditsUsedUSD?: number | null,
>   egressGiB?: number | null,
>   egressUSD?: number | null,
>   extraStarts?: number | null,
>   extraStartsUSD?: number | null,
>   freeDiskGiBPerSandbox?: number | null,
>   freeMachines?: number | null,
>   freeSandboxHours?: number | null,
>   gpu?: {
>     gpuHours?: number | null,
>     hourUSD?: number | null,
>     model?: string | null,
>     type?: string | null,
>     usd?: number | null
>   }[] | null,
>   gpuUSD?: number | null,
>   includedDiskGiB?: number | null,
>   machines?: number | null,
>   macos?: {
>     hourUSD?: number | null,
>     macHours?: number | null,
>     pool?: string | null,
>     usd?: number | null
>   }[] | null,
>   macosUSD?: number | null,
>   memGiBHours?: number | null,
>   memUSD?: number | null,
>   overageUSD?: number | null,
>   periodEnd?: string | null,
>   periodStart?: string | null,
>   ratedUntil?: string | null,
>   remainingUSD?: number | null,
>   running?: number | null,
>   runtimeUSD?: number | null,
>   snapshots?: number | null,
>   starts?: {
>     days?: {
>       date?: string | null,
>       extraStarts?: number | null,
>       extraStartsUSD?: number | null
>     }[] | null,
>     extraDay?: number | null,
>     extraDayUSD?: number | null,
>     extraMonth?: number | null,
>     extraMonthUSD?: number | null,
>     extraStartUSD?: number | null,
>     extraStarts?: string | null,
>     nextStartUSD?: number | null | null,
>     startsMonth?: number | null,
>     windows?: {
>       charge?: boolean | null,
>       freesAt?: string | null,
>       included?: number | null,
>       max?: number | null,
>       used?: number | null,
>       window?: string | null
>     }[] | null
>   } | null,
>   storageComputedAt?: string | null | null,
>   storageGiBHours?: number | null,
>   storageUSD?: number | null,
>   storedBytes?: number | null | null,
>   usageCreditsUSD?: number | null,
>   vcpuHours?: number | null,
>   vcpuUSD?: number | null
> } | null
> ```

***

### github.jobs.get

`orgs.github.jobs.get`

One of the org's GitHub Actions jobs, with where its wait went and its branch, commit and failed step

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.github.jobs.get({ id: 'org_4t7m1z', job: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `job` | `number` | Yes | GitHub's job ID. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `boxCreatedAt` | `string \| null` | No | When its own CI box was created. Absent: no box yet, or GitHub ran the job on another job's box. |
| `boxRunningAt` | `string \| null` | No | When that box first ran. |
| `branch` | `string \| null` | No | Its run's branch, from GitHub. |
| `commit` | `string \| null` | No | Its run's commit SHA, from GitHub. |
| `failedStep` | `string \| null` | No | The first step that failed, from GitHub. |
| `job` | `object \| null` | No | — |
| `memMiB` | `number \| null` | No | — |
| `vcpus` | `number \| null` | No | The machine of its size. |

> [accordion] job full type
>
> ```ts theme={null}
> {
>   actor?: string | null,
>   branch?: string | null,
>   commit?: string | null,
>   completedAt?: string | null,
>   completionSource?: string | null,
>   conclusion?: string | null,
>   createdAt?: string | null,
>   id?: number | null,
>   job?: string | null,
>   labels?: string[] | null,
>   machineId?: string | null,
>   ranOn?: string | null,
>   readyAt?: string | null,
>   reason?: string | null,
>   repo?: string | null,
>   size?: string | null,
>   snapshot?: string | null,
>   startedAt?: string | null,
>   state?: string | null,
>   workflow?: string | null
> } | null
> ```

***

### github.jobs.list

`orgs.github.jobs.list`

The org's GitHub Actions jobs run in CI boxes, with why a job waits or did not start

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.github.jobs.list({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `state` | `all \| running \| waiting \| succeeded \| failed` | No | The jobs of one state group: `running` (`starting` or `started`), `waiting`, `succeeded` (`completed` with conclusion `success`) or `failed` (`completed` with conclusion `failure` or `timed_out`, `refused` or `failed`; `cancelled` and `skipped` are not failures). |
| `limit` | `number` | No | Page size. |
| `from` | `string` | No | Only the jobs queued at or after this time (RFC 3339); `counts` follow it. |
| `to` | `string` | No | Only the jobs queued before this time (RFC 3339), after `from`; `counts` follow it. |
| `offset` | `number` | No | Jobs of the group to skip. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `counts` | `object \| null` | No | The org's jobs in each state group that `state` takes. |
| `hasMore` | `boolean \| null` | No | More jobs of the state group asked for follow this page (next: offset + limit). |
| `installUrl` | `string \| null` | No | Where an owner or admin installs the App and links it to the org, in a browser signed in to instabox. |
| `jobs` | `object[] \| null` | No | — |
| `linked` | `boolean \| null` | No | An install of the GitHub App is linked to the org. |
| `setup` | `object \| null` | No | What the CI page's setup steps count: only the jobs of the installs linked to the org now. An App uninstalled and installed again is a new install, so the setup starts over while the old jobs stay listed and in `counts`. |
| `unlinked` | `object[] \| null` | No | Installs unlinked from the org when the member who linked them left it; their jobs start nothing until an owner or admin links them again. |

> [accordion] counts full type
>
> ```ts theme={null}
> {
>   all?: number | null,
>   failed?: number | null,
>   running?: number | null,
>   succeeded?: number | null,
>   waiting?: number | null
> } | null
> ```

> [accordion] jobs full type
>
> ```ts theme={null}
> {
>   actor?: string | null,
>   branch?: string | null,
>   commit?: string | null,
>   completedAt?: string | null,
>   completionSource?: string | null,
>   conclusion?: string | null,
>   createdAt?: string | null,
>   id?: number | null,
>   job?: string | null,
>   labels?: string[] | null,
>   machineId?: string | null,
>   ranOn?: string | null,
>   readyAt?: string | null,
>   reason?: string | null,
>   repo?: string | null,
>   size?: string | null,
>   snapshot?: string | null,
>   startedAt?: string | null,
>   state?: string | null,
>   workflow?: string | null
> }[] | null
> ```

> [accordion] setup full type
>
> ```ts theme={null}
> {
>   queued?: boolean | null,
>   ran?: boolean | null,
>   running?: number | null,
>   waiting?: number | null
> } | null
> ```

> [accordion] unlinked full type
>
> ```ts theme={null}
> {
>   account?: string | null,
>   id?: number | null,
>   reason?: string | null,
>   unlinkedAt?: string | null
> }[] | null
> ```

***

### github.stats

`orgs.github.stats`

The org's GitHub Actions jobs of the last 7 days, today included, or of a time range, for the CI page

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.github.stats({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `tz` | `string` | No | The IANA time zone days are counted in, such as America/Los\_Angeles. |
| `from` | `string` | No | Only jobs queued at or after this time (RFC 3339); needs step. |
| `to` | `string` | No | Only jobs queued before this time (RFC 3339); after from, and needs step. |
| `step` | `number` | No | Count the jobs in buckets of this many seconds from from (needed) to to or now, at most 1000 buckets; perDay is then empty. A day (86400) counts the days of tz from from's midnight, each a day also when the clocks change. Needed with from or to: without it the days are the last 7. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `buckets` | `object[] \| null` | No | With step: every step from from, oldest first. |
| `bySize` | `object[] \| null` | No | Each size with jobs, small to large. |
| `days` | `number \| null` | No | How many days, today included. |
| `jobs` | `number \| null` | No | Jobs queued. |
| `passed` | `number \| null` | No | Of those, jobs with conclusion `success`. |
| `perDay` | `object[] \| null` | No | Every day, oldest first. |
| `ran` | `number \| null` | No | Jobs that ran to their end on a CI box, whatever their conclusion. |
| `run` | `object \| null` | No | Seconds from a runner taking the job to its end. Absent when no job ended. |
| `step` | `number \| null` | No | The step asked for, in seconds. |
| `wait` | `object \| null` | No | Seconds from queued to a runner taking the job. Absent when no job was taken. |

> [accordion] buckets full type
>
> ```ts theme={null}
> {
>   failed?: number | null,
>   other?: number | null,
>   passed?: number | null,
>   start?: string | null
> }[] | null
> ```

> [accordion] bySize full type
>
> ```ts theme={null}
> {
>   jobs?: number | null,
>   p50?: number | null,
>   p90?: number | null,
>   size?: string | null
> }[] | null
> ```

> [accordion] perDay full type
>
> ```ts theme={null}
> {
>   date?: string | null,
>   failed?: number | null,
>   other?: number | null,
>   passed?: number | null
> }[] | null
> ```

> [accordion] run full type
>
> ```ts theme={null}
> {
>   p50?: number | null,
>   p90?: number | null
> } | null
> ```

> [accordion] wait full type
>
> ```ts theme={null}
> {
>   boot?: number | null,
>   handover?: number | null,
>   p50?: number | null,
>   p90?: number | null,
>   pickup?: {
>     p50?: number | null,
>     p90?: number | null
>   } | null,
>   ready?: {
>     p50?: number | null,
>     p90?: number | null
>   } | null,
>   slot?: number | null
> } | null
> ```

***

### inviteCode.get

`orgs.inviteCode.get`

A paid org's invite code for people outside it. The owner and admins

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.inviteCode.get({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string \| null` | No | The code to hand out. |
| `createdAt` | `string \| null` | No | — |
| `maxUses` | `number \| null` | No | How many people the workspace's codes let in together. |
| `redeemers` | `object[] \| null` | No | Who joined with any of the workspace's codes and when, oldest first. |
| `state` | `string \| null` | No | `used`: nobody else can join with it. |
| `useCount` | `number \| null` | No | How many people joined with any of the workspace's codes. |

> [accordion] redeemers full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   login?: string | null,
>   redeemedAt?: string | null
> }[] | null
> ```

***

### inviteCode.regenerate

`orgs.inviteCode.regenerate`

Replace a paid workspace's invite code. The owner and admins

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.inviteCode.regenerate({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string \| null` | No | The code to hand out. |
| `createdAt` | `string \| null` | No | — |
| `maxUses` | `number \| null` | No | How many people the workspace's codes let in together. |
| `redeemers` | `object[] \| null` | No | Who joined with any of the workspace's codes and when, oldest first. |
| `state` | `string \| null` | No | `used`: nobody else can join with it. |
| `useCount` | `number \| null` | No | How many people joined with any of the workspace's codes. |

> [accordion] redeemers full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   login?: string | null,
>   redeemedAt?: string | null
> }[] | null
> ```

***

### invites.create

`orgs.invites.create`

Email an invite to join the org. The owner and admins

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.invites.create({ id: 'org_4t7m1z', email: 'ops@example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `email` | `string` | Yes | Whom to invite; only an account with this email can join with it. |
| `role` | `admin \| member` | No | The role the invitee joins with (default member). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `number \| null` | No | — |
| `email` | `string \| null` | No | Where the invite was emailed, lowercased. Absent: a code with no recipient. |
| `expiresAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `orgId` | `string \| null` | No | — |
| `redeemedAt` | `string \| null` | No | — |
| `redeemedBy` | `number \| null` | No | — |
| `revokedAt` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |

***

### invites.list

`orgs.invites.list`

An org's invites, newest first. The owner and admins

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.invites.list({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invites` | `object[] \| null` | No | — |

> [accordion] invites full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   createdBy?: number | null,
>   email?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   orgId?: string | null,
>   redeemedAt?: string | null,
>   redeemedBy?: number | null,
>   revokedAt?: string | null,
>   role?: string | null
> }[] | null
> ```

***

### invites.resend

`orgs.invites.resend`

Email an open invite again. The owner and admins

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.invites.resend({ id: 'org_4t7m1z', inviteId: 'oi_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `inviteId` | `string` | Yes | Invite ID (oi\_...). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `number \| null` | No | — |
| `email` | `string \| null` | No | Where the invite was emailed, lowercased. Absent: a code with no recipient. |
| `expiresAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `orgId` | `string \| null` | No | — |
| `redeemedAt` | `string \| null` | No | — |
| `redeemedBy` | `number \| null` | No | — |
| `revokedAt` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |

***

### invites.revoke

`orgs.invites.revoke`

Revoke an unredeemed invite. The owner and admins

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.invites.revoke({ id: 'org_4t7m1z', inviteId: 'oi_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `inviteId` | `string` | Yes | Invite ID (oi\_...). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `number \| null` | No | — |
| `email` | `string \| null` | No | Where the invite was emailed, lowercased. Absent: a code with no recipient. |
| `expiresAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `orgId` | `string \| null` | No | — |
| `redeemedAt` | `string \| null` | No | — |
| `redeemedBy` | `number \| null` | No | — |
| `revokedAt` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |

***

### list

`orgs.list`

The orgs you belong to, your personal org first

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `orgs` | `object[] \| null` | No | — |

> [accordion] orgs full type
>
> ```ts theme={null}
> {
>   allowedSpecs?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   }[] | null,
>   billing?: {
>     cancelAtPeriodEnd?: boolean | null,
>     funding?: string | null,
>     graceUntil?: string | null,
>     pastDueSince?: string | null,
>     periodEnd?: string | null,
>     periodStart?: string | null,
>     scheduledTier?: string | null,
>     status?: string | null,
>     subscribed?: boolean | null,
>     tier?: string | null,
>     unpaidInvoiceIds?: string[] | null
>   } | null,
>   cardMissingAt?: string | null,
>   createdAt?: string | null,
>   disabledAt?: string | null,
>   id?: string | null,
>   kind?: string | null,
>   limits?: {
>     alwaysOn?: boolean | null,
>     earlyAllowanceEnded?: boolean | null,
>     extraStarts?: string | null,
>     freeSandboxHours?: number | null,
>     freeSandboxes?: number | null,
>     maxDiskGiB?: number | null,
>     maxMachines?: number | null,
>     maxMembers?: number | null,
>     maxRunning?: number | null,
>     maxSnapshots?: number | null,
>     maxStoredGiB?: number | null,
>     maxVCPUs?: number | null,
>     monthlyCreditUSD?: number | null,
>     overageAlert?: boolean | null,
>     spendCapUSD?: number | null | null,
>     startsPerMinute?: number | null,
>     thresholdBillingUSD?: number | null,
>     usageAlertPercent?: number | null
>   } | null,
>   name?: string | null,
>   personal?: boolean | null,
>   purgeAt?: string | null,
>   role?: string | null,
>   tier?: string | null,
>   usage?: {
>     allocatedDiskGiB?: number | null,
>     allowanceUSD?: number | null,
>     billableDiskGiB?: number | null,
>     chargedUSD?: number | null,
>     costUSD?: number | null,
>     creditRemainingUSD?: number | null,
>     creditsExpireAt?: string | null,
>     creditsUSD?: number | null,
>     creditsUsedUSD?: number | null,
>     egressGiB?: number | null,
>     egressUSD?: number | null,
>     extraStarts?: number | null,
>     extraStartsUSD?: number | null,
>     freeDiskGiBPerSandbox?: number | null,
>     freeMachines?: number | null,
>     freeSandboxHours?: number | null,
>     gpu?: {
>       gpuHours?: number | null,
>       hourUSD?: number | null,
>       model?: string | null,
>       type?: string | null,
>       usd?: number | null
>     }[] | null,
>     gpuUSD?: number | null,
>     includedDiskGiB?: number | null,
>     machines?: number | null,
>     macos?: {
>       hourUSD?: number | null,
>       macHours?: number | null,
>       pool?: string | null,
>       usd?: number | null
>     }[] | null,
>     macosUSD?: number | null,
>     memGiBHours?: number | null,
>     memUSD?: number | null,
>     overageUSD?: number | null,
>     periodEnd?: string | null,
>     periodStart?: string | null,
>     ratedUntil?: string | null,
>     remainingUSD?: number | null,
>     running?: number | null,
>     runtimeUSD?: number | null,
>     snapshots?: number | null,
>     starts?: {
>       days?: {
>         date?: string | null,
>         extraStarts?: number | null,
>         extraStartsUSD?: number | null
>       }[] | null,
>       extraDay?: number | null,
>       extraDayUSD?: number | null,
>       extraMonth?: number | null,
>       extraMonthUSD?: number | null,
>       extraStartUSD?: number | null,
>       extraStarts?: string | null,
>       nextStartUSD?: number | null | null,
>       startsMonth?: number | null,
>       windows?: {
>         charge?: boolean | null,
>         freesAt?: string | null,
>         included?: number | null,
>         max?: number | null,
>         used?: number | null,
>         window?: string | null
>       }[] | null
>     } | null,
>     storageComputedAt?: string | null | null,
>     storageGiBHours?: number | null,
>     storageUSD?: number | null,
>     storedBytes?: number | null | null,
>     usageCreditsUSD?: number | null,
>     vcpuHours?: number | null,
>     vcpuUSD?: number | null
>   } | null
> }[] | null
> ```

***

### members.changeRole

`orgs.members.changeRole`

Change a member's role. The owner and admins

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.orgs.members.changeRole({ id: 'org_4t7m1z', userId: 1, role: 'member' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `userId` | `number` | Yes | The member's user ID. |
| `role` | `admin \| member` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### members.list

`orgs.members.list`

The members of an org you belong to, the owner first

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.members.list({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `members` | `object[] \| null` | No | — |

> [accordion] members full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   email?: string | null,
>   login?: string | null,
>   role?: string | null,
>   userId?: number | null
> }[] | null
> ```

***

### members.remove

`orgs.members.remove`

Remove a member, or leave (your own user ID)

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.members.remove({ id: 'org_4t7m1z', userId: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `userId` | `number` | Yes | The member's user ID. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### secrets.delete

`orgs.secrets.delete`

Delete an org Secret and its explicit sandbox grants

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.secrets.delete({ id: 'org_4t7m1z', name: 'OPENAI_API_KEY' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. |
| `name` | `string` | Yes | 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. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### secrets.import

`orgs.secrets.import`

Atomically create or replace a batch of org Secrets

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.orgs.secrets.import({
	id: 'org_4t7m1z',
	values: {},
	delivery: 'proxy',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. |
| `delivery` | `proxy \| env` | Yes | Proxy supplies an opaque sandbox-specific placeholder for substitution in ordinary HTTPS headers on allowed hosts (port 443). Env supplies the real value, including credentials needed by native database clients. Unsupported traffic never falls back from proxy to env. |
| `hosts` | `string[]` | No | Exact ASCII DNS hostnames, normalized to lowercase without a trailing dot, or a standalone `*` for every public HTTPS destination. Required for proxy delivery: omitted or empty is 400. No scheme, port, path, partial wildcard, IP literal, or local hostname. Destination checks also reject private and restricted resolved addresses. This scopes credential use, not all sandbox network access. |
| `values` | `Record<string, string>` | Yes | Names and values to replace atomically; omitted names stay unchanged. Null values are rejected. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   delivery?: string | null,
>   hosts?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   orgId?: string | null,
>   size?: number | null,
>   updatedAt?: string | null,
>   version?: number | null
> }[] | null
> ```

***

### secrets.list

`orgs.secrets.list`

List an org's Secret metadata, never values

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.secrets.list({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be a member. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   delivery?: string | null,
>   hosts?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   orgId?: string | null,
>   size?: number | null,
>   updatedAt?: string | null,
>   version?: number | null
> }[] | null
> ```

***

### secrets.set

`orgs.secrets.set`

Create or replace an org Secret

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.orgs.secrets.set({
	id: 'org_4t7m1z',
	name: 'OPENAI_API_KEY',
	value: 'example',
	delivery: 'proxy',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. |
| `name` | `string` | Yes | 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. |
| `delivery` | `proxy \| env` | Yes | Proxy supplies an opaque sandbox-specific placeholder for substitution in ordinary HTTPS headers on allowed hosts (port 443). Env supplies the real value, including credentials needed by native database clients. Unsupported traffic never falls back from proxy to env. |
| `hosts` | `string[]` | No | Exact ASCII DNS hostnames, normalized to lowercase without a trailing dot, or a standalone `*` for every public HTTPS destination. Required for proxy delivery: omitted or empty is 400. No scheme, port, path, partial wildcard, IP literal, or local hostname. Destination checks also reject private and restricted resolved addresses. This scopes credential use, not all sandbox network access. |
| `value` | `string` | Yes | UTF-8 text without NUL, at most 65536 bytes. Empty values are valid. Proxy values must also be valid HTTP header values without CR or LF. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `delivery` | `string \| null` | No | Proxy supplies an opaque sandbox-specific placeholder for substitution in ordinary HTTPS headers on allowed hosts (port 443). Env supplies the real value, including credentials needed by native database clients. Unsupported traffic never falls back from proxy to env. |
| `hosts` | `string[] \| null` | No | Exact ASCII DNS hostnames, normalized to lowercase without a trailing dot, or a standalone `*` for every public HTTPS destination. Required for proxy delivery: omitted or empty is 400. No scheme, port, path, partial wildcard, IP literal, or local hostname. Destination checks also reject private and restricted resolved addresses. This scopes credential use, not all sandbox network access. |
| `id` | `string \| null` | No | Stable identity retained by replacements; deletion and recreation makes a new ID. |
| `name` | `string \| null` | No | 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. |
| `orgId` | `string \| null` | No | — |
| `size` | `number \| null` | No | Raw value size in bytes. |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |

***

### update

`orgs.update`

Rename an org. The owner and admins

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.orgs.update({ id: 'org_4t7m1z', name: 'acme-agents' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Org ID (org\_...). |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowedSpecs` | `object[] \| null` | No | The sizes that may be created in the org, the default first (its plan's, then any an admin granted the org). |
| `billing` | `object \| null` | No | The org's Stripe subscription (docs/pricing.md); absent when it never had one. |
| `cardMissingAt` | `string \| null` | No | Set while a workspace has no card on file. On the free tier its sandboxes then answer `402 payment_method_required` and running ones are paused (`trigger: payment_method`); they run again once one is added (`POST /v1/orgs/{id}/billing/checkout` with no tier, or the portal). |
| `createdAt` | `string \| null` | No | — |
| `disabledAt` | `string \| null` | No | Set while the workspace cannot be used: its plan ended (cancelled, unpaid, or its credits ran out). Its sandboxes answer `402 subscription_required`; they and its snapshots are deleted 30 days later unless it subscribes again. |
| `id` | `string \| null` | No | — |
| `kind` | `string \| null` | No | `personal`: the account's own org, made when it signed up, on any tier but with no other members: it takes no invites. `workspace`: an org to share, on any tier; on the free tier it needs a card on file and has up to `limits.maxMembers` members. |
| `limits` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `personal` | `boolean \| null` | No | `kind` is `personal`. |
| `purgeAt` | `string \| null` | No | Set on a disabled workspace: when its sandboxes and snapshots are deleted. Until then its people can download their `/data` (`POST /v1/orgs/{id}/exports`). |
| `role` | `string \| null` | No | Your role in the org. |
| `tier` | `string \| null` | No | — |
| `usage` | `object \| null` | No | The org's usage this calendar month (UTC) as the hourly rating job priced it: running time by sandbox size, the allocated disk (`/data`) of the paid sandboxes beyond the plan's included disk, and egress beyond the plan's free egress a month, up to `ratedUntil`. Snapshots and the system disk are not billed. |

> [accordion] allowedSpecs full type
>
> ```ts theme={null}
> {
>   gpuType?: string | null,
>   gpus?: number | null,
>   memMiB?: number | null,
>   persistentDiskGiB?: number | null,
>   rootDiskGiB?: number | null,
>   vcpus?: number | null
> }[] | null
> ```

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   cancelAtPeriodEnd?: boolean | null,
>   funding?: string | null,
>   graceUntil?: string | null,
>   pastDueSince?: string | null,
>   periodEnd?: string | null,
>   periodStart?: string | null,
>   scheduledTier?: string | null,
>   status?: string | null,
>   subscribed?: boolean | null,
>   tier?: string | null,
>   unpaidInvoiceIds?: string[] | null
> } | null
> ```

> [accordion] limits full type
>
> ```ts theme={null}
> {
>   alwaysOn?: boolean | null,
>   earlyAllowanceEnded?: boolean | null,
>   extraStarts?: string | null,
>   freeSandboxHours?: number | null,
>   freeSandboxes?: number | null,
>   maxDiskGiB?: number | null,
>   maxMachines?: number | null,
>   maxMembers?: number | null,
>   maxRunning?: number | null,
>   maxSnapshots?: number | null,
>   maxStoredGiB?: number | null,
>   maxVCPUs?: number | null,
>   monthlyCreditUSD?: number | null,
>   overageAlert?: boolean | null,
>   spendCapUSD?: number | null | null,
>   startsPerMinute?: number | null,
>   thresholdBillingUSD?: number | null,
>   usageAlertPercent?: number | null
> } | null
> ```

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   allocatedDiskGiB?: number | null,
>   allowanceUSD?: number | null,
>   billableDiskGiB?: number | null,
>   chargedUSD?: number | null,
>   costUSD?: number | null,
>   creditRemainingUSD?: number | null,
>   creditsExpireAt?: string | null,
>   creditsUSD?: number | null,
>   creditsUsedUSD?: number | null,
>   egressGiB?: number | null,
>   egressUSD?: number | null,
>   extraStarts?: number | null,
>   extraStartsUSD?: number | null,
>   freeDiskGiBPerSandbox?: number | null,
>   freeMachines?: number | null,
>   freeSandboxHours?: number | null,
>   gpu?: {
>     gpuHours?: number | null,
>     hourUSD?: number | null,
>     model?: string | null,
>     type?: string | null,
>     usd?: number | null
>   }[] | null,
>   gpuUSD?: number | null,
>   includedDiskGiB?: number | null,
>   machines?: number | null,
>   macos?: {
>     hourUSD?: number | null,
>     macHours?: number | null,
>     pool?: string | null,
>     usd?: number | null
>   }[] | null,
>   macosUSD?: number | null,
>   memGiBHours?: number | null,
>   memUSD?: number | null,
>   overageUSD?: number | null,
>   periodEnd?: string | null,
>   periodStart?: string | null,
>   ratedUntil?: string | null,
>   remainingUSD?: number | null,
>   running?: number | null,
>   runtimeUSD?: number | null,
>   snapshots?: number | null,
>   starts?: {
>     days?: {
>       date?: string | null,
>       extraStarts?: number | null,
>       extraStartsUSD?: number | null
>     }[] | null,
>     extraDay?: number | null,
>     extraDayUSD?: number | null,
>     extraMonth?: number | null,
>     extraMonthUSD?: number | null,
>     extraStartUSD?: number | null,
>     extraStarts?: string | null,
>     nextStartUSD?: number | null | null,
>     startsMonth?: number | null,
>     windows?: {
>       charge?: boolean | null,
>       freesAt?: string | null,
>       included?: number | null,
>       max?: number | null,
>       used?: number | null,
>       window?: string | null
>     }[] | null
>   } | null,
>   storageComputedAt?: string | null | null,
>   storageGiBHours?: number | null,
>   storageUSD?: number | null,
>   storedBytes?: number | null | null,
>   usageCreditsUSD?: number | null,
>   vcpuHours?: number | null,
>   vcpuUSD?: number | null
> } | null
> ```

***

### webhooks.create

`orgs.webhooks.create`

Register a webhook endpoint

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.create({
	id: 'org_4t7m1z',
	url: 'https://example.com/api/webhook?tenantId=acme',
	events: ['sandbox.started', 'sandbox.error'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `description` | `string` | No | — |
| `enabled` | `boolean` | No | — |
| `events` | `(sandbox.created \| sandbox.started \| sandbox.stopped \| sandbox.suspended \| sandbox.error \| sandbox.deleted \| snapshot.created \| snapshot.failed \| snapshot.deleted)[]` | Yes | — |
| `url` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `disabledReason` | `string \| null` | No | Why the server disabled it: every attempt failed for 5 days. Absent when an admin did, or it is enabled. |
| `enabled` | `boolean \| null` | No | — |
| `events` | `string[] \| null` | No | — |
| `failingSince` | `string \| null` | No | The first failed attempt since the last success. |
| `id` | `string \| null` | No | — |
| `orgId` | `string \| null` | No | — |
| `secret` | `string \| null` | No | The signing secret (`whsec_` + base64 key), only in the responses of create and rotate. |
| `updatedAt` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

### webhooks.delete

`orgs.webhooks.delete`

Delete a webhook endpoint with its pending deliveries and delivery log

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.delete({ id: 'org_4t7m1z', webhookId: 'wh_2r8m5x' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `webhookId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### webhooks.deliveries.list

`orgs.webhooks.deliveries.list`

List an endpoint's deliveries, newest first, with their attempts

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.deliveries.list({ id: 'org_4t7m1z', webhookId: 'wh_2r8m5x' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `webhookId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string` | No | The previous page's nextCursor. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   attemptLog?: {
>     at?: string | null,
>     attempt?: number | null,
>     durationMs?: number | null,
>     error?: string | null,
>     response?: string | null,
>     status?: number | null
>   }[] | null,
>   attempts?: number | null,
>   createdAt?: string | null,
>   eventId?: string | null,
>   eventType?: string | null,
>   id?: string | null,
>   lastAttemptAt?: string | null,
>   lastError?: string | null,
>   lastStatus?: number | null,
>   nextAttemptAt?: string | null,
>   payload?: {
>     createdAt?: string | null,
>     data?: {
>     } | null,
>     id?: string | null,
>     orgId?: string | null,
>     type?: string | null
>   } | null,
>   retryable?: boolean | null,
>   state?: string | null
> }[] | null
> ```

***

### webhooks.deliveries.retry

`orgs.webhooks.deliveries.retry`

Send a finished (succeeded or failed) delivery once more

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.deliveries.retry({ id: 'org_4t7m1z', webhookId: 'wh_2r8m5x', deliveryId: 'dlv_6m3q8z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `webhookId` | `string` | Yes | — |
| `deliveryId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attemptLog` | `object[] \| null` | No | — |
| `attempts` | `number \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `eventId` | `string \| null` | No | — |
| `eventType` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `lastAttemptAt` | `string \| null` | No | — |
| `lastError` | `string \| null` | No | — |
| `lastStatus` | `number \| null` | No | — |
| `nextAttemptAt` | `string \| null` | No | Pending only. |
| `payload` | `object \| null` | No | The body of every webhook request. Requests are signed per Standard Webhooks: `webhook-id` (the event ID: deduplicate on it), `webhook-timestamp` (Unix seconds) and `webhook-signature` (`v1,<base64 HMAC-SHA256 of "<id>.<timestamp>.<body>">`, space separated when two secrets sign). |
| `retryable` | `boolean \| null` | No | Whether POST .../retry would queue this delivery now: false while it is pending, and once its event is too old to retry (409 operation\_conflict otherwise). |
| `state` | `string \| null` | No | — |

> [accordion] attemptLog full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   attempt?: number | null,
>   durationMs?: number | null,
>   error?: string | null,
>   response?: string | null,
>   status?: number | null
> }[] | null
> ```

> [accordion] payload full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   data?: {
>   } | null,
>   id?: string | null,
>   orgId?: string | null,
>   type?: string | null
> } | null
> ```

***

### webhooks.get

`orgs.webhooks.get`

Get a webhook endpoint

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.get({ id: 'org_4t7m1z', webhookId: 'wh_2r8m5x' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `webhookId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `disabledReason` | `string \| null` | No | Why the server disabled it: every attempt failed for 5 days. Absent when an admin did, or it is enabled. |
| `enabled` | `boolean \| null` | No | — |
| `events` | `string[] \| null` | No | — |
| `failingSince` | `string \| null` | No | The first failed attempt since the last success. |
| `id` | `string \| null` | No | — |
| `orgId` | `string \| null` | No | — |
| `secret` | `string \| null` | No | The signing secret (`whsec_` + base64 key), only in the responses of create and rotate. |
| `updatedAt` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

### webhooks.list

`orgs.webhooks.list`

List an org's webhook endpoints

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.list({ id: 'org_4t7m1z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `eventTypes` | `string[] \| null` | No | — |
| `items` | `object[] \| null` | No | — |
| `maxEndpoints` | `number \| null` | No | How many endpoints the org may have (default 10). |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   description?: string | null,
>   disabledReason?: string | null,
>   enabled?: boolean | null,
>   events?: string[] | null,
>   failingSince?: string | null,
>   id?: string | null,
>   orgId?: string | null,
>   secret?: string | null,
>   updatedAt?: string | null,
>   url?: string | null
> }[] | null
> ```

***

### webhooks.rotate

`orgs.webhooks.rotate`

Give an endpoint a new signing secret

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.rotate({ id: 'org_4t7m1z', webhookId: 'wh_2r8m5x' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `webhookId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `disabledReason` | `string \| null` | No | Why the server disabled it: every attempt failed for 5 days. Absent when an admin did, or it is enabled. |
| `enabled` | `boolean \| null` | No | — |
| `events` | `string[] \| null` | No | — |
| `failingSince` | `string \| null` | No | The first failed attempt since the last success. |
| `id` | `string \| null` | No | — |
| `orgId` | `string \| null` | No | — |
| `secret` | `string \| null` | No | The signing secret (`whsec_` + base64 key), only in the responses of create and rotate. |
| `updatedAt` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

### webhooks.test

`orgs.webhooks.test`

Queue a `webhook.test` event to an enabled endpoint

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.test({ id: 'org_4t7m1z', webhookId: 'wh_2r8m5x' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `webhookId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attemptLog` | `object[] \| null` | No | — |
| `attempts` | `number \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `eventId` | `string \| null` | No | — |
| `eventType` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `lastAttemptAt` | `string \| null` | No | — |
| `lastError` | `string \| null` | No | — |
| `lastStatus` | `number \| null` | No | — |
| `nextAttemptAt` | `string \| null` | No | Pending only. |
| `payload` | `object \| null` | No | The body of every webhook request. Requests are signed per Standard Webhooks: `webhook-id` (the event ID: deduplicate on it), `webhook-timestamp` (Unix seconds) and `webhook-signature` (`v1,<base64 HMAC-SHA256 of "<id>.<timestamp>.<body>">`, space separated when two secrets sign). |
| `retryable` | `boolean \| null` | No | Whether POST .../retry would queue this delivery now: false while it is pending, and once its event is too old to retry (409 operation\_conflict otherwise). |
| `state` | `string \| null` | No | — |

> [accordion] attemptLog full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   attempt?: number | null,
>   durationMs?: number | null,
>   error?: string | null,
>   response?: string | null,
>   status?: number | null
> }[] | null
> ```

> [accordion] payload full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   data?: {
>   } | null,
>   id?: string | null,
>   orgId?: string | null,
>   type?: string | null
> } | null
> ```

***

### webhooks.update

`orgs.webhooks.update`

Change a webhook endpoint

**Risk:** `write`

```ts theme={null}
await corsair.instabox.api.orgs.webhooks.update({ id: 'org_4t7m1z', webhookId: 'wh_2r8m5x' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Organization ID. The caller must be its owner or an admin. |
| `webhookId` | `string` | Yes | — |
| `description` | `string` | No | — |
| `enabled` | `boolean` | No | — |
| `events` | `(sandbox.created \| sandbox.started \| sandbox.stopped \| sandbox.suspended \| sandbox.error \| sandbox.deleted \| snapshot.created \| snapshot.failed \| snapshot.deleted)[]` | No | — |
| `url` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `disabledReason` | `string \| null` | No | Why the server disabled it: every attempt failed for 5 days. Absent when an admin did, or it is enabled. |
| `enabled` | `boolean \| null` | No | — |
| `events` | `string[] \| null` | No | — |
| `failingSince` | `string \| null` | No | The first failed attempt since the last success. |
| `id` | `string \| null` | No | — |
| `orgId` | `string \| null` | No | — |
| `secret` | `string \| null` | No | The signing secret (`whsec_` + base64 key), only in the responses of create and rotate. |
| `updatedAt` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

## Ports

### list

`ports.list`

List the public ports of all your sandboxes

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.ports.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | Whether the server has public ports configured. |
| `ports` | `object[] \| null` | No | — |

> [accordion] ports full type
>
> ```ts theme={null}
> {
>   access?: string | null,
>   address?: string | null,
>   createdAt?: string | null,
>   expiresAt?: null | null,
>   id?: string | null,
>   machineId?: string | null,
>   name?: string | null,
>   port?: number | null,
>   protocol?: string | null,
>   token?: string | null,
>   tokenUrl?: string | null,
>   url?: string | null
> }[] | null
> ```

***

## Snapshots

### delete

`snapshots.delete`

Delete a snapshot

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.instabox.api.snapshots.delete({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Snapshot ID (`sn_`, or `im_` for older snapshots, + 26 lowercase base32 characters). |
| `idempotency_key` | `string` | No | Idempotency-Key header: a retry with the same key returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `confirm_delete` | `string` | No | X-Confirm-Delete header: the ID or exact name of what is deleted. Left out, the plugin sends the id from the path. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | Instabox accepted the call; it answered with no body. |

***

### files.list

`snapshots.files.list`

Read a file or directory of a snapshot's system files

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.snapshots.files.list({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Snapshot ID (`sn_`, or `im_` for older snapshots, + 26 lowercase base32 characters). |
| `path` | `string` | No | Absolute path, at most 4096 bytes (default "/"). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `binary` | `boolean \| null` | No | The file is not UTF-8 text; content is empty. |
| `content` | `string \| null` | No | A text file's content (UTF-8). |
| `entries` | `object[] \| null` | No | A directory's entries, directories first, then by name. |
| `modTime` | `string \| null` | No | — |
| `mode` | `string \| null` | No | As ls -l, for example drwxr-xr-x. |
| `path` | `string \| null` | No | The path read, with symbolic links resolved. |
| `size` | `number \| null` | No | Bytes; 0 for a directory. |
| `truncated` | `boolean \| null` | No | The directory has more entries, or the file more bytes, than returned. |
| `type` | `string \| null` | No | — |

> [accordion] entries full type
>
> ```ts theme={null}
> {
>   modTime?: string | null,
>   mode?: string | null,
>   name?: string | null,
>   size?: number | null,
>   target?: string | null,
>   type?: string | null
> }[] | null
> ```

***

### get

`snapshots.get`

Get a snapshot of one of your orgs

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.snapshots.get({ id: 'm_k3m7q2abx5wr4hj6zpcnfa2etd' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Snapshot ID (`sn_`, or `im_` for older snapshots, + 26 lowercase base32 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `dataSizeBytes` | `number \| null` | No | The logical size of the storage disk (`/data`) a sandbox created from it gets, not the bytes stored (the saved data is sparse and compressed); absent for system-files-only snapshots. Sandboxes created from it get at least this much storage. |
| `defaultSpec` | `object \| null` | No | The size a sandbox created from this snapshot gets when the create names none: with `sizeLocked`, the vCPUs and memory of the sandbox it was saved from, the only size a create from it may name; without (saved before this rule), the default size (`limits.machineSpec`, 4 vCPU / 8 GiB on api.instabox.sh); a GPU snapshot: its GPU type's size for the count, which a create may change with `gpu`. Plus the storage (`/data`) and system disk sizes the snapshot was saved with, which a created sandbox gets at least. Absent when its template is unknown. |
| `description` | `string \| null` | No | — |
| `error` | `string \| null` | No | Why a `failed` snapshot failed. |
| `exclusiveBytes` | `number \| null` | No | No longer computed; servers leave it out. (Was the stored bytes only this snapshot references.) |
| `guestUser` | `string \| null` | No | The source sandbox's Linux user (`Machine.guestUser`), which a sandbox created from this snapshot keeps unless the create names another. `dev` for snapshots of sandboxes from older templates. |
| `id` | `string \| null` | No | `sn_...` (`im_...` for older snapshots). |
| `model` | `string \| null` | No | The Mac model (`TemplateModel.name`) a macOS snapshot was saved on. A create from it runs there unless it names another `model` or that model is closed. |
| `name` | `string \| null` | No | Unique among the org's live snapshots. |
| `orgId` | `string \| null` | No | The org the snapshot belongs to (its source sandbox's). |
| `publishedAt` | `string \| null` | No | When the visibility became community or official. |
| `publisherLogin` | `string \| null` | No | Who shared or published it. |
| `rootSizeBytes` | `number \| null` | No | The logical size of the system disk a sandbox created from it gets (its provisioned capacity), not the bytes stored: a snapshot is saved sparse and compressed. |
| `sizeLocked` | `boolean \| null` | No | True for a snapshot (not of a GPU sandbox) saved since a create from a snapshot gets its source's size one to one: a create from it gets `defaultSpec`'s vCPUs and memory only (another is `400 spec_not_allowed`). Absent for older snapshots, which create at any size. |
| `sourceMachineId` | `string \| null` | No | — |
| `sourceSnapshotSeq` | `number \| null` | No | The source sandbox's saved state (`storage.snapshotSeq`) this snapshot was taken from; 0 for a live snapshot of a sandbox that was never stopped. |
| `status` | `string \| null` | No | `ready` can be used. A snapshot of a running sandbox is `pending` while it uploads (its sizes are the sandbox's until then), then `ready` or `failed`. |
| `template` | `object \| null` | No | — |
| `visibility` | `string \| null` | No | Who can create from the snapshot (docs/community-templates.md): `private` (the default, its org's members), `community` (every signed-in account) or `official` (listed next to the built-in templates). Absent on older servers: treat as private. Handlers do not set community or official yet. |

> [accordion] defaultSpec full type
>
> ```ts theme={null}
> {
>   gpuType?: string | null,
>   gpus?: number | null,
>   memMiB?: number | null,
>   persistentDiskGiB?: number | null,
>   rootDiskGiB?: number | null,
>   vcpus?: number | null
> } | null
> ```

> [accordion] template full type
>
> ```ts theme={null}
> {
>   digest?: string | null,
>   id?: string | null,
>   kernel?: string | null,
>   version?: string | null
> } | null
> ```

***

### list

`snapshots.list`

List the snapshots of your orgs

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.snapshots.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `snapshots` | `object[] \| null` | No | — |

> [accordion] snapshots full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   dataSizeBytes?: number | null,
>   defaultSpec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   description?: string | null,
>   error?: string | null,
>   exclusiveBytes?: number | null,
>   guestUser?: string | null,
>   id?: string | null,
>   model?: string | null,
>   name?: string | null,
>   orgId?: string | null,
>   publishedAt?: string | null,
>   publisherLogin?: string | null,
>   rootSizeBytes?: number | null,
>   sizeLocked?: boolean | null,
>   sourceMachineId?: string | null,
>   sourceSnapshotSeq?: number | null,
>   status?: string | null,
>   template?: {
>     digest?: string | null,
>     id?: string | null,
>     kernel?: string | null,
>     version?: string | null
>   } | null,
>   visibility?: string | null
> }[] | null
> ```

***

## Stats

### get

`stats.get`

Public figures, such as how many sandboxes are running right now

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.stats.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `at` | `string \| null` | No | — |
| `runningMachines` | `number \| null` | No | — |

***

## Templates

### list

`templates.list`

List the templates a sandbox can start from

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.templates.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `templates` | `object[] \| null` | No | — |

> [accordion] templates full type
>
> ```ts theme={null}
> {
>   arch?: string | null,
>   capabilities?: string[] | null,
>   creatable?: boolean | null,
>   default?: boolean | null,
>   defaultSpec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   description?: string | null,
>   digest?: string | null,
>   gpu?: boolean | null,
>   gpuMode?: string | null,
>   gpuTypes?: {
>     counts?: number[] | null,
>     default?: boolean | null,
>     maxPerMachine?: number | null,
>     memGiB?: number | null,
>     model?: string | null,
>     queued?: number | null,
>     sizes?: {
>       gpuType?: string | null,
>       gpus?: number | null,
>       memMiB?: number | null,
>       persistentDiskGiB?: number | null,
>       rootDiskGiB?: number | null,
>       vcpus?: number | null
>     }[] | null,
>     type?: string | null
>   }[] | null,
>   hidden?: boolean | null,
>   id?: string | null,
>   kernel?: string | null,
>   latest?: boolean | null,
>   minimumLease?: {
>     hourUSD?: number | null,
>     hours?: number | null,
>     minimumUSD?: number | null
>   } | null,
>   models?: {
>     closed?: boolean | null,
>     defaultSpec?: {
>       gpuType?: string | null,
>       gpus?: number | null,
>       memMiB?: number | null,
>       persistentDiskGiB?: number | null,
>       rootDiskGiB?: number | null,
>       vcpus?: number | null
>     } | null,
>     label?: string | null,
>     minimumLease?: {
>       hourUSD?: number | null,
>       hours?: number | null,
>       minimumUSD?: number | null
>     } | null,
>     name?: string | null,
>     pool?: string | null,
>     prebootSpecs?: {
>       gpuType?: string | null,
>       gpus?: number | null,
>       memMiB?: number | null,
>       persistentDiskGiB?: number | null,
>       rootDiskGiB?: number | null,
>       vcpus?: number | null
>     }[] | null,
>     sizes?: {
>       gpuType?: string | null,
>       gpus?: number | null,
>       memMiB?: number | null,
>       persistentDiskGiB?: number | null,
>       rootDiskGiB?: number | null,
>       vcpus?: number | null
>     }[] | null
>   }[] | null,
>   os?: string | null,
>   pool?: string | null,
>   preboot?: boolean | null,
>   prebootSpecs?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   }[] | null,
>   restricted?: boolean | null,
>   runtime?: Record<string, string> | null,
>   sizes?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   }[] | null,
>   staged?: boolean | null,
>   version?: string | null
> }[] | null
> ```

***

## Usage

### get

`usage.get`

Your storage use, limits, this month's cost and credit balance

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.usage.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | An org you belong to (org\_...), personal or workspace, to report instead of the default. A workspace API key may name only its own workspace. An org you are not a member of, or that does not exist, answers `404 not_found`, as `GET /v1/orgs/{id}` does. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `allocatedDiskGiB` | `number \| null` | No | The `/data` of all your live sandboxes, in GiB, read live: what `limits.maxStoredGiB` is checked against and what storage is billed on. Absent from older servers. |
| `computedAt` | `string \| null \| null` | No | When the byte figures (`logicalBytes`, `storedBytes`, `storage`) were last computed. They are no longer updated: the scheduled measurement is off, so they are the last ones computed and may be stale, including nonzero for an org that has deleted everything since. An org never measured that stores nothing reads 0 as of now; null for an org with stored data that was never measured. Read `allocatedDiskGiB` instead. |
| `cost` | `object \| null` | No | This calendar month's (UTC) cost in USD as the hourly rating priced it (`costUSD`, with `runtimeUSD`, `storageUSD` and `egressUSD`), up to `ratedUntil`; the allowance (`allowanceUSD`, `creditRemainingUSD`, `overageUSD`) and the credit balance (`creditsUSD`, `creditsExpireAt`). The same figures as `usage` on `GET /v1/orgs/{id}`. A free sandbox is never billed, so a free month is `0`. Absent from older servers. |
| `exclusiveBytes` | `number \| null` | No | No longer computed: always 0. (Was the part of storedBytes no other org shares.) |
| `images` | `number \| null` | No | Deprecated: `snapshots` (same value). |
| `limits` | `object \| null` | No | Your limits. An admin may change maxMachines per user. |
| `logicalBytes` | `number \| null` | No | Full size of your sandboxes and snapshots, as of `computedAt` (no longer updated). |
| `machines` | `number \| null` | No | Your sandboxes, in any state. |
| `org` | `object \| null` | No | The org these figures and limits describe: your personal org by default, a workspace key's workspace, or the one named with `org`. Absent from older servers. |
| `snapshots` | `number \| null` | No | Your snapshots. |
| `storage` | `object \| null` | No | storedBytes by sandbox, from the same measurement (no longer updated). Absent for an org never measured, and from older servers. |
| `storedBytes` | `number \| null` | No | What they take up once compressed, with shared data counted once and the templates' own content (an unchanged root filesystem) not counted, as of `computedAt`. No longer updated: the limit and billing count `allocatedDiskGiB`. |

> [accordion] cost full type
>
> ```ts theme={null}
> {
>   allocatedDiskGiB?: number | null,
>   allowanceUSD?: number | null,
>   billableDiskGiB?: number | null,
>   chargedUSD?: number | null,
>   costUSD?: number | null,
>   creditRemainingUSD?: number | null,
>   creditsExpireAt?: string | null,
>   creditsUSD?: number | null,
>   creditsUsedUSD?: number | null,
>   egressGiB?: number | null,
>   egressUSD?: number | null,
>   extraStarts?: number | null,
>   extraStartsUSD?: number | null,
>   freeDiskGiBPerSandbox?: number | null,
>   freeMachines?: number | null,
>   freeSandboxHours?: number | null,
>   gpu?: {
>     gpuHours?: number | null,
>     hourUSD?: number | null,
>     model?: string | null,
>     type?: string | null,
>     usd?: number | null
>   }[] | null,
>   gpuUSD?: number | null,
>   includedDiskGiB?: number | null,
>   machines?: number | null,
>   macos?: {
>     hourUSD?: number | null,
>     macHours?: number | null,
>     pool?: string | null,
>     usd?: number | null
>   }[] | null,
>   macosUSD?: number | null,
>   memGiBHours?: number | null,
>   memUSD?: number | null,
>   overageUSD?: number | null,
>   periodEnd?: string | null,
>   periodStart?: string | null,
>   ratedUntil?: string | null,
>   remainingUSD?: number | null,
>   running?: number | null,
>   runtimeUSD?: number | null,
>   snapshots?: number | null,
>   starts?: {
>     days?: {
>       date?: string | null,
>       extraStarts?: number | null,
>       extraStartsUSD?: number | null
>     }[] | null,
>     extraDay?: number | null,
>     extraDayUSD?: number | null,
>     extraMonth?: number | null,
>     extraMonthUSD?: number | null,
>     extraStartUSD?: number | null,
>     extraStarts?: string | null,
>     nextStartUSD?: number | null | null,
>     startsMonth?: number | null,
>     windows?: {
>       charge?: boolean | null,
>       freesAt?: string | null,
>       included?: number | null,
>       max?: number | null,
>       used?: number | null,
>       window?: string | null
>     }[] | null
>   } | null,
>   storageComputedAt?: string | null | null,
>   storageGiBHours?: number | null,
>   storageUSD?: number | null,
>   storedBytes?: number | null | null,
>   usageCreditsUSD?: number | null,
>   vcpuHours?: number | null,
>   vcpuUSD?: number | null
> } | null
> ```

> [accordion] limits full type
>
> ```ts theme={null}
> {
>   liveSnapshots?: boolean | null,
>   machineSpec?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   } | null,
>   machineSpecs?: {
>     gpuType?: string | null,
>     gpus?: number | null,
>     memMiB?: number | null,
>     persistentDiskGiB?: number | null,
>     rootDiskGiB?: number | null,
>     vcpus?: number | null
>   }[] | null,
>   maxImages?: number | null,
>   maxMachines?: number | null,
>   maxSnapshots?: number | null,
>   maxStoredGiB?: number | null,
>   orgSecrets?: boolean | null,
>   unlimited?: string[] | null | null,
>   vault?: {
>     maxBytes?: number | null,
>     maxItems?: number | null
>   } | null
> } | null
> ```

> [accordion] org full type
>
> ```ts theme={null}
> {
>   alwaysOnAllowed?: boolean | null,
>   id?: string | null,
>   kind?: string | null,
>   name?: string | null,
>   tier?: string | null
> } | null
> ```

> [accordion] storage full type
>
> ```ts theme={null}
> {
>   deletedMachineSnapshotBytes?: number | null,
>   deletedMachineSnapshots?: number | null,
>   machines?: {
>     diskBytes?: number | null,
>     id?: string | null,
>     name?: string | null,
>     sizeBytes?: number | null,
>     snapshotBytes?: number | null,
>     snapshots?: number | null,
>     state?: string | null
>   }[] | null
> } | null
> ```

***

### machines

`usage.machines`

Compute, disk and egress use and list price by sandbox over a window, deleted sandboxes included

**Risk:** `read`

```ts theme={null}
await corsair.instabox.api.usage.machines({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | As in `GET /v1/usage`. |
| `q` | `string` | No | Only the sandboxes whose ID or name contains this, ignoring case. `total` counts the matches. |
| `metadata` | `string[]` | No | `key:value` (split at the first `:`); only sandboxes whose metadata has the key with exactly that value. Repeatable; all terms must match (AND). `total` counts the matches. |
| `from` | `string` | No | Start of the window (RFC 3339). Default the start of this month (UTC). |
| `to` | `string` | No | End of the window (RFC 3339), after `from`. Default now. |
| `sort` | `computeUSD \| vcpuSeconds \| memGiBSeconds` | No | — |
| `order` | `asc \| desc` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `from` | `string \| null` | No | — |
| `machines` | `object[] \| null` | No | — |
| `to` | `string \| null` | No | — |
| `total` | `number \| null` | No | Sandboxes in the list, all pages. |

> [accordion] machines full type
>
> ```ts theme={null}
> {
>   computeUSD?: number | null,
>   deletedAt?: string | null,
>   diskGiBSeconds?: number | null,
>   diskUSD?: number | null,
>   egressBytes?: number | null,
>   egressUSD?: number | null,
>   free?: boolean | null,
>   gpuSeconds?: number | null,
>   gpuType?: string | null,
>   gpuUSD?: number | null,
>   gpus?: number | null,
>   id?: string | null,
>   memGiBSeconds?: number | null,
>   metadata?: Record<string, string> | null,
>   name?: string | null | null,
>   runningSeconds?: number | null,
>   vcpuSeconds?: number | null
> }[] | null
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.