# API reference

The 39 operations of the public API, read from its OpenAPI contract when this page is built. The base address is `https://api.foxdeploy.ai/v1`.

Every call carries an API key in the `Authorization` header as `Bearer fd_live_...`. Bodies and answers are JSON; times are RFC 3339 in UTC. A create takes an `Idempotency-Key` header, kept 24 hours. [HTTP API](https://docs.foxdeploy.ai/http-api.md) explains keys, scopes, retries and rate limits.

## Errors

An error answers with a status and a body of three fields: `code`, one of the words below; `message`, a sentence for a person; `fields`, the field errors of a request that did not validate.

```json
{
  "code": "limit_concurrent",
  "message": "...",
  "fields": {}
}
```

Codes: `invalid_state`, `not_found`, `unauthenticated`, `forbidden`, `validation_failed`, `bad_request`, `payload_too_large`, `too_many_requests`, `limit_concurrent`, `limit_size`, `limit_snapshots`, `limit_monthly`, `kill_switch`, `starts_blocked`, `capacity`, `upstream_error`, `timeout`, `idempotency_conflict`, `key_in_url`, `csrf_mismatch`, `unavailable`, `server_error`, `file_changed`, `already_exists`, `grant_not_allowed`, `approval_required`, `approval_invalid`, `limit_previews`, `private_file`, `public_not_allowed`, `app_failed`, `not_creator`, `not_running`, `not_signed_in`, `not_memory`, `not_supported`, `bad_files`, `too_many_saves`, `too_many_sign_ins`, `sign_in_computer`, `saved_plans_off`, `computer_not_running`.

Status for each: invalid_state 409 (not in a state that allows this), not_found 404 (also any id of another organisation), unauthenticated 401, forbidden 403 (the key's scope), validation_failed 422, bad_request 400, payload_too_large 413, too_many_requests 429 (with Retry-After), limit_concurrent, limit_size, limit_snapshots (the organisation's snapshot count or storage), limit_monthly, kill_switch and starts_blocked 403 or 402, capacity 503, upstream_error 502, timeout 504, idempotency_conflict 409, key_in_url 400 (revoke that key), csrf_mismatch 403 (a cookie call from another origin), unavailable 503 (keys cannot be checked now), server_error 500, file_changed 412 (a write with If-Match whose file changed since it was read), already_exists 409 (a new folder or a move onto a path that is taken), grant_not_allowed 403 (a route or a field an agent chat's run grant may not use; agent chat), approval_required 403 (the call needs the person's approval first; approval_id names the waiting approval, and the call is sent again with X-Approval once it is allowed), approval_invalid 409 (a malformed X-Approval), limit_previews 409 (3 ports of the computer are open as previews; close one first), private_file 403 (the file holds a person's sign in; the files routes never read, write or delete it), public_not_allowed 403 (a key's token link is a public preview, and the account or the key's maker may not share public links now; reason says why and message in plain words), app_failed 503 (a ready-made app did not start in its new computer; the computer is gone and nothing was charged), not_creator 403, not_running 409, not_signed_in 404, not_memory 422, not_supported 422, bad_files 422 and too_many_saves 429 (the saved plan sign ins' save route; saved-plans), too_many_sign_ins 429 (more than 3 sign in computers, metadata.purpose plan_sign_in, an hour for one person; such a computer is made only from a dashboard session, size small, auto_pause_minutes 1 to 15, is free and is destroyed 30 minutes after its create), sign_in_computer 409 (a sign in computer cannot have its size, auto pause, egress or domains changed, be snapshotted, be resumed from a snapshot or be started after a stop), saved_plans_off 403 (the saved_plans flag is off for the workspace, so no save and no sign in computer), computer_not_running 409 (a chat file copy to a computer that is not running; start it first).

## Computers

<a id="get-computers"></a>

### GET /computers

List computers

```http
GET https://api.foxdeploy.ai/v1/computers
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `state (query)` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | no |  |
| `limit (query)` | `integer` | no |  |
| `cursor (query)` | `string` | no |  |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `items` | `list of Computer` | yes |  |
| `next_cursor` | `string` | yes | May be null. |
| `snapshot_count` | `integer` | no | The user snapshots of the computers the caller can see (pause snapshots not counted); an owner or admin counts every computer of the organisation, a member only their own computers, a run grant only the computers it was granted. The same on every page, whatever the state filter. Only the caller's organisation; an older gateway leaves it out. |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers"></a>

### POST /computers

Create a computer

Idempotency-Key header on creates. 402 when credit is empty; 403 limit_concurrent, limit_size or limit_monthly; 503 capacity when the host has no memory left.

```http
POST https://api.foxdeploy.ai/v1/computers
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `Idempotency-Key (header)` | `string` | no | A repeat with the same key and body answers the first create; another body is 409 idempotency_conflict. Kept 24 hours. At most 255 characters. |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `name` | `string` | no | At most 64 characters. |
| `size` | `"small" \| "medium" \| "large" \| "xl"` | no |  |
| `region` | `"sgp"` | yes |  |
| `image` | `string` | no | a name from GET /images; when left out, the first image of that list |
| `snapshot_id` | `string` | no | a user snapshot of this organisation to restore into the new computer |
| `app` | `string` | no | a live app id from GET /apps; the computer starts with the app installed and running. An unknown, coming or withdrawn id is 404; an app not ready in the region is 503 capacity; an app whose first start fails is 503 app_failed, and nothing is charged. |
| `env` | `map of string` | no |  |
| `egress` | `boolean` | no | Default true. |
| `allowed_domains` | `list of string` | no |  |
| `auto_pause_minutes` | `integer` | no | Default 30. |
| `metadata` | `map of string` | no |  |

**Answer 201: created**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `name` | `string` | yes |  |
| `state` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | yes |  |
| `size` | `"small" \| "medium" \| "large" \| "xl"` | yes |  |
| `region` | `string` | yes |  |
| `image` | `string` | yes |  |
| `created_at` | `string, date-time` | yes |  |
| `started_in_ms` | `integer` | yes |  |
| `app` | `ComputerApp` | no | The ready-made app the computer started with; left out for other computers. |
| `app.id` | `string` | yes |  |
| `app.name` | `string` | yes | The app's name as the catalogue has it. |
| `app.version` | `string` | yes |  |
| `app.port` | `integer` | yes | The app's port for Open app and the agent (a private preview of it). |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-computers-id"></a>

### GET /computers/{id}

One computer

```http
GET https://api.foxdeploy.ai/v1/computers/{id}
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `name` | `string` | yes |  |
| `state` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | yes |  |
| `size` | `"small" \| "medium" \| "large" \| "xl"` | yes |  |
| `region` | `string` | yes |  |
| `image` | `string` | yes |  |
| `uptime_s` | `integer` | yes |  |
| `cost_so_far` | `Money` | yes |  |
| `cost_so_far.currency` | `string` | yes |  |
| `cost_so_far.amount` | `string` | yes |  |
| `ports` | `list of object` | no |  |
| `ports[].port` | `integer` | no |  |
| `ports[].process` | `string` | no |  |
| `preview` | `object` | no | May be null. |
| `preview.port` | `integer` | no |  |
| `preview.url` | `string` | no |  |
| `preview.private` | `boolean` | no |  |
| `preview.require_sign_in` | `boolean` | no |  |
| `created_by` | `object` | yes |  |
| `created_by.kind` | `"claude_code" \| "api" \| "cli" \| "dashboard" \| "agent_chat"` | no |  |
| `created_by.name` | `string` | no |  |
| `created_at` | `string, date-time` | yes |  |
| `updated_at` | `string, date-time` | yes |  |
| `fail_reason` | `string` | no | Why a failed computer failed, in plain words for the person; null otherwise. May be null. |
| `auto_pause_minutes` | `integer` | no | Pause after this many idle minutes; 0 never pauses. |
| `egress` | `boolean` | no |  |
| `allowed_domains` | `list of string` | no | null lets every domain through; a list lets only those through. May be null. |
| `blocked_ports` | `list of integer` | no | Outbound ports blocked to every host (the plan's list, changed per computer). |
| `dns_log` | `boolean` | no |  |
| `env_keys` | `list of string` | no | The names of the sealed env values. Values are never sent back. |
| `next_size` | `"small" \| "medium" \| "large" \| "xl" \| null` | no | The size the computer takes at its next start, when changed. May be null. |
| `from_snapshot` | `boolean` | no | The computer was made from a user snapshot. It started from the snapshot's disk only, signed out of Claude Code. |
| `app` | `ComputerApp` | no | The ready-made app the computer started with; left out for other computers. |
| `app.id` | `string` | yes |  |
| `app.name` | `string` | yes | The app's name as the catalogue has it. |
| `app.version` | `string` | yes |  |
| `app.port` | `integer` | yes | The app's port for Open app and the agent (a private preview of it). |
| `helper` | `ComputerHelper` | no | The helper inside the computer, as its last health answer said. Absent until the host has read it. |
| `helper.version` | `string` | yes | The helper's version stamp, for example agent-73647e6af40c. |
| `helper.protocol` | `integer` | yes | The helper's wire protocol. 1 is a helper baked into an older image. |
| `helper.system` | `string` | no | The system drive version the helper runs from, for example sys-3f9a1c0d7b2e. Absent for a helper baked into an older image. |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="patch-computers-id"></a>

### PATCH /computers/{id}

Change a computer's settings

```http
PATCH https://api.foxdeploy.ai/v1/computers/{id}
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `name` | `string` | no |  |
| `auto_pause_minutes` | `integer` | no |  |
| `egress` | `boolean` | no |  |
| `allowed_domains` | `list of string` | no | May be null. |
| `blocked_ports` | `list of integer` | no |  |
| `dns_log` | `boolean` | no |  |
| `size` | `"small" \| "medium" \| "large" \| "xl"` | no |  |
| `env` | `map of string` | no | Sealed values to set; an empty string removes that name. |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `name` | `string` | yes |  |
| `state` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | yes |  |
| `size` | `"small" \| "medium" \| "large" \| "xl"` | yes |  |
| `region` | `string` | yes |  |
| `image` | `string` | yes |  |
| `uptime_s` | `integer` | yes |  |
| `cost_so_far` | `Money` | yes |  |
| `cost_so_far.currency` | `string` | yes |  |
| `cost_so_far.amount` | `string` | yes |  |
| `ports` | `list of object` | no |  |
| `ports[].port` | `integer` | no |  |
| `ports[].process` | `string` | no |  |
| `preview` | `object` | no | May be null. |
| `preview.port` | `integer` | no |  |
| `preview.url` | `string` | no |  |
| `preview.private` | `boolean` | no |  |
| `preview.require_sign_in` | `boolean` | no |  |
| `created_by` | `object` | yes |  |
| `created_by.kind` | `"claude_code" \| "api" \| "cli" \| "dashboard" \| "agent_chat"` | no |  |
| `created_by.name` | `string` | no |  |
| `created_at` | `string, date-time` | yes |  |
| `updated_at` | `string, date-time` | yes |  |
| `fail_reason` | `string` | no | Why a failed computer failed, in plain words for the person; null otherwise. May be null. |
| `auto_pause_minutes` | `integer` | no | Pause after this many idle minutes; 0 never pauses. |
| `egress` | `boolean` | no |  |
| `allowed_domains` | `list of string` | no | null lets every domain through; a list lets only those through. May be null. |
| `blocked_ports` | `list of integer` | no | Outbound ports blocked to every host (the plan's list, changed per computer). |
| `dns_log` | `boolean` | no |  |
| `env_keys` | `list of string` | no | The names of the sealed env values. Values are never sent back. |
| `next_size` | `"small" \| "medium" \| "large" \| "xl" \| null` | no | The size the computer takes at its next start, when changed. May be null. |
| `from_snapshot` | `boolean` | no | The computer was made from a user snapshot. It started from the snapshot's disk only, signed out of Claude Code. |
| `app` | `ComputerApp` | no | The ready-made app the computer started with; left out for other computers. |
| `app.id` | `string` | yes |  |
| `app.name` | `string` | yes | The app's name as the catalogue has it. |
| `app.version` | `string` | yes |  |
| `app.port` | `integer` | yes | The app's port for Open app and the agent (a private preview of it). |
| `helper` | `ComputerHelper` | no | The helper inside the computer, as its last health answer said. Absent until the host has read it. |
| `helper.version` | `string` | yes | The helper's version stamp, for example agent-73647e6af40c. |
| `helper.protocol` | `integer` | yes | The helper's wire protocol. 1 is a helper baked into an older image. |
| `helper.system` | `string` | no | The system drive version the helper runs from, for example sys-3f9a1c0d7b2e. Absent for a helper baked into an older image. |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="delete-computers-id"></a>

### DELETE /computers/{id}

Destroy a computer

```http
DELETE https://api.foxdeploy.ai/v1/computers/{id}
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

Answer 204: destroyed.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-previews"></a>

### POST /computers/{id}/previews

Open a port as a private preview for 1 hour

Agent chat. A run grant (the Preview approval in X-Approval unless the chat is in Don't ask) or the person's own dashboard session (Open again); keys use the token link route in this release. At most 3 ports per computer (409 limit_previews). The link is `https://p-<16 hex>.<preview domain>/`, opens for signed in members of the organisation only and stops 1 hour after the open or the last renew.

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/previews
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `port` | `integer` | yes | From 1 to 65535. |

**Answer 201: open**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `computer_id` | `string` | yes |  |
| `port` | `integer` | yes |  |
| `state` | `"open" \| "expired" \| "closed"` | yes |  |
| `url` | `string` | yes |  |
| `opened_by` | `"agent" \| "member"` | yes |  |
| `expires_at` | `string, date-time` | yes |  |

Errors: `400`, `401`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-previews-id-close"></a>

### POST /previews/{id}/close

Close a preview now

The person's session or the run grant of a chat on its own computers; another organisation's or another member's preview is 404. Open connections to it end at once.

```http
POST https://api.foxdeploy.ai/v1/previews/{id}/close
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: closed**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `computer_id` | `string` | yes |  |
| `port` | `integer` | yes |  |
| `state` | `"open" \| "expired" \| "closed"` | yes |  |
| `url` | `string` | yes |  |
| `opened_by` | `"agent" \| "member"` | yes |  |
| `expires_at` | `string, date-time` | yes |  |

Errors: `400`, `401`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-plans-save"></a>

### POST /computers/{id}/plans/save

Save the sign in of a tool from this computer

Saved plan sign ins (saved-plans). Reads the tool's credentials files from the caller's own running computer and hands them to the control plane, which seals and stores them; answers the record's metadata only, never a file or anything sealed. Only the dashboard session of the person who created the computer; 10 saves an hour per person. Errors: saved_plans_off 403 (the flag is off for the workspace), not_creator 403, forbidden 403 (not a dashboard session), not_running 409, not_signed_in 404 (no credentials file yet), not_memory 422 and not_supported 422 (an older image: make a new computer), bad_files 422 (not that tool's sign in), validation_failed 422 (tool), too_many_saves 429, unavailable 503.

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/plans/save
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `tool` | `"claude" \| "codex" \| "kimi"` | yes |  |

**Answer 200: saved**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `tool` | `"claude" \| "codex" \| "kimi"` | yes |  |
| `kind` | `"plan" \| "api_key"` | no |  |
| `label` | `string` | no | At most 120 characters. |
| `state` | `"active" \| "expired" \| "removed"` | yes |  |
| `new_computers` | `boolean` | no |  |
| `version` | `integer` | no |  |
| `created_at` | `string, date-time` | no |  |
| `renewed_at` | `string, date-time` | no | May be null. |
| `last_used_at` | `string, date-time` | no | May be null. |
| `expired_at` | `string, date-time` | no | May be null. |

Errors: `400`, `401`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-apps"></a>

### GET /apps

Ready-made apps

The catalogue of ready-made apps, merged with each region's readiness (cached 30 seconds per region). A live app has a snapshot in a region when that region can launch it; with none it reads "Coming to {region}". A coming app is listed only. Withdrawn apps are left out.

```http
GET https://api.foxdeploy.ai/v1/apps
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `region (query)` | `"sgp"` | no | one region's readiness only; every live region when left out |
| `group (query)` | `"ai-chat" \| "local-models" \| "developer-tools" \| "observability-data"` | no |  |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `items` | `list of CatalogueApp` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-chats-id-stream"></a>

### WS /chats/{id}/stream

The agent chat's live run (WebSocket, a dashboard session only): the run's events after ?after= of ?run=, then live ones, one ChatStreamEvent JSON text frame each. Output only: frames from the browser are dropped. The Origin must be the dashboard's; a sign out ends it.

```http
GET https://api.foxdeploy.ai/v1/chats/{id}/stream
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `run (query)` | `string` | no |  |
| `after (query)` | `integer` | no |  |

Answer 101: switching protocols.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-chats-id-takeover"></a>

### POST /chats/{id}/takeover

Take over (a dashboard session, the chat's member only): the answer is pausing; the agent pauses at its next step boundary, and the stream's run paused event says when Shell 1 is the person's.

```http
POST https://api.foxdeploy.ai/v1/chats/{id}/takeover
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: pausing until the agent's next step boundary**

| Name | Type | Required | Notes |
|---|---|---|---|
| `state` | `"pausing" \| "running"` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-chats-id-handback"></a>

### POST /chats/{id}/handback

Hand back (a dashboard session, the chat's member only): the agent goes on and is told the person used the terminal.

```http
POST https://api.foxdeploy.ai/v1/chats/{id}/handback
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: the agent goes on**

| Name | Type | Required | Notes |
|---|---|---|---|
| `state` | `"pausing" \| "running"` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Commands and the terminal

<a id="post-computers-id-exec"></a>

### POST /computers/{id}/exec

Run a command

cmd as a string runs in /bin/sh -c inside the guest (nothing is interpolated by the gateway); as a list it runs as is; argv (instead of cmd) is an argument list that never goes through a shell, with optional stdin. Cancelling ends the process group: TERM, then KILL after 5 seconds. timeout_s from 1 to 3600. With stream true the answer is text/event-stream: events stdout and stderr with data {d: text}, then exit with {exit_code, duration_ms, timed_out}, or error with {message}.

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/exec
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `cmd` | `string or list of string` | no | The command; exactly one of cmd and argv is given. |
| `argv` | `list of string` | no | An argument list run as is, never through a shell; exactly one of cmd and argv is given. |
| `stdin` | `string` | no | Given to the program on its standard input (at most 512 KiB); never logged. |
| `cwd` | `string` | no |  |
| `env` | `map of string` | no |  |
| `timeout_s` | `integer` | no | Default 600. |
| `stream` | `boolean` | no | Default false. |

**Answer 200: done (with stream true, server sent events stdout, stderr, exit)**

| Name | Type | Required | Notes |
|---|---|---|---|
| `exit_code` | `integer` | yes |  |
| `stdout` | `string` | yes |  |
| `stderr` | `string` | yes |  |
| `duration_ms` | `integer` | yes |  |
| `truncated` | `boolean` | no | true when stdout or stderr passed 1 MiB and was cut |
| `timed_out` | `boolean` | no | true when timeout_s ended the command |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-computers-id-pty"></a>

### WS /computers/{id}/pty

Terminal over WebSocket

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/pty
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `cols (query)` | `integer` | no |  |
| `rows (query)` | `integer` | no |  |

Answer 101: switching protocols; messages {t: in|resize, d} in, {t: out|exit, d} out.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Files

<a id="get-computers-id-files"></a>

### GET /computers/{id}/files

Read a file or list a folder

Files come with X-Content-Type-Options nosniff and a Content-Security-Policy that blocks every script, style and frame; only plain text and raster images are sent inline, anything else as an attachment.

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/files
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `path (query)` | `string` | yes |  |

**Answer 200: file bytes, or {entries} for a folder**

| Name | Type | Required | Notes |
|---|---|---|---|
| `entries` | `list of object` | yes |  |
| `entries[].name` | `string` | yes |  |
| `entries[].kind` | `"file" \| "dir"` | yes |  |
| `entries[].size` | `integer` | yes |  |
| `entries[].mtime` | `string, date-time` | no |  |
| `entries[].private` | `boolean` | no | The file holds a person's sign in (Claude Code's credentials or account file, a CLAUDE_CONFIG_DIR folder, or Codex's auth.json); the files routes refuse it with 403 private_file. |
| `entries[].items` | `integer` | no | A folder that is not private. How many entries it holds, counted up to 1000. |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="put-computers-id-files"></a>

### PUT /computers/{id}/files

Write a file (up to 100 MiB)

```http
PUT https://api.foxdeploy.ai/v1/computers/{id}/files
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `path (query)` | `string` | yes |  |
| `If-Match (header)` | `string` | no | One strong tag "sha256:\<64 hex>", the SHA-256 of the content read: the write lands only while the file is still that version (a compare and set), else 412 file_changed. |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `content` | `string` | yes |  |

**Answer 200: written**

| Name | Type | Required | Notes |
|---|---|---|---|
| `path` | `string` | yes |  |
| `size` | `integer` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `412`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="delete-computers-id-files"></a>

### DELETE /computers/{id}/files

Delete a file

```http
DELETE https://api.foxdeploy.ai/v1/computers/{id}/files
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `path (query)` | `string` | yes |  |

Answer 204: deleted.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-files-upload"></a>

### POST /computers/{id}/files/upload

Upload files (multipart or a tar stream)

The files land in the folder path. A folder under /workspace/ that is not there yet is made first (an existing one is fine); a private path is refused before anything is made.

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/files/upload
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `path (query)` | `string` | yes |  |
| `name (query)` | `string` | no | The file's name when the body is one file's bytes (application/octet-stream) |

**Answer 200: uploaded**

| Name | Type | Required | Notes |
|---|---|---|---|
| `files` | `integer` | yes |  |
| `bytes` | `integer` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-computers-id-files-download"></a>

### GET /computers/{id}/files/download

Download a folder as a zip

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/files/download
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `path (query)` | `string` | yes |  |

Answer 200: zip stream; files that hold a person's sign in are left out.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-computers-id-files-stat"></a>

### GET /computers/{id}/files/stat

A path's kind, size and time, whether a file is text, how many files a folder holds

A final link is not followed (kind symlink). The sign in paths are refused with 403 private_file.

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/files/stat
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `path (query)` | `string` | yes |  |

**Answer 200: the path's details**

| Name | Type | Required | Notes |
|---|---|---|---|
| `path` | `string` | yes |  |
| `kind` | `"file" \| "dir" \| "symlink" \| "other"` | yes |  |
| `size` | `integer` | yes |  |
| `mtime` | `string, date-time` | yes |  |
| `text` | `boolean` | no | A file only. Its first 8 KiB are UTF-8 with no NUL byte. |
| `files` | `integer` | no | A folder only. How many files are under it, counted up to 10000. |
| `files_capped` | `boolean` | no | The count of files stopped at 10000. |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-files-mkdir"></a>

### POST /computers/{id}/files/mkdir

Make a folder (and the missing folders above it)

409 already_exists when something is at the path. Never inside a sign in folder (403 private_file).

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/files/mkdir
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `path (query)` | `string` | yes |  |

**Answer 201: made**

| Name | Type | Required | Notes |
|---|---|---|---|
| `path` | `string` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-files-move"></a>

### POST /computers/{id}/files/move

Rename or move a file or folder within the computer

One rename: the missing folders above to are made, nothing at to is replaced (409 already_exists), a folder never moves into itself (400). The sign in paths never move, nothing moves into them, and a folder that holds one stays (403 private_file). Two paths on different disks are 409 invalid_state.

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/files/move
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `from` | `string` | yes |  |
| `to` | `string` | yes |  |

**Answer 200: moved; path is the new path**

| Name | Type | Required | Notes |
|---|---|---|---|
| `path` | `string` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-chats-id-files-sync"></a>

### POST /chats/{id}/files/sync

Copy the chat's files into its computer (change chat-uploads): the files kept with the chat that this computer does not have yet go into /workspace/uploads, oldest message first, then the message box's drafts. A dashboard session of the chat's member, or the run grant of a run of the chat (in every approval mode); keys are refused with 403. computer is the chat's current computer: another, or a chat that is not the caller's, is 404. A computer that is not running is 409 computer_not_running before anything is read. A file of the same name, size and SHA-256 already there is skipped (and recorded as the copy); one that differs is written as name (2).ext, then (3), up to (99). A file that fails is counted in failed and tried again by the next call. 10 calls a minute per caller and chat; a call while one runs for the same chat waits for it; at most 60 seconds.

```http
POST https://api.foxdeploy.ai/v1/chats/{id}/files/sync
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `computer` | `string` | yes |  |

**Answer 200: what the call copied**

| Name | Type | Required | Notes |
|---|---|---|---|
| `copied` | `integer` | yes |  |
| `skipped` | `integer` | yes |  |
| `failed` | `integer` | yes |  |
| `files` | `list of object` | yes |  |
| `files[].id` | `string` | yes |  |
| `files[].path` | `string` | yes |  |

Errors: `400`, `401`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, each with the [error envelope](#errors).

## Ports and previews

<a id="get-computers-id-ports"></a>

### GET /computers/{id}/ports

Listening ports

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/ports
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `ports` | `list of object` | yes |  |
| `ports[].port` | `integer` | no |  |
| `ports[].process` | `string` | no |  |
| `ports[].since` | `string, date-time` | no |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-preview"></a>

### POST /computers/{id}/preview

Open a preview URL

Deprecated: the token link route stays for keys and SDKs for one release; run grants are refused (grant_not_allowed) and the dashboard uses POST /computers/{id}/previews. A token link (private, without require_sign_in) is a public preview: the control plane records it under the same rules as the dashboard's Public switch (owners and admins of paid or credited accounts, a verified email, the global switch; else 403 public_not_allowed with reason), it opens for anyone at `https://p-<16 hex>.<preview domain>/` for hours (1, 6 or 24; default 1) with the visitor bar, reports and the other guard rails, and DELETE closes it. token_expires_at is when it stops.

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/preview
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `port` | `integer` | yes |  |
| `private` | `boolean` | no | false without require_sign_in (a link anyone can open) is refused with 422 validation_failed: public previews are switched on from the dashboard, with their guard rails. Default true. |
| `require_sign_in` | `boolean` | no | Default false. |
| `hours` | `1 \| 6 \| 24` | no | A token link's public period. Default 1. |
| `show_name` | `boolean` | no | A token link's bar shows the workspace's name (verified businesses only; the control plane decides); default by workspace. |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `url` | `string` | yes |  |
| `port` | `integer` | yes |  |
| `token_expires_at` | `string, date-time` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="delete-computers-id-preview"></a>

### DELETE /computers/{id}/preview

Close the preview

```http
DELETE https://api.foxdeploy.ai/v1/computers/{id}/preview
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

Answer 204: closed.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Pause, resume, stop and start

<a id="post-computers-id-pause"></a>

### POST /computers/{id}/pause

Pause to a snapshot

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/pause
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: paused**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `state` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | yes |  |
| `snapshot_id` | `string` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-resume"></a>

### POST /computers/{id}/resume

Resume from a snapshot

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/resume
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `snapshot_id` | `string` | no | Resume from this snapshot of the computer; the last one when left out |

**Answer 200: running**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `state` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | yes |  |
| `resumed_in_ms` | `integer` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-stop"></a>

### POST /computers/{id}/stop

Stop (keep the disk)

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/stop
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: stopped**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `state` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-start"></a>

### POST /computers/{id}/start

Start from the disk (cold start)

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/start
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: running**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `state` | `"starting" \| "running" \| "paused" \| "snapshotted" \| "stopped" \| "failed"` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Snapshots

<a id="get-computers-id-snapshots"></a>

### GET /computers/{id}/snapshots

Snapshots of a computer

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/snapshots
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `items` | `list of Snapshot` | yes |  |
| `storage_per_month` | `Money` | yes |  |
| `storage_per_month.currency` | `string` | yes |  |
| `storage_per_month.amount` | `string` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="post-computers-id-snapshots"></a>

### POST /computers/{id}/snapshots

Take a snapshot

```http
POST https://api.foxdeploy.ai/v1/computers/{id}/snapshots
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

**Request body**

| Name | Type | Required | Notes |
|---|---|---|---|
| `name` | `string` | no |  |

**Answer 201: created**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id` | `string` | yes |  |
| `name` | `string` | yes |  |
| `kind` | `"pause" \| "user"` | no |  |
| `created_by` | `object` | no |  |
| `created_by.kind` | `"claude_code" \| "api" \| "cli" \| "dashboard" \| "auto_pause" \| "agent_chat"` | no |  |
| `created_by.name` | `string` | no |  |
| `size_bytes` | `integer` | yes |  |
| `created_at` | `string, date-time` | yes |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="delete-snapshots-id"></a>

### DELETE /snapshots/{id}

Delete a snapshot

```http
DELETE https://api.foxdeploy.ai/v1/snapshots/{id}
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

Answer 204: deleted.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Logs

<a id="get-computers-id-logs"></a>

### GET /computers/{id}/logs

Logs (GET .../logs/stream for server sent events)

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/logs
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `kind (query)` | `"computer" \| "calls"` | no |  |
| `since (query)` | `string, date-time` | no |  |

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `lines` | `list of object` | yes |  |
| `lines[].t` | `string, date-time` | no |  |
| `lines[].kind` | `string` | no |  |
| `lines[].text` | `string` | no |  |
| `lines[].key` | `string` | no |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-computers-id-logs-stream"></a>

### GET /computers/{id}/logs/stream

Live logs as server sent events (each event's data is one line as in GET .../logs)

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/logs/stream
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |
| `kind (query)` | `"computer" \| "calls"` | no |  |

Answer 200: text/event-stream; event line, data {t, kind, text, key?}.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Desktop

<a id="get-computers-id-desktop"></a>

### WS /computers/{id}/desktop

Desktop over WebSocket (noVNC frames)

```http
GET https://api.foxdeploy.ai/v1/computers/{id}/desktop
Authorization: Bearer fd_live_...
```

**Parameters**

| Name | Type | Required | Notes |
|---|---|---|---|
| `id (path)` | `string` | yes |  |

Answer 101: switching protocols.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Images and regions

<a id="get-images"></a>

### GET /images

Images

```http
GET https://api.foxdeploy.ai/v1/images
Authorization: Bearer fd_live_...
```

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `items` | `list of object` | yes |  |
| `items[].name` | `string` | no |  |
| `items[].sizes` | `list of "small" \| "medium" \| "large" \| "xl"` | no |  |
| `items[].desktop` | `boolean` | no |  |
| `items[].description` | `string` | no |  |
| `items[].claude_code_version` | `string` | no | The Claude Code version preinstalled in this image, as Anthropic publishes it. |
| `items[].codex_version` | `string` | no | The Codex CLI version preinstalled in this image, as OpenAI publishes it. |
| `items[].kimi_code_version` | `string` | no | The Kimi Code CLI version preinstalled in this image, as Moonshot publishes it. |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

<a id="get-regions"></a>

### GET /regions

Regions

```http
GET https://api.foxdeploy.ai/v1/regions
Authorization: Bearer fd_live_...
```

**Answer 200: ok**

| Name | Type | Required | Notes |
|---|---|---|---|
| `items` | `list of object` | yes |  |
| `items[].code` | `string` | no |  |
| `items[].name` | `string` | no |  |
| `items[].state` | `"live" \| "coming"` | no |  |

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

## Events

<a id="get-events"></a>

### WS /events

Computer state changes for the organisation (WebSocket)

```http
GET https://api.foxdeploy.ai/v1/events
Authorization: Bearer fd_live_...
```

Answer 101: switching protocols.

Errors: `400`, `401`, `402`, `403`, `404`, `409`, `413`, `422`, `429`, `502`, `503`, `504`, each with the [error envelope](#errors).

Source: https://docs.foxdeploy.ai/api-reference/
