# Mapier Pod (Preview) # Report abuse, a copyright notice or child-safety material (https://docs.mapier.ai/pod/api/abuse/create-abuse-report) > Open to everyone, without a key. **POST** `/v1/abuse_reports` Open to everyone, without a key. The report names what it is about by `url` (a sandbox address or a share link) or `address` (an IP address the abuse came from), or both. Pod keeps it with the caller's network (the address cut to its /24 or /48, never the whole address) and pages whoever is on call; `child_safety` pages at once, by call. Reports per network are capped; past the cap the answer is `rate_limited` with `Retry-After`. An `Idempotency-Key` is scoped to the caller's network. A `copyright` report is a notice and carries `copyright` and `reporter.email`. Its statements are counsel's words; until counsel approves a version, a copyright report is refused as `invalid` and notices go to the copyright agent by email, as the abuse page says. Never send the material itself, only where it is. Open to everyone: send it with no key. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/abuse_reports" \ -H "Content-Type: application/json" \ -d '{"category":"phishing","description":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------- | ------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------ | | `category` | `"phishing" \| "malware" \| "attack" \| "spam" \| "copyright" \| "child_safety" \| "other"` | Yes | Why the report is made. | | `url` | `string \| null` | No | The sandbox address or share link the report is about. | | `address` | `string \| null` | No | An IP address the abuse came from. | | `seen_at` | `string \| null` | No | When it was seen. | | `description` | `string` | Yes | What happened. Never the material itself. | | `reporter` | `AbuseReporter \| null` | No | | | `copyright` | `CopyrightNotice \| null` | No | | ## Answer [#answer] **201.** The report is kept, and on call has been told. ```json title="201" { "id": "abr_3ahrz6dmv29gqy5ckt18fp", "category": "phishing", "received_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `category` | `"phishing" \| "malware" \| "attack" \| "spam" \| "copyright" \| "child_safety" \| "other"` | Yes | Why the report is made. | | `received_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------------- | | TypeScript | `pod.reportAbuse({ category, url, description, … })` | | Python | `pod.report_abuse(…)` | | mpod | `mpod abuse-reports create ` | # Add an SSH public key to your account (https://docs.mapier.ai/pod/api/account/add-ssh-key) > Adds one OpenSSH public key line, as `~/.ssh/id_ed25519.pub` holds it. **POST** `/v1/ssh-keys` Adds one OpenSSH public key line, as `~/.ssh/id_ed25519.pub` holds it. Pod takes Ed25519, ECDSA, their hardware (`sk-`) forms and RSA of at least 2048 bits. A key is unique across Pod: one that is already added, by anyone, is `conflict`, because the front door finds the person by it. A person holds at most 50 keys (`conflict` past it). Like making an API key, it takes a signed-in person with a fresh second factor. The key reaches the cells on each organization's signed `ssh_keys` list within 60 seconds. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/ssh-keys" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"public_key":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | ---------------- | -------- | ----------------------------------------------------------------------------------- | | `public_key` | `string` | Yes | One OpenSSH public key line, comment included or not. | | `name` | `string` | No | Such as the machine the key lives on. The key's comment when absent, else its type. | | `expires_at` | `string \| null` | No | | ## Answer [#answer] **201.** The key. ```json title="201" { "id": "ssk_3ahrz6dmv29gqy5ckt18fp", "name": "example", "type": "ssh-ed25519", "fingerprint": "example", "public_key": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "removed_at": null } ``` | Field | Type | Always | What it is | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `type` | `"ssh-ed25519" \| "ecdsa-sha2-nistp256" \| "ecdsa-sha2-nistp384" \| "ecdsa-sha2-nistp521" \| "sk-ssh-ed25519@openssh.com" \| "sk-ecdsa-sha2-nistp256@openssh.com" \| "ssh-rsa"` | Yes | | | `fingerprint` | `string` | Yes | OpenSSH's SHA-256 fingerprint, as `ssh-keygen -lf` prints it. | | `public_key` | `string` | Yes | The key's type and base64 body, without its comment. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string \| null` | Yes | | | `removed_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `pod.sshKeys.add(publicKey)` | | Python | `pod.ssh_keys.add(public_key)` | | mpod | `mpod ssh-keys add ` | # Make an API key (https://docs.mapier.ai/pod/api/account/create-key) > Only a signed-in person with a fresh second factor can make a key; an API key answers `person_required`. **POST** `/v1/keys` Only a signed-in person with a fresh second factor can make a key; an API key answers `person_required`. The secret is answered once and stored only as a SHA-256 hash. A closed organization (`closeOrganisation`) makes no keys: `conflict` until it is reopened. An unknown or inaccessible project answers `not_found`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/keys" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"project":"prj_3ahrz6dmv29gqy5ckt18fp","name":"example","mode":"test","scopes":["sandboxes:read"]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------- | | `project` | `string` | Yes | | | `name` | `string` | Yes | | | `mode` | `"test" \| "live"` | Yes | | | `scopes` | `"sandboxes:read" \| "sandboxes:write" \| "sandboxes:exec" \| "files:read" \| "files:write" \| "snapshots:write" \| "usage:read" \| "keys:write" \| "projects:write" \| "members:read" \| "end_users:read" \| "end_users:write" \| "screen:read" \| "screen:write" \| "webhooks:read" \| "webhooks:write" \| "permissions:read" \| "permissions:write" \| "permissions:records" \| "ci:read" \| "ci:write" \| "network:read" \| "network:write"[]` | Yes | | | `expires_at` | `string \| null` | No | | ## Answer [#answer] **201.** The key and its secret, shown this once. ```json title="201" { "key": { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null }, "secret": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ``` | Field | Type | Always | What it is | | -------- | -------- | ------ | ------------------------------------------------- | | `key` | `ApiKey` | Yes | | | `secret` | `string` | Yes | Shown once. Stored by Pod only as a SHA-256 hash. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------ | | TypeScript | `pod.keys.create({ … })` | | Python | `pod.keys.create(…)` | | mpod | `mpod api-keys create` | # Make a project (https://docs.mapier.ai/pod/api/account/create-project) > A closed organization (`closeOrganisation`) makes no projects; `conflict` until it is reopened. **POST** `/v1/projects` A closed organization (`closeOrganisation`) makes no projects; `conflict` until it is reopened. A key with the `projects:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/projects" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------- | --------- | -------- | --------------------------- | | `name` | `string` | Yes | | | `idle_s` | `integer` | No | Default `900`. At least 60. | ## Answer [#answer] **201.** The project. ```json title="201" { "id": "prj_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "idle_s": 60, "created_at": "2026-11-23T12:00:00.000Z", "cell_endpoint": "https://app.example.com" } ``` | Field | Type | Always | What it is | | --------------- | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `id` | `string` | Yes | | | `organisation` | `string` | Yes | | | `name` | `string` | Yes | | | `idle_s` | `integer` | Yes | The default idle time of the project's sandboxes. At least 60. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `cell_endpoint` | `string` | No | Present only when the project is bound to a cell in the customer's own cloud account: the cell's endpoint, where its sandbox calls go. Pod's front door answers them `in_other_cell`. The dashboard's page fetches the project's sandboxes and screens from it in the browser (`getCell`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `pod.projects.create({ name })` | | Python | `pod.projects.create(name=…)` | | mpod | `mpod projects create ` | # Make a key for one sandbox, to use from inside it (https://docs.mapier.ai/pod/api/account/create-sandbox-key) > A sandbox key (class `sandbox`) lets an agent in the sandbox manage its own sandbox: read and write its files, run commands, sleep it, fork it to make children it can reach, open its ports. **POST** `/v1/sandboxes/{sandbox_id}/keys` A sandbox key (class `sandbox`) lets an agent in the sandbox manage its own sandbox: read and write its files, run commands, sleep it, fork it to make children it can reach, open its ports. Pass it to the sandbox in the environment of the commands it runs, as `POD_SANDBOX_KEY` (or `POD_API_KEY`), where the SDKs and `mpod` find it; environment values are never logged or stored. It holds at most its maker's scopes (a key's own, or the person's role's), and only scopes on a sandbox: `sandboxes:*`, `files:*`, `snapshots:write`. It is accepted only from the sandbox's own slot, reaches only that sandbox and its children, and is refused within 60 seconds of being revoked. It lives `ttl_s`: 60 seconds to 30 days, a day by default. It is revoked when the sandbox is deleted, when its maker's key is revoked and when its maker leaves the organization. A sandbox holds at most 20 live keys (`conflict` past it). The secret is answered once and stored only as a SHA-256 hash. A repeat with the same `Idempotency-Key` answers `conflict` and never the secret again. A key with the `keys:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/keys" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"scopes":["sandboxes:read"]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- | | `scopes` | `"sandboxes:read" \| "sandboxes:write" \| "sandboxes:exec" \| "files:read" \| "files:write" \| "snapshots:write" \| "usage:read" \| "keys:write" \| "projects:write" \| "members:read" \| "end_users:read" \| "end_users:write" \| "screen:read" \| "screen:write" \| "webhooks:read" \| "webhooks:write" \| "permissions:read" \| "permissions:write" \| "permissions:records" \| "ci:read" \| "ci:write" \| "network:read" \| "network:write"[]` | Yes | A subset of the maker's scopes, all on a sandbox (`sandboxes:*`, `files:*`, `snapshots:write`). | | `name` | `string` | No | `sandbox {id}` when absent. | | `ttl_s` | `integer` | No | How long the key lives, 60 seconds to 30 days. Default `86400`. From 60 to 2592000. | ## Answer [#answer] **201.** The key and its secret, shown this once. ```json title="201" { "key": { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null }, "secret": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ``` | Field | Type | Always | What it is | | -------- | -------- | ------ | ------------------------------------------------- | | `key` | `ApiKey` | Yes | | | `secret` | `string` | Yes | Shown once. Stored by Pod only as a SHA-256 hash. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------------- | | TypeScript | `pod.sandboxKeys.create(sandboxId, { scopes })` | | Python | `pod.sandbox_keys.create(sandbox_id, scopes=…)` | | mpod | `mpod sandboxes keys create ` | # Connect a service to a project (https://docs.mapier.ai/pod/api/account/create-service-grant) > Grants a connected service, such as Pod CI once GitHub is connected to the project, a key for this one project. **POST** `/v1/service-grants` Grants a connected service, such as Pod CI once GitHub is connected to the project, a key for this one project. The key is of class `service_grant`, holds only the scopes the service needs (Pod's list of connected services, not the caller's choice) and carries the service's billing mark: sandboxes it creates are billed through that service's own usage events, never at sandbox rates. Only an owner of the organization, signed in with a fresh second factor, can grant; an API key answers `person_required`. A project holds one grant per service and mode that is not revoked; another answers `conflict`. The key's secret goes to the service, never to the owner (`handover: service`): Pod encrypts it to the service's own public key, keeps only that encrypted copy and the secret's SHA-256 hash, and answers `secret: null`. The service collects the encrypted copy over its own authenticated channel to Pod, opens it with its private key and acknowledges it, and Pod then forgets the copy; neither the browser, an operator nor Pod can read the secret. A copy the service has not collected within 7 days is forgotten, and so is the copy of a revoked grant: grant again. In a development cell with no key configured for the service, the secret is shown this once instead (`handover: shown_once`); staging and production never do that and answer `unavailable` until the service's key is set. A repeat with the same `Idempotency-Key` answers `conflict` and never the secret again. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/service-grants" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"project":"prj_3ahrz6dmv29gqy5ckt18fp","service":"pod-ci"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | ------------------ | -------- | ------------------------------------------------------------------------------------ | | `project` | `string` | Yes | | | `service` | `"pod-ci"` | Yes | A service a project can be connected to. Its grant's billing mark has the same name. | | `mode` | `"test" \| "live"` | No | The grant key's mode; `live` when left out. | ## Answer [#answer] **201.** The grant and its key; the secret went to the service (`handover`). ```json title="201" { "grant": { "id": "sgr_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "service": "pod-ci", "mode": "test", "key": "key_3ahrz6dmv29gqy5ckt18fp", "billing_mark": "example", "scopes": ["sandboxes:read"], "granted_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "revoked_at": null }, "key": { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null }, "secret": null, "handover": "service" } ``` | Field | Type | Always | What it is | | ---------- | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `grant` | `ServiceGrant` | Yes | A connected service's key for one project. | | `key` | `ApiKey` | Yes | | | `secret` | `string \| null` | Yes | `null` when the secret was encrypted for the service (`handover: service`); shown once only with `handover: shown_once`, in a development cell. | | `handover` | `"service" \| "shown_once"` | Yes | How the grant's secret reached its service. `service`: encrypted to the service's own public key and collected by the service, so no person sees it. `shown_once`: answered once in `secret`, only in a development cell with no key configured for the service. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`unavailable`](https://docs.mapier.ai/pod/api/errors#unavailable), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `pod.serviceGrants.create({ … })` | | Python | `pod.service_grants.create(…)` | | mpod | `mpod service-grants create` | # Delete a project (https://docs.mapier.ai/pod/api/account/delete-project) > Only a signed-in person with a fresh second factor deletes a project, and only one whose role makes projects (it reaches every project); an API key answers `person_required`. **DELETE** `/v1/projects/{project_id}` Only a signed-in person with a fresh second factor deletes a project, and only one whose role makes projects (it reaches every project); an API key answers `person_required`. Every key and service grant of the project is revoked in the same change and refused everywhere within 60 seconds, and the project no longer answers. Its sandboxes are deleted by the cell in the background. A repeat answers `not_found`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/projects/prj_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `project_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The project, deleted, and how many keys and grants went with it. ```json title="200" { "project": { "id": "prj_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "idle_s": 60, "created_at": "2026-11-23T12:00:00.000Z", "cell_endpoint": "https://app.example.com" }, "deleted_at": "2026-11-23T12:00:00.000Z", "keys_revoked": 0, "grants_revoked": 0 } ``` | Field | Type | Always | What it is | | ---------------- | --------- | ------ | -------------------------------------------------------------------------- | | `project` | `Project` | Yes | | | `deleted_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `keys_revoked` | `integer` | Yes | At least 0. | | `grants_revoked` | `integer` | Yes | At least 0. | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `pod.projects.delete(id)` | | Python | `pod.projects.delete(id)` | | mpod | `mpod projects delete ` | # Find which cell holds the project's sandboxes (https://docs.mapier.ai/pod/api/account/get-cell) > Where a client sends the project's sandbox calls. **GET** `/v1/cell` Where a client sends the project's sandbox calls. A project bound to a cell in a customer's own cloud account answers that cell's endpoint: Pod's front door serves the project's account calls but answers its sandbox calls (`Sandboxes`, `Commands`, `Files`, `Snapshots`, `Operations`, `Screens` and `Ports`) with `in_other_cell` and never forwards them. A client asks once, on its first such call, and pins the answer; the SDKs and `mpod` do. The endpoint is read from the project's settings, which the account service keeps, not from an error's answer. Any key of the project may ask, whatever scopes it holds, and answers for its own project; a person names the project in `project` and needs a role that reaches it. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/cell" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | -------- | -------- | ------------------------------------------------------------------- | | `project` | query | `string` | No | A person's project. A key answers for its own and may leave it out. | ## Answer [#answer] **200.** The project's cell. ```json title="200" { "project": "prj_3ahrz6dmv29gqy5ckt18fp", "cell_endpoint": null } ``` | Field | Type | Always | What it is | | --------------- | ---------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- | | `project` | `string` | Yes | | | `cell_endpoint` | `string \| null` | Yes | The endpoint of the project's customer cell, where its sandbox calls go from now on; `null` when its sandboxes are in Pod's own cells. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ------ | ----------- | | mpod | `mpod cell` | # Get a project (https://docs.mapier.ai/pod/api/account/get-project) > A key reads its own project with `projects:write`; a person reads a project their role reaches with `members:read`. **GET** `/v1/projects/{project_id}` A key reads its own project with `projects:write`; a person reads a project their role reaches with `members:read`. A deleted project, or one the caller does not reach, is `not_found`. A key with the `projects:write` scope. A signed-in person needs `members:read` in their role. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/projects/prj_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `project_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The project. ```json title="200" { "id": "prj_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "idle_s": 60, "created_at": "2026-11-23T12:00:00.000Z", "cell_endpoint": "https://app.example.com" } ``` | Field | Type | Always | What it is | | --------------- | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `id` | `string` | Yes | | | `organisation` | `string` | Yes | | | `name` | `string` | Yes | | | `idle_s` | `integer` | Yes | The default idle time of the project's sandboxes. At least 60. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `cell_endpoint` | `string` | No | Present only when the project is bound to a cell in the customer's own cloud account: the cell's endpoint, where its sandbox calls go. Pod's front door answers them `in_other_cell`. The dashboard's page fetches the project's sandboxes and screens from it in the browser (`getCell`). | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------- | | TypeScript | `pod.projects.get(id)` | | Python | `pod.projects.get(id)` | | mpod | `mpod projects get ` | # List API keys (https://docs.mapier.ai/pod/api/account/list-keys) > Never answers a secret; only its last four characters. **GET** `/v1/keys` Never answers a secret; only its last four characters. An API key lists only its own project and mode. A signed-in person lists both modes in the projects they can see. A key with the `keys:write` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/keys" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | --------- | -------- | --------------------------------------------------------- | | `project` | query | `string` | No | | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of keys, newest first. ```json title="200" { "data": [ { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `ApiKey[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------- | | TypeScript | `pod.keys.list()` | | Python | `pod.keys.list()` | | mpod | `mpod api-keys list` | # List projects (https://docs.mapier.ai/pod/api/account/list-projects) > A key needs `projects:write` and lists its own project. **GET** `/v1/projects` A key needs `projects:write` and lists its own project. A person's role needs only `members:read`, which every role holds, and lists the projects the role reaches, so a viewer can find their projects. A key with the `projects:write` scope. A signed-in person needs `members:read` in their role. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/projects" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ----- | --------- | -------- | --------------------------------------------------------- | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of projects, newest first. ```json title="200" { "data": [ { "id": "prj_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "idle_s": 60, "created_at": "2026-11-23T12:00:00.000Z", "cell_endpoint": "https://app.example.com" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Project[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------- | | TypeScript | `pod.projects.list()` | | Python | `pod.projects.list()` | | mpod | `mpod projects list` | # List a sandbox's keys (https://docs.mapier.ai/pod/api/account/list-sandbox-keys) > The keys made for this sandbox, revoked and expired ones included, newest first. **GET** `/v1/sandboxes/{sandbox_id}/keys` The keys made for this sandbox, revoked and expired ones included, newest first. Never a secret. A key with the `keys:write` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/keys" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ----- | --------- | -------- | --------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of the sandbox's keys, newest first. ```json title="200" { "data": [ { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `ApiKey[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------ | | TypeScript | `pod.sandboxKeys.list(sandboxId)` | | Python | `pod.sandbox_keys.list(sandbox_id)` | | mpod | `mpod sandboxes keys list ` | # List the scope presets for a new key (https://docs.mapier.ai/pod/api/account/list-scope-presets) > Ready-made scope sets for a new key: `read_only`, `full_sandbox`, `ci` and `admin`. **GET** `/v1/scope-presets` Ready-made scope sets for a new key: `read_only`, `full_sandbox`, `ci` and `admin`. A preset only fills in `scopes` on `createKey`; the key keeps its scopes, never the preset's name. A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/scope-presets" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Answer [#answer] **200.** The presets. ```json title="200" { "data": [ { "name": "read_only", "title": "example", "description": "example", "scopes": ["sandboxes:read"] } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | --------------- | ------ | ---------- | | `data` | `ScopePreset[]` | Yes | | | `next_cursor` | `null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------- | | TypeScript | `pod.keys.presets()` | | Python | `pod.keys.presets()` | | mpod | `mpod scope-presets list` | # List service grants (https://docs.mapier.ai/pod/api/account/list-service-grants) > The connected services of the organization's projects, revoked ones included, newest first. **GET** `/v1/service-grants` The connected services of the organization's projects, revoked ones included, newest first. A key sees only its own project's grants of its own mode. Never answers a secret. A key with the `keys:write` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/service-grants" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | --------- | -------- | --------------------------------------------------------- | | `project` | query | `string` | No | | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of service grants, newest first. ```json title="200" { "data": [ { "id": "sgr_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "service": "pod-ci", "mode": "test", "key": "key_3ahrz6dmv29gqy5ckt18fp", "billing_mark": "example", "scopes": ["sandboxes:read"], "granted_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "revoked_at": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `ServiceGrant[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------- | | TypeScript | `pod.serviceGrants.list()` | | Python | `pod.service_grants.list()` | | mpod | `mpod service-grants list` | # List your SSH keys (https://docs.mapier.ai/pod/api/account/list-ssh-keys) > The SSH public keys the signed-in person added to their account, newest first, removed ones left out. **GET** `/v1/ssh-keys` The SSH public keys the signed-in person added to their account, newest first, removed ones left out. An SSH key is the person's, not an organization's or a project's: it signs in to any sandbox the person's role reaches with `sandboxes:exec`, in every organization they belong to (`getSandboxSsh`). People only; an API key answers `person_required`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/ssh-keys" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ----- | --------- | -------- | --------------------------------------------------------- | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of the person's SSH keys, newest first. ```json title="200" { "data": [ { "id": "ssk_3ahrz6dmv29gqy5ckt18fp", "name": "example", "type": "ssh-ed25519", "fingerprint": "example", "public_key": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "removed_at": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `SshKey[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------- | | TypeScript | `pod.sshKeys.list()` | | Python | `pod.ssh_keys.list()` | | mpod | `mpod ssh-keys list` | # Remove an SSH key from your account (https://docs.mapier.ai/pod/api/account/remove-ssh-key) > The key is refused everywhere within 60 seconds, and an SSH connection it opened ends at the front door's next check, 30 seconds later at most. **DELETE** `/v1/ssh-keys/{ssh_key_id}` The key is refused everywhere within 60 seconds, and an SSH connection it opened ends at the front door's next check, 30 seconds later at most. A repeat is a no-op. Removing needs no fresh second factor, so a lost key is removed at once. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/ssh-keys/ssk_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `ssh_key_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The key, with `removed_at` set. ```json title="200" { "id": "ssk_3ahrz6dmv29gqy5ckt18fp", "name": "example", "type": "ssh-ed25519", "fingerprint": "example", "public_key": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "removed_at": null } ``` | Field | Type | Always | What it is | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `type` | `"ssh-ed25519" \| "ecdsa-sha2-nistp256" \| "ecdsa-sha2-nistp384" \| "ecdsa-sha2-nistp521" \| "sk-ssh-ed25519@openssh.com" \| "sk-ecdsa-sha2-nistp256@openssh.com" \| "ssh-rsa"` | Yes | | | `fingerprint` | `string` | Yes | OpenSSH's SHA-256 fingerprint, as `ssh-keygen -lf` prints it. | | `public_key` | `string` | Yes | The key's type and base64 body, without its comment. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string \| null` | Yes | | | `removed_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `pod.sshKeys.remove(id)` | | Python | `pod.ssh_keys.remove(id)` | | mpod | `mpod ssh-keys remove ` | # Revoke an API key (https://docs.mapier.ai/pod/api/account/revoke-key) > The key is refused everywhere within 60 seconds. **DELETE** `/v1/keys/{key_id}` The key is refused everywhere within 60 seconds. A repeat is a no-op. A key with the `keys:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/keys/key_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `key_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The key, with `revoked_at` set. ```json title="200" { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null } ``` | Field | Type | Always | What it is | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `project` | `string` | Yes | | | `mode` | `"test" \| "live"` | Yes | | | `class` | `"person" \| "service_grant" \| "sandbox"` | Yes | `person`: made by a person. `service_grant`: a connected service's. `sandbox`: made for one sandbox, to use from inside it. | | `scopes` | `"sandboxes:read" \| "sandboxes:write" \| "sandboxes:exec" \| "files:read" \| "files:write" \| "snapshots:write" \| "usage:read" \| "keys:write" \| "projects:write" \| "members:read" \| "end_users:read" \| "end_users:write" \| "screen:read" \| "screen:write" \| "webhooks:read" \| "webhooks:write" \| "permissions:read" \| "permissions:write" \| "permissions:records" \| "ci:read" \| "ci:write" \| "network:read" \| "network:write"[]` | Yes | | | `last_four` | `string` | Yes | | | `created_by` | `string` | Yes | The identity account that made the key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string \| null` | Yes | | | `revoked_at` | `string \| null` | Yes | | | `service` | `string \| null` | Yes | For a service grant, the service, such as `pod-ci`. | | `billing_mark` | `string \| null` | Yes | | | `parent_sandbox` | `string \| null` | Yes | For a sandbox key, its sandbox; it is accepted only from there. | | `parent_scopes` | `"sandboxes:read" \| "sandboxes:write" \| "sandboxes:exec" \| "files:read" \| "files:write" \| "snapshots:write" \| "usage:read" \| "keys:write" \| "projects:write" \| "members:read" \| "end_users:read" \| "end_users:write" \| "screen:read" \| "screen:write" \| "webhooks:read" \| "webhooks:write" \| "permissions:read" \| "permissions:write" \| "permissions:records" \| "ci:read" \| "ci:write" \| "network:read" \| "network:write"[] \| null` | Yes | For a sandbox key, the scopes its maker held when it was made; it holds no more. | | `last_used_at` | `string \| null` | Yes | When the key was last used, to the minute; null if never. Calls the gateway answered reach it in batches, so it can trail by a few minutes. | | `rotated_at` | `string \| null` | Yes | When the key last got a new secret (`rotateKey`); null if never. | | `previous_secret_until` | `string \| null` | Yes | After a rotation, when the old secret stops working; null when it already has. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------- | | TypeScript | `pod.keys.revoke(id)` | | Python | `pod.keys.revoke(id)` | | mpod | `mpod api-keys revoke ` | # Revoke a sandbox's key (https://docs.mapier.ai/pod/api/account/revoke-sandbox-key) > The key is refused everywhere within 60 seconds, and an exec stream it opened ends within 5 seconds of the gateway learning it. **DELETE** `/v1/sandboxes/{sandbox_id}/keys/{key_id}` The key is refused everywhere within 60 seconds, and an exec stream it opened ends within 5 seconds of the gateway learning it. A repeat is a no-op. `revokeKey` revokes it too. A key with the `keys:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/keys/key_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `key_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The key, with `revoked_at` set. ```json title="200" { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null } ``` | Field | Type | Always | What it is | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `project` | `string` | Yes | | | `mode` | `"test" \| "live"` | Yes | | | `class` | `"person" \| "service_grant" \| "sandbox"` | Yes | `person`: made by a person. `service_grant`: a connected service's. `sandbox`: made for one sandbox, to use from inside it. | | `scopes` | `"sandboxes:read" \| "sandboxes:write" \| "sandboxes:exec" \| "files:read" \| "files:write" \| "snapshots:write" \| "usage:read" \| "keys:write" \| "projects:write" \| "members:read" \| "end_users:read" \| "end_users:write" \| "screen:read" \| "screen:write" \| "webhooks:read" \| "webhooks:write" \| "permissions:read" \| "permissions:write" \| "permissions:records" \| "ci:read" \| "ci:write" \| "network:read" \| "network:write"[]` | Yes | | | `last_four` | `string` | Yes | | | `created_by` | `string` | Yes | The identity account that made the key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string \| null` | Yes | | | `revoked_at` | `string \| null` | Yes | | | `service` | `string \| null` | Yes | For a service grant, the service, such as `pod-ci`. | | `billing_mark` | `string \| null` | Yes | | | `parent_sandbox` | `string \| null` | Yes | For a sandbox key, its sandbox; it is accepted only from there. | | `parent_scopes` | `"sandboxes:read" \| "sandboxes:write" \| "sandboxes:exec" \| "files:read" \| "files:write" \| "snapshots:write" \| "usage:read" \| "keys:write" \| "projects:write" \| "members:read" \| "end_users:read" \| "end_users:write" \| "screen:read" \| "screen:write" \| "webhooks:read" \| "webhooks:write" \| "permissions:read" \| "permissions:write" \| "permissions:records" \| "ci:read" \| "ci:write" \| "network:read" \| "network:write"[] \| null` | Yes | For a sandbox key, the scopes its maker held when it was made; it holds no more. | | `last_used_at` | `string \| null` | Yes | When the key was last used, to the minute; null if never. Calls the gateway answered reach it in batches, so it can trail by a few minutes. | | `rotated_at` | `string \| null` | Yes | When the key last got a new secret (`rotateKey`); null if never. | | `previous_secret_until` | `string \| null` | Yes | After a rotation, when the old secret stops working; null when it already has. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------- | | TypeScript | `pod.sandboxKeys.revoke(sandboxId, keyId)` | | Python | `pod.sandbox_keys.revoke(sandbox_id, key_id)` | | mpod | `mpod sandboxes keys revoke ` | # Revoke a service grant (https://docs.mapier.ai/pod/api/account/revoke-service-grant) > Disconnects the service from the project: the grant and its key are revoked together, and the key is refused everywhere within 60 seconds. **DELETE** `/v1/service-grants/{grant_id}` Disconnects the service from the project: the grant and its key are revoked together, and the key is refused everywhere within 60 seconds. Revoking the grant's key through `revokeKey` revokes the grant too. Sandboxes the key made keep their billing mark. A repeat is a no-op. A key with the `keys:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/service-grants/sgr_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `grant_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The grant, with `revoked_at` set. ```json title="200" { "id": "sgr_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "service": "pod-ci", "mode": "test", "key": "key_3ahrz6dmv29gqy5ckt18fp", "billing_mark": "example", "scopes": ["sandboxes:read"], "granted_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "revoked_at": null } ``` | Field | Type | Always | What it is | | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------ | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `service` | `"pod-ci"` | Yes | A service a project can be connected to. Its grant's billing mark has the same name. | | `mode` | `"test" \| "live"` | Yes | | | `key` | `string` | Yes | | | `billing_mark` | `string` | Yes | What sandboxes the key creates carry; their usage bills through the service. | | `scopes` | `"sandboxes:read" \| "sandboxes:write" \| "sandboxes:exec" \| "files:read" \| "files:write" \| "snapshots:write" \| "usage:read" \| "keys:write" \| "projects:write" \| "members:read" \| "end_users:read" \| "end_users:write" \| "screen:read" \| "screen:write" \| "webhooks:read" \| "webhooks:write" \| "permissions:read" \| "permissions:write" \| "permissions:records" \| "ci:read" \| "ci:write" \| "network:read" \| "network:write"[]` | Yes | | | `granted_by` | `string` | Yes | The identity account of the owner who granted it. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `revoked_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------ | | TypeScript | `pod.serviceGrants.revoke(id)` | | Python | `pod.service_grants.revoke(id)` | | mpod | `mpod service-grants revoke ` | # Give a key a new secret (https://docs.mapier.ai/pod/api/account/rotate-key) > Keeps the key's id, project, scopes and expiry and gives it a new secret, answered once and stored only as a SHA-256 hash. **POST** `/v1/keys/{key_id}/rotate` Keeps the key's id, project, scopes and expiry and gives it a new secret, answered once and stored only as a SHA-256 hash. The old secret keeps working for `overlap_s` seconds (an hour by default, 0 ends it at once), so a fleet moves to the new one without a gap; every gateway refuses it after that. Rotating again ends any overlap still running. Only a signed-in person with a fresh second factor rotates a key, as only a person makes one; an API key answers `person_required`. The person's role must hold `keys:write`, and a member rotates only keys they made. A service grant's key is rotated by connecting the service again, and a revoked or expired key is `conflict`. A repeat with the same `Idempotency-Key` answers `conflict` and never the secret again. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/keys/key_3ahrz6dmv29gqy5ckt18fp/rotate" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"overlap_s":3600}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `key_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ----------- | --------- | -------- | ------------------------------------------------------------------------------------ | | `overlap_s` | `integer` | No | How long the old secret keeps working, in seconds. Default `3600`. From 0 to 604800. | ## Answer [#answer] **200.** The key and its new secret, shown this once. ```json title="200" { "key": { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null }, "secret": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ``` | Field | Type | Always | What it is | | -------- | -------- | ------ | ------------------------------------------------- | | `key` | `ApiKey` | Yes | | | `secret` | `string` | Yes | Shown once. Stored by Pod only as a SHA-256 hash. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------ | | TypeScript | `pod.keys.rotate(id, { overlap_s })` | | Python | `pod.keys.rotate(id, overlap_s=…)` | | mpod | `mpod api-keys rotate ` | # Rename a project or change its default idle time (https://docs.mapier.ai/pod/api/account/update-project) > Changes the name or the default idle time of sandboxes made from now on; sandboxes already made keep theirs. **PATCH** `/v1/projects/{project_id}` Changes the name or the default idle time of sandboxes made from now on; sandboxes already made keep theirs. A key changes its own project; a person changes a project their role reaches. A key with the `projects:write` scope. ## Request [#request] ```bash curl -X PATCH "https://api.pod.mapier.ai/v1/projects/prj_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `project_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------- | --------- | -------- | ------------ | | `name` | `string` | No | | | `idle_s` | `integer` | No | At least 60. | ## Answer [#answer] **200.** The project as changed. ```json title="200" { "id": "prj_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "idle_s": 60, "created_at": "2026-11-23T12:00:00.000Z", "cell_endpoint": "https://app.example.com" } ``` | Field | Type | Always | What it is | | --------------- | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `id` | `string` | Yes | | | `organisation` | `string` | Yes | | | `name` | `string` | Yes | | | `idle_s` | `integer` | Yes | The default idle time of the project's sandboxes. At least 60. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `cell_endpoint` | `string` | No | Present only when the project is bound to a cell in the customer's own cloud account: the cell's endpoint, where its sandbox calls go. Pod's front door answers them `in_other_cell`. The dashboard's page fetches the project's sandboxes and screens from it in the browser (`getCell`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `pod.projects.update(id, { … })` | | Python | `pod.projects.update(id, …)` | | mpod | `mpod projects update ` | # End the paid plan at the end of the month (https://docs.mapier.ai/pod/api/billing/cancel-plan) > Cancels Pro: the organization keeps Pro to the end of the month already paid for, with no refund, and then returns to the free plan and its allowance. **POST** `/v1/billing/cancel` Cancels Pro: the organization keeps Pro to the end of the month already paid for, with no refund, and then returns to the free plan and its allowance. Sandboxes are never deleted by a cancel; ones past the free plan's limits stay asleep until they fit. `changePlan` to Pro before the month ends undoes it. On the free plan there is nothing to cancel (`conflict`); closing the account is a separate call. Only a signed-in person whose role may read billing, with a fresh second factor; an API key answers `person_required`. The billing provider not answering is `upstream`. For people only: a signed-in person with a fresh second factor makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/billing/cancel" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The plan now, and the change waiting for the end of the month. ```json title="200" { "plan": "invited", "effective": "now", "effective_at": "2026-11-23T12:00:00.000Z", "pending_change": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------ | ------ | -------------------------------------------------------------------------- | | `plan` | `"invited" \| "free" \| "pro"` | Yes | | | `effective` | `"now" \| "period_end"` | Yes | | | `effective_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `pending_change` | `PendingPlanChange \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`upstream`](https://docs.mapier.ai/pod/api/errors#upstream). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------- | | TypeScript | `pod.billing.cancel()` | | Python | `pod.billing.cancel()` | | mpod | `mpod billing cancel` | # Move the organization to another plan (https://docs.mapier.ai/pod/api/billing/change-plan) > Moves a self-serve organization between the free plan and Pro. **PUT** `/v1/billing/plan` Moves a self-serve organization between the free plan and Pro. Moving up starts at once: the larger limits and sizes are there now and the month is prorated. Moving down takes effect at the start of next month, with no refund for the rest of this one; until then `pending_change` names it, and moving up again cancels it. Pro needs a card on file (`conflict`). An invited organization's plan is staff's (`conflict`). The same plan again is a no-op. A higher plan is agreeing to pay more, so only a signed-in person whose role may read billing can call it, with a fresh second factor; an API key answers `person_required`. With billing `off` it is `conflict`; the billing provider not answering is `upstream`. For people only: a signed-in person with a fresh second factor makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/billing/plan" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"plan":"free"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------ | ----------------- | -------- | ---------- | | `plan` | `"free" \| "pro"` | Yes | | ## Answer [#answer] **200.** The plan now, and when the one asked for starts. ```json title="200" { "plan": "invited", "effective": "now", "effective_at": "2026-11-23T12:00:00.000Z", "pending_change": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------ | ------ | -------------------------------------------------------------------------- | | `plan` | `"invited" \| "free" \| "pro"` | Yes | | | `effective` | `"now" \| "period_end"` | Yes | | | `effective_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `pending_change` | `PendingPlanChange \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`upstream`](https://docs.mapier.ai/pod/api/errors#upstream). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `pod.billing.changePlan(plan)` | | Python | `pod.billing.change_plan(plan)` | | mpod | `mpod billing plan ` | # Read the organization's billing (https://docs.mapier.ai/pod/api/billing/get-billing) > The organization's plan, standing, card and how many invoices are overdue. **GET** `/v1/billing` The organization's plan, standing, card and how many invoices are overdue. Billing runs on a billing provider; this call reads what the account service keeps in step with it, so it answers while the billing provider is unreachable. `mode` says how Pod bills, the same for every organization: `off` (nothing is billed; `setup` is `off` and the card `none`), `test` (the billing provider's test mode) or `live`. Only a signed-in person whose role may read billing can call it; an API key answers `person_required`. A person in several organizations names one with the `Pod-Organisation` header. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/billing" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Answer [#answer] **200.** The organization's billing. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "mode": "off", "plan": "invited", "standing": "good", "setup": "off", "card": { "state": "none", "brand": null, "last_four": null, "exp_month": null, "exp_year": null }, "overdue_invoices": 0, "allowance": null, "suggested_plan": null, "pending_change": null } ``` | Field | Type | Always | What it is | | ------------------ | ------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `organisation` | `string` | Yes | | | `mode` | `"off" \| "test" \| "live"` | Yes | How Pod bills, the same for every organization. | | `plan` | `"invited" \| "free" \| "pro"` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `setup` | `"off" \| "pending" \| "ready" \| "failed"` | Yes | Whether the billing provider holds the organization's customer and subscription. | | `card` | `BillingCard` | Yes | | | `overdue_invoices` | `integer` | Yes | Invoices the billing provider reported overdue and not yet paid or voided. At least 0. | | `allowance` | `BillingAllowance \| null` | Yes | The free plan's allowance this month; null on any other plan. | | `suggested_plan` | `PlanSuggestion \| null` | Yes | A plan that fits the last 30 days better; null when none does. | | `pending_change` | `PendingPlanChange \| null` | Yes | A move down or a cancel waiting for the end of the month; null when none waits. | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------- | | TypeScript | `pod.billing.get()` | | Python | `pod.billing.get()` | | mpod | `mpod billing get` | # Read the organization's wallet (https://docs.mapier.ai/pod/api/billing/get-wallet) > The prepaid balance the billing provider keeps for the organization: credits paid for and given, drawn from first by every invoice. **GET** `/v1/billing/wallet` The prepaid balance the billing provider keeps for the organization: credits paid for and given, drawn from first by every invoice. `state: none` until a first top-up. Read from the billing provider at the time of the call; the billing provider not answering is `upstream`. With billing `off`, a wallet in state `none`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/billing/wallet" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Answer [#answer] **200.** The wallet. ```json title="200" { "state": "none", "currency": "example", "balance_cents": 1, "ongoing_balance_cents": 1, "paid_credits_cents": 0, "granted_credits_cents": 0 } ``` | Field | Type | Always | What it is | | ----------------------- | ------------------------------------ | ------ | ------------------------------------------------------------------------------------------------- | | `state` | `"none" \| "active" \| "terminated"` | Yes | | | `currency` | `string` | Yes | ISO 4217. | | `balance_cents` | `integer` | Yes | | | `ongoing_balance_cents` | `integer` | Yes | The balance once the month's usage so far is drawn from it, as the billing provider estimates it. | | `paid_credits_cents` | `integer` | Yes | At least 0. | | `granted_credits_cents` | `integer` | Yes | At least 0. | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`upstream`](https://docs.mapier.ai/pod/api/errors#upstream). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------- | | TypeScript | `pod.billing.wallet()` | | Python | `pod.billing.wallet()` | | mpod | `mpod billing wallet` | # List invoices (https://docs.mapier.ai/pod/api/billing/list-invoices) > The organization's invoices, newest first, read from the billing provider at the time of the call. **GET** `/v1/billing/invoices` The organization's invoices, newest first, read from the billing provider at the time of the call. Amounts are the billing provider's, in the currency's minor unit; usage itself stays seconds and bytes (`GET /v1/usage`). With billing `off`, or before the billing provider has the organization's customer, the list is empty. The billing provider not answering is `upstream`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/billing/invoices" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ----- | --------- | -------- | --------------------------------------------------------- | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of invoices, newest first. ```json title="200" { "data": [ { "id": "example", "number": "example", "issued_on": "example", "due_on": null, "status": "draft", "payment_status": "pending", "overdue": false, "currency": "example", "total_cents": 1, "file_url": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Invoice[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`upstream`](https://docs.mapier.ai/pod/api/errors#upstream). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------ | | TypeScript | `pod.billing.invoices()` | | Python | `pod.billing.invoices()` | | mpod | `mpod billing invoices` | # Put a card on file (https://docs.mapier.ai/pod/api/billing/start-card-setup) > Answers the address of a page of the billing provider's where the person enters a card. **POST** `/v1/billing/card` Answers the address of a page of the billing provider's where the person enters a card. Pod never sees the card's number; once the billing provider holds it, `GET /v1/billing` shows the card `on_file`. A card on file lifts the free plan's hold on outbound traffic and its one size, and with a checked identity moves a new account to the `verified` trust tier. Each call makes a new page; a page expires after a while, so ask again rather than keeping one. Only a signed-in person whose role may read billing can call it: an agent can ask to spend, only a person pays. With billing `off`, or before the billing provider holds the organization's customer, it is `conflict`. The billing provider not answering is `upstream`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/billing/card" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **201.** The page to send the person to. ```json title="201" { "url": "https://app.example.com", "mode": "off" } ``` | Field | Type | Always | What it is | | ------ | --------------------------- | ------ | ----------------------------------------------- | | `url` | `string` | Yes | The billing provider's page. It expires. | | `mode` | `"off" \| "test" \| "live"` | Yes | How Pod bills, the same for every organization. | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`upstream`](https://docs.mapier.ai/pod/api/errors#upstream). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------- | | TypeScript | `pod.billing.cardSetup()` | | Python | `pod.billing.card_setup()` | | mpod | `mpod billing card` | # Add prepaid credit to the wallet (https://docs.mapier.ai/pod/api/billing/top-up-wallet) > Buys credit: the billing provider adds `amount_cents` of paid credit to the wallet (making the wallet on the first top-up) and charges the card on file for it; the credit is usable once the payment settles (`state`). **POST** `/v1/billing/wallet/top_up` Buys credit: the billing provider adds `amount_cents` of paid credit to the wallet (making the wallet on the first top-up) and charges the card on file for it; the credit is usable once the payment settles (`state`). A card on file is needed (`conflict`). Paying is a person's: only a signed-in person whose role may read billing, with a fresh second factor; an API key answers `person_required`. With billing `off` it is `conflict`; the billing provider not answering is `upstream`. For people only: a signed-in person with a fresh second factor makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/billing/wallet/top_up" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"amount_cents":1500}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------- | -------- | ---------------------------------------------------- | | `amount_cents` | `integer` | Yes | In the currency's minor unit. From 1500 to 10000000. | ## Answer [#answer] **201.** The top-up, pending until the card payment settles. ```json title="201" { "id": "example", "amount_cents": 1, "currency": "example", "state": "pending", "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | -------------- | ------------------------------------ | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | The billing provider's id for the wallet transaction. | | `amount_cents` | `integer` | Yes | At least 1. | | `currency` | `string` | Yes | ISO 4217. | | `state` | `"pending" \| "settled" \| "failed"` | Yes | | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`upstream`](https://docs.mapier.ai/pod/api/errors#upstream). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------- | | TypeScript | `pod.billing.topUp(amountCents)` | | Python | `pod.billing.top_up(amount_cents)` | | mpod | `mpod billing top-up ` | # Make a ticket that lets a browser open a command's stream (https://docs.mapier.ai/pod/api/commands/create-exec-stream-ticket) > Answers a short-lived, single-use ticket for this command's stream (`streamExec`), for a browser that cannot send `Authorization` on a WebSocket. **POST** `/v1/sandboxes/{sandbox_id}/exec/{operation_id}/stream-ticket` Answers a short-lived, single-use ticket for this command's stream (`streamExec`), for a browser that cannot send `Authorization` on a WebSocket. Call it over HTTPS where the key or token lives. The dashboard's page calls it itself, from the browser with the person's token, whenever the sandbox is in a customer cell: it calls the cell's endpoint, which accepts the dashboard's origin, because the dashboard's server cannot reach that cell and never fetches its data, and `api.pod.mapier.ai` answers `in_other_cell` without forwarding. For a sandbox in one of Pod's own cells the dashboard's server may instead call it with the person's token, and a customer's own server with an API key; either hands only the ticket and `stream_url` to its page. The ticket is bound to this stream (the sandbox and the operation), to the key or person that asked, to the organization and project, to `origin`, and to an expiry of at most 60 seconds. It opens the stream once. A person's token may name only Pod's own clients' origins (`forbidden` otherwise); an API key may name any origin of the pattern. If the call itself carries an `Origin` header, as it does from a browser, it must equal `origin` (`forbidden` otherwise). The answer is a secret: it is sent with `Cache-Control: no-store`, never logged and never stored for a replay, so the call takes no `Idempotency-Key`; one sent anyway is ignored and never stored. Pod stores only the ticket's SHA-256 hash. A caller holds at most 20 unused tickets; one more is `rate_limited`, with `retry_after_s` until the oldest of them expires. A key with the `sandboxes:exec` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream-ticket" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"origin":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `operation_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | ## Body [#body] | Field | Type | Required | What it is | | -------- | --------- | -------- | --------------------------------------------------------------------------------------------- | | `origin` | `string` | Yes | The origin of the page that will open the stream. The upgrade's `Origin` must equal it. | | `ttl_s` | `integer` | No | How long the ticket lives. A page should open the stream at once. Default `30`. From 1 to 60. | ## Answer [#answer] **201.** The ticket. ```json title="201" { "ticket": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm", "stream": "exec", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "operation": "op_3ahrz6dmv29gqy5ckt18fpx4b", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "origin": "example", "stream_url": "wss://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream", "expires_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | -------------- | -------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ticket` | `string` | Yes | Single use, for one stream, for at most 60 seconds. Stored by Pod only as a SHA-256 hash. | | `stream` | `"exec" \| "screen"` | Yes | The stream a ticket opens. The screen's has its own ticket, `ScreenStreamTicket`. | | `sandbox` | `string` | Yes | | | `operation` | `string` | Yes | | | `organisation` | `string` | Yes | | | `project` | `string` | Yes | | | `origin` | `string` | Yes | A browser origin as the browser sends it in `Origin` (RFC 6454): scheme, host and port, no path and no default port. `https://`, or `http://` on loopback for development. | | `stream_url` | `string` | Yes | The stream to open, the same address as the operation's `stream_url`. | | `expires_at` | `string` | Yes | After this the ticket opens nothing. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------------------------------ | | TypeScript | `pod.sandboxes.execStreamTicket(id, opId, { origin })` | | Python | `sandbox.exec_stream_ticket(op_id, origin=…)` | | mpod | `mpod sandboxes commands ticket --origin ` | # Get a command's status (https://docs.mapier.ai/pod/api/commands/get-exec) > Get a command's status **GET** `/v1/sandboxes/{sandbox_id}/exec/{operation_id}` A key with the `sandboxes:exec` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `operation_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | ## Answer [#answer] **200.** The exec operation. ```json title="200" { "id": "op_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "running", "detached": false, "tty": false, "exit_code": null, "signal": null, "started_at": "2026-11-23T12:00:00.000Z", "ended_at": null, "stream_url": "wss://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream", "oom_killed": false } ``` | Field | Type | Always | What it is | | ------------ | -------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `state` | `"running" \| "exited" \| "killed" \| "timed_out" \| "failed"` | Yes | | | `detached` | `boolean` | Yes | | | `tty` | `boolean` | Yes | | | `exit_code` | `integer \| null` | Yes | | | `signal` | `"TERM" \| "KILL" \| "INT" \| "HUP" \| null` | Yes | | | `started_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `ended_at` | `string \| null` | Yes | | | `stream_url` | `string` | Yes | The address of the stream, always on the host that answered the call. Clients send their key or a stream ticket to it, so they refuse any other address. | | `oom_killed` | `boolean` | No | The sandbox's out-of-memory killer ended the command: its `state` is `killed` with signal `KILL` (`timed_out` when the out-of-memory killer ended it after its timeout asked it to stop), or, when a shell ran it, `exited` with code 137. Sent only once the command has ended and only when true; a missing field means the out-of-memory killer did not end it. A `KILL` sent through `DELETE` or a timeout is never reported as the out-of-memory killer's. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------------- | | TypeScript | `proc.refresh()` | | Python | `proc.refresh()` | | mpod | `mpod sandboxes commands get ` | # End a command (https://docs.mapier.ai/pod/api/commands/kill-exec) > Sends `signal` to the command's process. **DELETE** `/v1/sandboxes/{sandbox_id}/exec/{operation_id}` Sends `signal` to the command's process. A command that has already ended is a no-op. A key with the `sandboxes:exec` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | ------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `operation_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `signal` | query | `"TERM" \| "KILL" \| "INT" \| "HUP"` | No | | ## Answer [#answer] **200.** The exec operation after the signal was sent. ```json title="200" { "id": "op_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "running", "detached": false, "tty": false, "exit_code": null, "signal": null, "started_at": "2026-11-23T12:00:00.000Z", "ended_at": null, "stream_url": "wss://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream", "oom_killed": false } ``` | Field | Type | Always | What it is | | ------------ | -------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `state` | `"running" \| "exited" \| "killed" \| "timed_out" \| "failed"` | Yes | | | `detached` | `boolean` | Yes | | | `tty` | `boolean` | Yes | | | `exit_code` | `integer \| null` | Yes | | | `signal` | `"TERM" \| "KILL" \| "INT" \| "HUP" \| null` | Yes | | | `started_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `ended_at` | `string \| null` | Yes | | | `stream_url` | `string` | Yes | The address of the stream, always on the host that answered the call. Clients send their key or a stream ticket to it, so they refuse any other address. | | `oom_killed` | `boolean` | No | The sandbox's out-of-memory killer ended the command: its `state` is `killed` with signal `KILL` (`timed_out` when the out-of-memory killer ended it after its timeout asked it to stop), or, when a shell ran it, `exited` with code 137. Sent only once the command has ended and only when true; a missing field means the out-of-memory killer did not end it. A `KILL` sent through `DELETE` or a timeout is never reported as the out-of-memory killer's. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------------- | | TypeScript | `proc.kill(signal)` | | Python | `proc.kill(signal)` | | mpod | `mpod sandboxes commands kill ` | # Run a command in a sandbox (https://docs.mapier.ai/pod/api/commands/start-exec) > Starts a command and answers `202` with the exec operation. **POST** `/v1/sandboxes/{sandbox_id}/exec` Starts a command and answers `202` with the exec operation. Output, input and the exit status travel over the WebSocket at `stream_url` (`GET …/exec/{operation_id}/stream`); see `ExecStreamServerMessage` and `ExecStreamClientMessage`. A detached process keeps running when the stream closes; the sandbox keeps the last 256 KiB of each output stream, which a new stream replays first. On a sleeping sandbox the call wakes it first. On one still `creating` or `waking` it waits until `running` or the call's deadline, then answers `not_ready`. Command input (arguments, environment, standard input, typed text) is never logged or stored, and no answer repeats it. A key with the `sandboxes:exec` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"uname -a"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] Give `argv` or `command`, not both. | Field | Type | Required | What it is | | ----------- | ---------- | -------- | ----------------------------------------------------------------------------- | | `argv` | `string[]` | No | The program and its arguments, run without a shell. | | `command` | `string` | No | A command line, run by `/bin/sh -c`. | | `env` | `Env` | No | Environment variables. Never logged, stored or answered back. | | `cwd` | `string` | No | The working folder. The user's home by default. | | `user` | `string` | No | The user to run as. The sandbox's default user if not given. | | `stdin` | `boolean` | No | Keep standard input open for `stdin` messages on the stream. Default `false`. | | `tty` | `boolean` | No | Run in a terminal. Default `false`. | | `timeout_s` | `integer` | No | 0 means no limit. Default `60`. At least 0. | | `detached` | `boolean` | No | Keep running when the stream closes. Default `false`. | ## Answer [#answer] **202.** The command started. ```json title="202" { "id": "op_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "running", "detached": false, "tty": false, "exit_code": null, "signal": null, "started_at": "2026-11-23T12:00:00.000Z", "ended_at": null, "stream_url": "wss://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream", "oom_killed": false } ``` | Field | Type | Always | What it is | | ------------ | -------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `state` | `"running" \| "exited" \| "killed" \| "timed_out" \| "failed"` | Yes | | | `detached` | `boolean` | Yes | | | `tty` | `boolean` | Yes | | | `exit_code` | `integer \| null` | Yes | | | `signal` | `"TERM" \| "KILL" \| "INT" \| "HUP" \| null` | Yes | | | `started_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `ended_at` | `string \| null` | Yes | | | `stream_url` | `string` | Yes | The address of the stream, always on the host that answered the call. Clients send their key or a stream ticket to it, so they refuse any other address. | | `oom_killed` | `boolean` | No | The sandbox's out-of-memory killer ended the command: its `state` is `killed` with signal `KILL` (`timed_out` when the out-of-memory killer ended it after its timeout asked it to stop), or, when a shell ran it, `exited` with code 137. Sent only once the command has ended and only when true; a missing field means the out-of-memory killer did not end it. A `KILL` sent through `DELETE` or a timeout is never reported as the out-of-memory killer's. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`guest_unresponsive`](https://docs.mapier.ai/pod/api/errors#guest_unresponsive), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------- | | TypeScript | `sandbox.exec(cmd)` | | Python | `sandbox.exec(cmd)` | | mpod | `mpod sandboxes exec -- ` | # Attach to a command's output and input (https://docs.mapier.ai/pod/api/commands/stream-exec) > A WebSocket upgrade (RFC 6455). **GET** `/v1/sandboxes/{sandbox_id}/exec/{operation_id}/stream` A WebSocket upgrade (RFC 6455). Every frame is a text frame holding one JSON message. The server sends `ExecStreamServerMessage`: `stdout` and `stderr` chunks (base64), then one `exit`, then closes with code 1000. On failure it sends one `error` with an error body and closes with 1011. The client sends `ExecStreamClientMessage`: `stdin` chunks (base64) when the command was started with `stdin: true`, `stdin_close`, `resize` for a terminal, and `signal`. Reconnecting replays the kept tail of a detached process, then follows it live. **Two ways in.** A client that can send headers sends its key or token in `Authorization`, as on every call. A browser cannot, so it opens the stream with a ticket from `createExecStreamTicket`: `new WebSocket(stream_url, ["pod.stream.v1", ticket])`. The ticket travels in `Sec-WebSocket-Protocol`, never in the address, because addresses reach access logs (the edge network's in front of the gateway, and the gateway's own) and headers there are not logged. The server selects `pod.stream.v1`, never the ticket, so the answer does not repeat it. Every well-formed ticket an upgrade offers is spent before anything else is checked, whatever the outcome: an upgrade refused as `unauthorized` or `invalid`, or one that offers two tickets, leaves none of them usable. The upgrade is refused with `unauthorized`, one message for every cause, when the ticket is unknown, spent or expired; names another stream; arrives without an `Origin` header or from an origin other than the one it was made for; when the key or person that made it can no longer open this stream; or when the header offers a malformed ticket, two tickets, or a ticket without `pod.stream.v1`. An upgrade that carries both `Authorization` and a ticket is `invalid`. Tickets are never logged. A key with the `sandboxes:exec` scope. ## Request [#request] A WebSocket. Open the `stream_url` the command's answer gives, with your key in `Authorization`; a browser opens it with a [stream ticket](https://docs.mapier.ai/pod/api/commands/create-exec-stream-ticket) instead. The SDKs open it for you. ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------------ | ------ | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `operation_id` | path | `string` | Yes | | | `Sec-WebSocket-Protocol` | header | `string` | No | With a stream ticket: `pod.stream.v1, pod_ticket_…`. Without one, `pod.stream.v1` may be offered and is then selected. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------------ | | TypeScript | `proc.stdout, proc.stderr` | | Python | `proc.stdout, proc.stderr` | | mpod | `mpod sandboxes commands attach ` | # Look at a custom domain's records again now (https://docs.mapier.ai/pod/api/domains/check-domain) > Pod looks again on its own, and daily once a domain is active (`warning` says what went missing). **POST** `/v1/domains/{domain_id}/check` Pod looks again on its own, and daily once a domain is active (`warning` says what went missing). This call looks now and answers the domain as it then is. A key with the `network:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/domains/dom_3ahrz6dmv29gqy5ckt18fpx4b/check" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `domain_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The domain after the check. ```json title="200" { "id": "dom_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "wildcard": false, "target": { "sandbox_id": null, "port": 1 }, "state": "pending_dns", "verification": null, "certificate": null, "failure": null, "warning": null, "created_at": null, "changed_at": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project_id` | `string` | Yes | | | `name` | `string` | Yes | Lowercase ASCII, an internationalised name in its `xn--` form. A leading `*.` makes a wildcard that matches one label. Pod's own zones (`mapier.ai`, and `mapier.dev`, the content domain) and public suffixes are refused. | | `wildcard` | `boolean` | Yes | | | `target` | `DomainTarget` | Yes | | | `state` | `"pending_dns" \| "issuing" \| "active" \| "failed"` | Yes | `pending_dns` until the records are seen, `issuing` while the certificate is made, then `active`; `failed` says why in `failure`. Treat a value you do not know as pending. | | `verification` | `DomainVerification \| null` | Yes | The records to add; null once nothing is left to add. | | `certificate` | `DomainCertificate \| null` | Yes | The certificate served; null until one is issued. | | `failure` | `string \| null` | No | Why the domain is `failed`. | | `warning` | `string \| null` | No | What went missing from an active domain's records. | | `created_at` | `string \| null` | Yes | | | `changed_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `pod.network.domains.check(id)` | | Python | `pod.network.domains.check(id)` | | mpod | `mpod domains check ` | # Claim a custom domain for a sandbox's port (https://docs.mapier.ai/pod/api/domains/create-domain) > Claims a name of the customer's own and answers the records to add at its DNS host: a TXT record proving the name is theirs (`verification.txt_name`, `txt_value`; it must stay in place) and the route, a CNAME to `verification.route_host` or, at a zone's apex, A and AAAA records to `route_addresses`. **POST** `/v1/domains` Claims a name of the customer's own and answers the records to add at its DNS host: a TXT record proving the name is theirs (`verification.txt_name`, `txt_value`; it must stay in place) and the route, a CNAME to `verification.route_host` or, at a zone's apex, A and AAAA records to `route_addresses`. A wildcard (`*.preview.example.com`) needs a CNAME of `_acme-challenge` to `acme_cname_target` as well, and routes each label `sbx-` to that sandbox of the domain's project; it names no `sandbox_id`. The domain then moves from `pending_dns` through `issuing` (a public certificate) to `active`; `checkDomain` looks again at once. A pending claim holds nothing: whoever proves the name first holds it. Pod's own zones are `invalid`; a name another organization holds is `conflict`. A project out of the caller's reach is `forbidden`, as on `createSandbox`. Needs the `custom_domains` entitlement (`getNetworkSettings`); `max_domains` counts them. A key with the `network:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/domains" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"example","port":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | `string` | Yes | Lowercase ASCII, an internationalised name in its `xn--` form. A leading `*.` makes a wildcard that matches one label. Pod's own zones (`mapier.ai`, and `mapier.dev`, the content domain) and public suffixes are refused. | | `project` | `string` | No | The key's own project by default, and the only one it may name. A person must name one. | | `sandbox_id` | `string` | No | Required for an exact name; not for a wildcard. | | `port` | `integer` | Yes | From 1 to 65535. | ## Answer [#answer] **201.** The domain, waiting for its records. ```json title="201" { "id": "dom_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "wildcard": false, "target": { "sandbox_id": null, "port": 1 }, "state": "pending_dns", "verification": null, "certificate": null, "failure": null, "warning": null, "created_at": null, "changed_at": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project_id` | `string` | Yes | | | `name` | `string` | Yes | Lowercase ASCII, an internationalised name in its `xn--` form. A leading `*.` makes a wildcard that matches one label. Pod's own zones (`mapier.ai`, and `mapier.dev`, the content domain) and public suffixes are refused. | | `wildcard` | `boolean` | Yes | | | `target` | `DomainTarget` | Yes | | | `state` | `"pending_dns" \| "issuing" \| "active" \| "failed"` | Yes | `pending_dns` until the records are seen, `issuing` while the certificate is made, then `active`; `failed` says why in `failure`. Treat a value you do not know as pending. | | `verification` | `DomainVerification \| null` | Yes | The records to add; null once nothing is left to add. | | `certificate` | `DomainCertificate \| null` | Yes | The certificate served; null until one is issued. | | `failure` | `string \| null` | No | Why the domain is `failed`. | | `warning` | `string \| null` | No | What went missing from an active domain's records. | | `created_at` | `string \| null` | Yes | | | `changed_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`plan_required`](https://docs.mapier.ai/pod/api/errors#plan_required), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.network.domains.create({ … })` | | Python | `pod.network.domains.create({…})` | | mpod | `mpod domains create ` | # Remove a custom domain (https://docs.mapier.ai/pod/api/domains/delete-domain) > Stops routing the name and revokes its certificate. **DELETE** `/v1/domains/{domain_id}` Stops routing the name and revokes its certificate. A domain already removed, or never there, answers the same `204`. A key with the `network:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/domains/dom_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `domain_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Removed. ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `pod.network.domains.delete(id)` | | Python | `pod.network.domains.delete(id)` | | mpod | `mpod domains delete ` | # Get a custom domain (https://docs.mapier.ai/pod/api/domains/get-domain) > A domain of another project is `not_found`, as a sandbox is. **GET** `/v1/domains/{domain_id}` A domain of another project is `not_found`, as a sandbox is. A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/domains/dom_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------- | ---- | -------- | -------- | ---------- | | `domain_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The domain. ```json title="200" { "id": "dom_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "wildcard": false, "target": { "sandbox_id": null, "port": 1 }, "state": "pending_dns", "verification": null, "certificate": null, "failure": null, "warning": null, "created_at": null, "changed_at": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project_id` | `string` | Yes | | | `name` | `string` | Yes | Lowercase ASCII, an internationalised name in its `xn--` form. A leading `*.` makes a wildcard that matches one label. Pod's own zones (`mapier.ai`, and `mapier.dev`, the content domain) and public suffixes are refused. | | `wildcard` | `boolean` | Yes | | | `target` | `DomainTarget` | Yes | | | `state` | `"pending_dns" \| "issuing" \| "active" \| "failed"` | Yes | `pending_dns` until the records are seen, `issuing` while the certificate is made, then `active`; `failed` says why in `failure`. Treat a value you do not know as pending. | | `verification` | `DomainVerification \| null` | Yes | The records to add; null once nothing is left to add. | | `certificate` | `DomainCertificate \| null` | Yes | The certificate served; null until one is issued. | | `failure` | `string \| null` | No | Why the domain is `failed`. | | `warning` | `string \| null` | No | What went missing from an active domain's records. | | `created_at` | `string \| null` | Yes | | | `changed_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------- | | TypeScript | `pod.network.domains.get(id)` | | Python | `pod.network.domains.get(id)` | | mpod | `mpod domains get ` | # List custom domains (https://docs.mapier.ai/pod/api/domains/list-domains) > The project's domains, newest first. **GET** `/v1/domains` The project's domains, newest first. A key lists its own project's; a person whose role reaches only some projects names one. A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/domains" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | --------- | -------- | --------------------------------------------------------------------------------------------------- | | `project` | query | `string` | No | The project to list. A key lists its own; a person whose role reaches only some projects names one. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of domains, newest first. ```json title="200" { "data": [ { "id": "dom_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "wildcard": false, "target": { "sandbox_id": null, "port": 1 }, "state": "pending_dns", "verification": null, "certificate": null, "failure": null, "warning": null, "created_at": null, "changed_at": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Domain[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------- | | TypeScript | `pod.network.domains.list()` | | Python | `pod.network.domains.list()` | | mpod | `mpod domains list` | # Point a custom domain at another sandbox or port (https://docs.mapier.ai/pod/api/domains/update-domain) > An exact name takes a `sandbox_id` of the domain's project; a wildcard takes none, since its labels name the sandbox. **PATCH** `/v1/domains/{domain_id}` An exact name takes a `sandbox_id` of the domain's project; a wildcard takes none, since its labels name the sandbox. A sandbox the caller cannot see is `invalid` on `sandbox_id`. A key with the `network:write` scope. ## Request [#request] ```bash curl -X PATCH "https://api.pod.mapier.ai/v1/domains/dom_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"port":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `domain_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | --------- | -------- | ----------------------------------------------- | | `sandbox_id` | `string` | No | Required for an exact name; not for a wildcard. | | `port` | `integer` | Yes | From 1 to 65535. | ## Answer [#answer] **200.** The domain, pointing at its new target. ```json title="200" { "id": "dom_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "wildcard": false, "target": { "sandbox_id": null, "port": 1 }, "state": "pending_dns", "verification": null, "certificate": null, "failure": null, "warning": null, "created_at": null, "changed_at": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project_id` | `string` | Yes | | | `name` | `string` | Yes | Lowercase ASCII, an internationalised name in its `xn--` form. A leading `*.` makes a wildcard that matches one label. Pod's own zones (`mapier.ai`, and `mapier.dev`, the content domain) and public suffixes are refused. | | `wildcard` | `boolean` | Yes | | | `target` | `DomainTarget` | Yes | | | `state` | `"pending_dns" \| "issuing" \| "active" \| "failed"` | Yes | `pending_dns` until the records are seen, `issuing` while the certificate is made, then `active`; `failed` says why in `failure`. Treat a value you do not know as pending. | | `verification` | `DomainVerification \| null` | Yes | The records to add; null once nothing is left to add. | | `certificate` | `DomainCertificate \| null` | Yes | The certificate served; null until one is issued. | | `failure` | `string \| null` | No | Why the domain is `failed`. | | `warning` | `string \| null` | No | What went missing from an active domain's records. | | `created_at` | `string \| null` | Yes | | | `changed_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------- | | TypeScript | `pod.network.domains.update(id, { … })` | | Python | `pod.network.domains.update(id, {…})` | | mpod | `mpod domains update ` | # Make a short-lived token a browser holds for one end user (https://docs.mapier.ai/pod/api/end-users/create-end-user-token) > Answers a token (`pod_eu_…`) your server hands to your user's browser. **POST** `/v1/end_users/{end_user_id}/tokens` Answers a token (`pod_eu_…`) your server hands to your user's browser. Sent as a bearer token, it sees and drives only this end user's sandboxes (or only `sandbox`), with the scopes named, which are at most `sandboxes:read`, `sandboxes:exec`, `files:read` and `files:write` and never more than the caller holds. It lives `ttl_s` seconds, 30 to 3600 (900 by default), and cannot be renewed: make another. Everything else, creates and deletes included, stays on your server with your key. Pod signs it and stores nothing of it, so the answer is a secret sent with `Cache-Control: no-store`, the call takes no `Idempotency-Key`, and asking twice makes two tokens. A cell checks it without calling the account service; `revokeEndUserTokens`, a suspension or a deletion refuses every token of the end user within seconds. A suspended or deleted end user is `conflict` or `not_found`. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp/tokens" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"scopes":["sandboxes:read"]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------- | ---- | -------- | -------- | ---------- | | `end_user_id` | path | `string` | Yes | | ## Body [#body] | Field | Type | Required | What it is | | --------- | ------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------- | | `scopes` | `"sandboxes:read" \| "sandboxes:exec" \| "files:read" \| "files:write"[]` | No | All four by default, narrowed to what the caller holds. | | `ttl_s` | `integer` | No | Default `900`. From 30 to 3600. | | `sandbox` | `string` | No | Only this sandbox of the end user. One that is not the end user's is `not_found`. | ## Answer [#answer] **201.** The token, shown this once. ```json title="201" { "token": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dmv29gqy5ckt18fp", "end_user": "enu_3ahrz6dmv29gqy5ckt18fp", "scopes": ["sandboxes:read"], "sandbox": null, "issued_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------ | ------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `token` | `string` | Yes | Signed by Pod and stored nowhere. A secret for its life. | | `end_user` | `string` | Yes | | | `scopes` | `"sandboxes:read" \| "sandboxes:exec" \| "files:read" \| "files:write"[]` | Yes | | | `sandbox` | `string \| null` | Yes | | | `issued_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------- | | TypeScript | `pod.endUsers.createToken(id, { … })` | | Python | `pod.end_users.create_token(id, …)` | | mpod | `mpod end-users token ` | # Make or find an end user by your own id for it (https://docs.mapier.ai/pod/api/end-users/create-end-user) > Answers the end user of the project with this `ref`, making it the first time (`201`); every later call with the same `ref` answers the same end user (`200`). **POST** `/v1/end_users` Answers the end user of the project with this `ref`, making it the first time (`201`); every later call with the same `ref` answers the same end user (`200`). The `ref` is your own id for your user: Pod keeps it, shows it back and never reads it. A key makes end users in its own project; a person names the project. A new end user is a trust domain of its own (`trust_domain: end_user`), as Pod Console's customers are. An end user made under the earlier default shares the organization's (`trust_domain: organisation`) and keeps it. `display_name`, `metadata` and `tags` are kept when the end user is made; a later call with the same `ref` answers the end user as it is, and `updateEndUser` changes them. A deleted end user's `ref` makes a new one. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/end_users" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ref":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | ----------------- | -------- | -------------------------------------------------------------------------------------------- | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `display_name` | `string` | No | The name you show for your user. Pod keeps it and shows it back; it never reads it. | | `metadata` | `EndUserMetadata` | No | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | No | | | `project` | `string` | No | The key's own project by default, and the only one it may name. A person must name one. | ## Answer [#answer] **200.** The end user, found. **201.** The end user, made. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------- | | TypeScript | `pod.endUsers.create(ref)` | | Python | `pod.end_users.create(ref)` | | mpod | `mpod end-users create ` | # Delete an end user and its sandboxes (https://docs.mapier.ai/pod/api/end-users/delete-end-user) > Deletes the end user for good: its creates, wakes and tokens are refused at once in every cell, and the scheduler deletes its sandboxes and their snapshots. **DELETE** `/v1/end_users/{end_user_id}` Deletes the end user for good: its creates, wakes and tokens are refused at once in every cell, and the scheduler deletes its sandboxes and their snapshots. Its usage stays, under its id. The same `ref` then makes a new end user. Answers the end user as deleted; after that it is `not_found`. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `end_user_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The end user, deleted. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------- | | TypeScript | `pod.endUsers.delete(id)` | | Python | `pod.end_users.delete(id)` | | mpod | `mpod end-users delete ` | # Get an end user and the limits that count for it (https://docs.mapier.ai/pod/api/end-users/get-end-user) > A deleted end user is `not_found`. **GET** `/v1/end_users/{end_user_id}` A deleted end user is `not_found`. A key with the `end_users:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------- | ---- | -------- | -------- | ---------- | | `end_user_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The end user. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `pod.endUsers.get(id)` | | Python | `pod.end_users.get(id)` | | mpod | `mpod end-users get ` | # List end users (https://docs.mapier.ai/pod/api/end-users/list-end-users) > List end users **GET** `/v1/end_users` A key with the `end_users:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/end_users" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | ------------------------- | -------- | ------------------------------------------------------------ | | `ref` | query | `string` | No | Only the end user with this `ref`. | | `project` | query | `string` | No | Only this project. A key sees only its own. | | `tag` | query | `string` | No | Only end users with this tag. | | `state` | query | `"active" \| "suspended"` | No | Only end users in this state. Deleted ones are never listed. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of end users, newest first. ```json title="200" { "data": [ { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `EndUser[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------- | | TypeScript | `pod.endUsers.list()` | | Python | `pod.end_users.list()` | | mpod | `mpod end-users list` | # Lift an end user's suspension (https://docs.mapier.ai/pod/api/end-users/resume-end-user) > The end user's creates and wakes are taken again. **POST** `/v1/end_users/{end_user_id}/resume` The end user's creates and wakes are taken again. Tokens made before the suspension stay refused; make new ones. Resuming an active end user changes nothing. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp/resume" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `end_user_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The end user, active. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------- | | TypeScript | `pod.endUsers.resume(id)` | | Python | `pod.end_users.resume(id)` | | mpod | `mpod end-users resume ` | # Refuse every token made so far for an end user (https://docs.mapier.ai/pod/api/end-users/revoke-end-user-tokens) > Every token of the end user made before now is refused in every cell within seconds (`tokens_valid_after`); tokens made after still work. **POST** `/v1/end_users/{end_user_id}/tokens/revoke` Every token of the end user made before now is refused in every cell within seconds (`tokens_valid_after`); tokens made after still work. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp/tokens/revoke" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `end_user_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The end user, with `tokens_valid_after` set. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------- | | TypeScript | `pod.endUsers.revokeTokens(id)` | | Python | `pod.end_users.revoke_tokens(id)` | | mpod | `mpod end-users revoke-tokens ` | # Set how many sandboxes an end user may hold and keep awake (https://docs.mapier.ai/pod/api/end-users/set-end-user-limits) > Sets the end user's own limits; `null` removes one, so the project's default for its end users counts again, or Pod's default when the project has none. **PUT** `/v1/end_users/{end_user_id}/limits` Sets the end user's own limits; `null` removes one, so the project's default for its end users counts again, or Pod's default when the project has none. The organization's and the project's limits still count on top. A create or a wake past a limit answers `quota_exceeded` naming it. A limit lowered below what the end user holds now stops nothing that runs: it refuses the next create or wake. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp/limits" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"max_sandboxes":0}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `end_user_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------------- | ----------------- | -------- | ------------------------------------------------------------------------------------------- | | `max_sandboxes` | `integer \| null` | No | Sandboxes the end user may hold. `null` removes the end user's own limit. At least 0. | | `max_awake` | `integer \| null` | No | Sandboxes the end user may keep awake. `null` removes the end user's own limit. At least 0. | ## Answer [#answer] **200.** The end user, with the limits that count for it now. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.endUsers.setLimits(id, { … })` | | Python | `pod.end_users.set_limits(id, {…})` | | mpod | `mpod end-users limits ` | # Set how much an end user may spend a month (https://docs.mapier.ai/pod/api/end-users/set-end-user-spend-cap) > Sets the end user's own spend cap; `amount_cents: null` removes it, so the project's default for its end users counts again, or none when the project has none. **PUT** `/v1/end_users/{end_user_id}/spend_cap` Sets the end user's own spend cap; `amount_cents: null` removes it, so the project's default for its end users counts again, or none when the project has none. The organization's and the project's caps still count on top. Once the month's spend reaches the cap, the end user's creates and wakes answer `spend_cap_reached`; with `on_reach: sleep` its awake sandboxes are also put to sleep. A cap of `0` refuses at once. Lowering a cap below what was spent stops nothing that runs unless `on_reach` is `sleep`. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp/spend_cap" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amount_cents":0}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `end_user_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | `amount_cents` | `integer \| null` | Yes | The cap a month, in the currency's minor unit. `null` removes the end user's own cap. From 0 to 100000000. | | `on_reach` | `"refuse" \| "sleep"` | No | Once the month's spend reaches the cap: `refuse` new creates and wakes, or also put to `sleep` what is awake. Nothing is deleted. | ## Answer [#answer] **200.** The end user, with the spend cap that counts for it now. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------ | | TypeScript | `pod.endUsers.setSpendCap(id, { amount_cents })` | | Python | `pod.end_users.set_spend_cap(id, {…})` | | mpod | `mpod end-users spend-cap ` | # Suspend an end user (https://docs.mapier.ai/pod/api/end-users/suspend-end-user) > Refuses the end user's creates and wakes (`account_restricted`, `limit: end_user`) and every token made for it, in every cell within seconds. **POST** `/v1/end_users/{end_user_id}/suspend` Refuses the end user's creates and wakes (`account_restricted`, `limit: end_user`) and every token made for it, in every cell within seconds. With `sleep` (the default) what is awake is put to sleep; nothing is deleted. Suspending a suspended end user changes only `sleep` and `reason`. `resumeEndUser` lifts it. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp/suspend" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"sleep":true}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `end_user_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------- | --------- | -------- | -------------------------------------------------------------------------- | | `sleep` | `boolean` | No | Put what is awake to sleep. Nothing is deleted either way. Default `true`. | | `reason` | `string` | No | Your own note, kept and shown back. | ## Answer [#answer] **200.** The end user, suspended. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.endUsers.suspend(id)` | | Python | `pod.end_users.suspend(id)` | | mpod | `mpod end-users suspend ` | # Change an end user's name, metadata, tags or policy (https://docs.mapier.ai/pod/api/end-users/update-end-user) > Changes what is named. **PATCH** `/v1/end_users/{end_user_id}` Changes what is named. `metadata` and `tags` are replaced whole; `policy` changes only the fields named, and `null` removes one. The policy holds every sandbox of the end user: `wakes_per_hour` refuses creates and wakes past it (`rate_limited`, `limit: wakes_per_hour`), `idle_s` is their idle time, and `max_size` and `max_vcpu` refuse a larger size on create, resize or fork (`forbidden`, `field: size`). It reaches every cell with the signed standing list, within seconds. A deleted end user is `not_found`. A key with the `end_users:write` scope. ## Request [#request] ```bash curl -X PATCH "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"display_name":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `end_user_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------------------- | -------- | -------------------------------------------------------------------------------------------- | | `display_name` | `string \| null` | No | | | `metadata` | `EndUserMetadata` | No | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | No | | | `policy` | `UpdateEndUserPolicy` | No | The fields to change; `null` removes one. | ## Answer [#answer] **200.** The end user as changed. ```json title="200" { "id": "enu_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "ref": "example", "trust_domain": "organisation", "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": { "value": 0, "from": "end_user" }, "max_awake": { "value": 0, "from": "end_user" } }, "spend_cap": { "amount_cents": null, "on_reach": "refuse", "from": "end_user", "currency": "example", "period": "example", "spent_cents": null, "reached": false }, "display_name": null, "metadata": {}, "tags": ["example"], "state": "active", "suspended_at": null, "policy": { "wakes_per_hour": null, "idle_s": null, "max_size": null, "max_vcpu": null }, "tokens_valid_after": null } ``` | Field | Type | Always | What it is | | -------------------- | -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `ref` | `string` | Yes | Your own id for your user. Pod keeps it and shows it back; it never reads it. | | `trust_domain` | `"organisation" \| "end_user"` | Yes | Whose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `EndUserLimits` | Yes | | | `spend_cap` | `EndUserSpendCap` | Yes | | | `display_name` | `string \| null` | Yes | | | `metadata` | `EndUserMetadata` | Yes | Up to 16 string values of your own. Pod keeps them and shows them back; it never reads them. | | `tags` | `string[]` | Yes | | | `state` | `"active" \| "suspended" \| "deleted"` | Yes | `suspended`: creates, wakes and tokens refused (`account_restricted`, `limit: end_user`). `deleted`: gone; its sandboxes are deleted. | | `suspended_at` | `string \| null` | Yes | | | `policy` | `EndUserPolicy` | Yes | What every sandbox of the end user is held to; null fields hold nothing. Set with `updateEndUser`. | | `tokens_valid_after` | `string \| null` | Yes | Tokens made before this time are refused (`revokeEndUserTokens`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------- | | TypeScript | `pod.endUsers.update(id, { … })` | | Python | `pod.end_users.update(id, …)` | | mpod | `mpod end-users update ` | # Errors (https://docs.mapier.ai/pod/api/errors) > Every error Pod answers, what it means, and when to send the call again Every refusal has the same body, with the error's name in `error`. Branch on the name, never on the message: names are stable, and messages change. ```json title="409" { "error": "quota_exceeded", "message": "This project holds its most sandboxes awake.", "request_id": "req_3ahrz6dmv29gqy5ckt18fp", "limit": "max_awake" } ``` | Field | What it is | | --------------- | ------------------------------------------------------------------------------------ | | `error` | The name, from the list below. | | `message` | For people. It can change. | | `request_id` | The same as the `Request-Id` header. Give it to support. | | `retry_after_s` | With `rate_limited` and `no_capacity`: wait this long before sending the call again. | | `field` | With `invalid`: the field that is wrong. | | `limit` | With `quota_exceeded`: `max_sandboxes` or `max_awake`. | | `cell_endpoint` | With `in_other_cell`: where to send the call. | ## Sending a call again [#sending-a-call-again] Every call that changes something takes an `Idempotency-Key` header. Send the same key with the same request and Pod never acts twice. Pod keeps the answer for 24 hours when it was a success or a refusal that may not be sent again, and answers it again for the same key. After any other refusal the same key runs the call again. Both SDKs and `mpod` send a key with every such call and retry only where the rule below allows it. | Rule | What to do | | -------------------- | ------------------------------------------------------------------------------------------------- | | `never` | Do not send it again as it is. Fix the request first. | | `now` | Send it again at once, with the same idempotency key. | | `after_retry_after` | Wait the `retry_after_s` the answer gives (also the `Retry-After` header), then send it again. | | `same_key_only` | The outcome is unknown. Send it again only with the same idempotency key, which never acts twice. | | `after_state_change` | Send it again once the object's state allows it; the message names the state. | | `once_freed` | Send it again once something the limit counts is freed: a sandbox deleted, or put to sleep. | | `at_cell_endpoint` | Send it to the address in `cell_endpoint`, where the object lives. | ## All errors [#all-errors] | Name | HTTP | Retried by the SDKs | | --------------------------------------------------------- | ---- | ------------------- | | [`invalid`](#invalid) | 400 | No | | [`invalid_user`](#invalid_user) | 400 | No | | [`system_not_offered`](#system_not_offered) | 400 | No | | [`payload_too_large`](#payload_too_large) | 413 | No | | [`unauthorized`](#unauthorized) | 401 | No | | [`forbidden`](#forbidden) | 403 | No | | [`person_required`](#person_required) | 403 | No | | [`ci_size_above_default`](#ci_size_above_default) | 403 | No | | [`ci_untrusted_on_warm`](#ci_untrusted_on_warm) | 403 | No | | [`ci_shards_refused`](#ci_shards_refused) | 403 | No | | [`ci_account_not_servable`](#ci_account_not_servable) | 422 | No | | [`not_found`](#not_found) | 404 | No | | [`in_other_cell`](#in_other_cell) | 421 | No | | [`conflict`](#conflict) | 409 | No | | [`idempotency_key_reused`](#idempotency_key_reused) | 409 | No | | [`saves_refused`](#saves_refused) | 409 | No | | [`not_ready`](#not_ready) | 409 | Yes | | [`quota_exceeded`](#quota_exceeded) | 409 | No | | [`plan_required`](#plan_required) | 402 | No | | [`account_restricted`](#account_restricted) | 402 | No | | [`spend_cap_reached`](#spend_cap_reached) | 402 | No | | [`rate_limited`](#rate_limited) | 429 | Yes | | [`no_capacity`](#no_capacity) | 503 | Yes | | [`not_supported`](#not_supported) | 501 | No | | [`guest_unavailable`](#guest_unavailable) | 503 | Yes | | [`guest_unresponsive`](#guest_unresponsive) | 504 | Yes | | [`deadline_exceeded`](#deadline_exceeded) | 504 | Yes | | [`unavailable`](#unavailable) | 503 | Yes | | [`port_closed`](#port_closed) | 502 | No | | [`upstream`](#upstream) | 502 | Yes | | [`internal`](#internal) | 500 | Yes | | [`ci_repository_removed`](#ci_repository_removed) | 422 | No | | [`ci_installation_suspended`](#ci_installation_suspended) | 422 | No | | [`ci_customer_gone`](#ci_customer_gone) | 422 | No | ### `invalid` [#invalid] Malformed request, unknown size or field, bad value. `field` names it. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 400 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `invalid_user` [#invalid_user] Pod Console's machine user breaks its rules. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 400 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `system_not_offered` [#system_not_offered] The system or class is not offered in this cell yet. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 400 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `payload_too_large` [#payload_too_large] Body or upload over its limit. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 413 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `unauthorized` [#unauthorized] No credential, or one that is not valid. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 401 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `forbidden` [#forbidden] A valid credential without the scope or project, or a sandbox key used from outside its own slot. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 403 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `person_required` [#person_required] A people-only action, or a fresh second factor is needed. No API key can do it. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 403 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `ci_size_above_default` [#ci_size_above_default] Pod CI: a job from someone who is not trusted on the repository (a stranger's pull request from a fork, or a job whose facts are missing) asked for a runner above the default size. The job runs at the default size at most; nothing is billed for the refused runner. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 403 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `ci_untrusted_on_warm` [#ci_untrusted_on_warm] Pod CI: a job from someone who is not trusted on the repository landed on a runner restored from the repository's warm snapshot, which only the repository's own jobs may use. It is stopped before its first step and nothing is billed; run it again on a plain runner. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 403 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `ci_shards_refused` [#ci_shards_refused] Pod CI: a job's ask for copies of itself (fork to shard) is refused: more copies than the plan allows, copies that would pass the core limit, an account not in good standing, or a stranger's job on a public repository. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 403 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `ci_account_not_servable` [#ci_account_not_servable] Pod CI cannot serve this GitHub account: a personal account, an organization without runner groups, or a suspended installation. Connecting it is refused until that changes. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 422 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `not_found` [#not_found] No such object that this key may see. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 404 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `in_other_cell` [#in_other_cell] The object lives in another cell; `cell_endpoint` names it. | HTTP | Send again | Same key answers it again | | ---- | ------------------------------------------------------------------ | ------------------------- | | 421 | Send it to the address in `cell_endpoint`, where the object lives. | No: it runs again | ### `conflict` [#conflict] The object's state forbids the call; the message names the state. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------------------------------- | ------------------------- | | 409 | Send it again once the object's state allows it; the message names the state. | No: it runs again | ### `idempotency_key_reused` [#idempotency_key_reused] The same key came with a different request. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 409 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `saves_refused` [#saves_refused] The sandbox was created with the flag that refuses snapshots, share links and forks. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 409 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `not_ready` [#not_ready] The sandbox is still creating or waking and the call waited until its deadline. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 409 | Send it again at once, with the same idempotency key. | No: it runs again | ### `quota_exceeded` [#quota_exceeded] A count limit: sandboxes held (`max_sandboxes`) or sandboxes awake (`max_awake`), per organization, project or end user; a batch larger than the trust tier's swarm cap (`max_swarm`); a batch larger than a minute's creates that the swarm cap does not allow (`creates_per_minute`); or a network limit (`max_domains`, `max_static_addresses`, `max_private_ranges`, `max_proxies`, `max_leases`). `limit` names it. | HTTP | Send again | Same key answers it again | | ---- | ------------------------------------------------------------------------------------------- | ------------------------- | | 409 | Send it again once something the limit counts is freed: a sandbox deleted, or put to sleep. | No: it runs again | ### `plan_required` [#plan_required] The plan does not include this size, class or feature, or the feature needs a verified account. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 402 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `account_restricted` [#account_restricted] The account is past due or suspended (`limit: standing`), its home-connection addresses are held (`limit: home_address_hold`), or the end user is suspended or deleted (`limit: end_user`). Creates and wakes are refused; running sandboxes are not touched by this error. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 402 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `spend_cap_reached` [#spend_cap_reached] A spend cap of the organization, the project or the end user is reached for this month. `limit` is `spend_cap`. Creates and wakes are refused; with the cap's `on_reach` at `sleep`, what is awake is put to sleep. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------------------------------- | ------------------------- | | 402 | Send it again once the object's state allows it; the message names the state. | No: it runs again | ### `rate_limited` [#rate_limited] Too many calls for this key or account. `limit` names the rate-limit policy that ran out (`calls_per_minute` or `creates_per_minute`), which the `RateLimit-Policy` and `RateLimit` headers describe. | HTTP | Send again | Same key answers it again | | ---- | ---------------------------------------------------------------------------------------------- | ------------------------- | | 429 | Wait the `retry_after_s` the answer gives (also the `Retry-After` header), then send it again. | No: it runs again | ### `no_capacity` [#no_capacity] No server has room for a create. A wake queues instead of failing. On a create with `hold_server`, `server_held` says whether a server is now held for it: retry with the same idempotency key. | HTTP | Send again | Same key answers it again | | ---- | ---------------------------------------------------------------------------------------------- | ------------------------- | | 503 | Wait the `retry_after_s` the answer gives (also the `Retry-After` header), then send it again. | No: it runs again | ### `not_supported` [#not_supported] This system or class does not do this: fork on a TEE sandbox, memory sleep on macOS. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 501 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | ### `guest_unavailable` [#guest_unavailable] The guest agent did not take the call. The command did not start. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 503 | Send it again at once, with the same idempotency key. | No: it runs again | ### `guest_unresponsive` [#guest_unresponsive] The guest agent stopped answering after the call started. The outcome is unknown. | HTTP | Send again | Same key answers it again | | ---- | ------------------------------------------------------------------------------------------------- | ------------------------- | | 504 | The outcome is unknown. Send it again only with the same idempotency key, which never acts twice. | No: it runs again | ### `deadline_exceeded` [#deadline_exceeded] A deadline passed inside Pod. The outcome is unknown. | HTTP | Send again | Same key answers it again | | ---- | ------------------------------------------------------------------------------------------------- | ------------------------- | | 504 | The outcome is unknown. Send it again only with the same idempotency key, which never acts twice. | No: it runs again | ### `unavailable` [#unavailable] A Pod service is down, restarting or draining. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 503 | Send it again at once, with the same idempotency key. | No: it runs again | ### `port_closed` [#port_closed] Nothing in the sandbox listens on the port asked for. The tunnel answers it before the upgrade; a port URL shows it as a page. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------------------------------- | ------------------------- | | 502 | Send it again once the object's state allows it; the message names the state. | No: it runs again | ### `upstream` [#upstream] A provider Pod depends on failed: object storage, the key manager, identity. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 502 | Send it again at once, with the same idempotency key. | No: it runs again | ### `internal` [#internal] A fault in Pod. | HTTP | Send again | Same key answers it again | | ---- | ------------------------------------------------------------------------------------------------- | ------------------------- | | 500 | The outcome is unknown. Send it again only with the same idempotency key, which never acts twice. | No: it runs again | ### `ci_repository_removed` [#ci_repository_removed] Pod CI: the repository was removed from the GitHub App's installation, or deleted on GitHub, so no runner starts for its queued jobs until it is added again. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------------------------------- | ------------------------- | | 422 | Send it again once the object's state allows it; the message names the state. | No: it runs again | ### `ci_installation_suspended` [#ci_installation_suspended] Pod CI: GitHub suspended the App's installation, so no runner starts for its repositories' queued jobs until it is unsuspended. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------------------------------- | ------------------------- | | 422 | Send it again once the object's state allows it; the message names the state. | No: it runs again | ### `ci_customer_gone` [#ci_customer_gone] Pod CI: the GitHub App was uninstalled or the Pod organization closed, so Pod CI no longer serves this customer and its queued jobs never get a runner. | HTTP | Send again | Same key answers it again | | ---- | ----------------------------------------------------- | ------------------------- | | 422 | Do not send it again as it is. Fix the request first. | Yes, for 24 hours | # Tell Pod's team something (https://docs.mapier.ai/pod/api/feedback/create-feedback) > Sends a bug report, an idea or a question to Pod's team, from a person or an agent with any key; no scope is needed. **POST** `/v1/feedback` Sends a bug report, an idea or a question to Pod's team, from a person or an agent with any key; no scope is needed. Name a sandbox or a request id to point at what went wrong. Never put a secret in it. One caller may send 5 a minute and 20 a day (`rate_limited`, with `retry_after_s`). ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/feedback" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"message":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | -------- | -------- | --------------------------------------- | | `message` | `string` | Yes | | | `kind` | `object` | No | Default `"other"`. | | `sandbox_id` | `object` | No | The sandbox it is about. | | `request_id` | `object` | No | The `Request-Id` of a call it is about. | | `source` | `object` | No | Default `"api"`. | ## Answer [#answer] **201.** Received. ```json title="201" { "id": "fbk_3ahrz6dmv29gqy5ckt18fp", "kind": "bug", "received_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ------------------------------------------ | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `kind` | `"bug" \| "idea" \| "question" \| "other"` | Yes | | | `received_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.feedback.send({ message, … })` | | Python | `pod.feedback.send(message, …)` | | mpod | `mpod feedback ` | # List a folder (https://docs.mapier.ai/pod/api/files/list-files) > List a folder **GET** `/v1/sandboxes/{sandbox_id}/files:list` A key with the `files:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files:list?path=/root/hello.py" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `path` | query | `string` | Yes | An absolute path inside the sandbox. | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of the folder's entries, by name. ```json title="200" { "data": [ { "path": "example", "type": "file", "size_bytes": 0, "mode": "example", "modified_at": "2026-11-23T12:00:00.000Z" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `FileInfo[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------- | | TypeScript | `sandbox.files.list(path)` | | Python | `sandbox.files.list(path)` | | mpod | `mpod sandboxes files list ` | # Make a folder (https://docs.mapier.ai/pod/api/files/make-directory) > Make a folder **POST** `/v1/sandboxes/{sandbox_id}/files:mkdir` A key with the `files:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files:mkdir" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"path":"/root/hello.py"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | --------- | -------- | ------------------------------------------------- | | `path` | `string` | Yes | | | `parents` | `boolean` | No | Make missing parent folders too. Default `false`. | | `mode` | `string` | No | | ## Answer [#answer] **200.** The folder. ```json title="200" { "path": "example", "type": "file", "size_bytes": 0, "mode": "example", "modified_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ----------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `path` | `string` | Yes | | | `type` | `"file" \| "directory" \| "symlink" \| "other"` | Yes | | | `size_bytes` | `integer` | Yes | At least 0. | | `mode` | `string` | Yes | | | `modified_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------- | | TypeScript | `sandbox.files.mkdir(path)` | | Python | `sandbox.files.mkdir(path)` | | mpod | `mpod sandboxes files mkdir ` | # Move or rename a file or folder (https://docs.mapier.ai/pod/api/files/move-file) > Move or rename a file or folder **POST** `/v1/sandboxes/{sandbox_id}/files:move` A key with the `files:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files:move" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"from":"/root/hello.py","to":"/root/hello.py"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ----------- | --------- | -------- | ---------------- | | `from` | `string` | Yes | | | `to` | `string` | Yes | | | `overwrite` | `boolean` | No | Default `false`. | ## Answer [#answer] **200.** The file at its new path. ```json title="200" { "path": "example", "type": "file", "size_bytes": 0, "mode": "example", "modified_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ----------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `path` | `string` | Yes | | | `type` | `"file" \| "directory" \| "symlink" \| "other"` | Yes | | | `size_bytes` | `integer` | Yes | At least 0. | | `mode` | `string` | Yes | | | `modified_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------------- | | TypeScript | `sandbox.files.move(from, to)` | | Python | `sandbox.files.move(source, destination)` | | mpod | `mpod sandboxes files mv ` | # Read a file (https://docs.mapier.ai/pod/api/files/read-file) > Read a file **GET** `/v1/sandboxes/{sandbox_id}/files` A key with the `files:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files?path=/root/hello.py" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `path` | query | `string` | Yes | An absolute path inside the sandbox. | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | ## Answer [#answer] **200.** The file's bytes. ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------- | | TypeScript | `sandbox.files.read(path)` | | Python | `sandbox.files.read(path)` | | mpod | `mpod sandboxes files read ` | # Remove a file or folder (https://docs.mapier.ai/pod/api/files/remove-file) > Remove a file or folder **DELETE** `/v1/sandboxes/{sandbox_id}/files` A key with the `files:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files?path=/root/hello.py" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `path` | query | `string` | Yes | An absolute path inside the sandbox. | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `recursive` | query | `boolean` | No | Remove a folder and everything in it. | ## Answer [#answer] **204.** Removed. ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------ | | TypeScript | `sandbox.files.remove(path)` | | Python | `sandbox.files.remove(path)` | | mpod | `mpod sandboxes files rm ` | # Write a file (https://docs.mapier.ai/pod/api/files/write-file) > Writes the whole file, making it if needed. **PUT** `/v1/sandboxes/{sandbox_id}/files` Writes the whole file, making it if needed. 100 MiB at most a call. A key with the `files:write` scope. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files?path=/root/hello.py" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/octet-stream" \ --data-binary @hello.py ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `path` | query | `string` | Yes | An absolute path inside the sandbox. | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `mode` | query | `string` | No | Permission bits in octal, for a new file. `0644` by default. | ## Body [#body] The file's bytes, as `application/octet-stream`. ## Answer [#answer] **200.** The written file. ```json title="200" { "path": "example", "type": "file", "size_bytes": 0, "mode": "example", "modified_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ----------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `path` | `string` | Yes | | | `type` | `"file" \| "directory" \| "symlink" \| "other"` | Yes | | | `size_bytes` | `integer` | Yes | At least 0. | | `mode` | `string` | Yes | | | `modified_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`payload_too_large`](https://docs.mapier.ai/pod/api/errors#payload_too_large), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------- | | TypeScript | `sandbox.files.write(path, content)` | | Python | `sandbox.files.write(path, content)` | | mpod | `mpod sandboxes files write ` | # API reference (https://docs.mapier.ai/pod/api) > Pod's public API, its conventions, and every call Pod's API is JSON over HTTPS at `https://api.pod.mapier.ai`, with WebSockets for streams. Version 1.0.0. ```bash curl "https://api.pod.mapier.ai/v1/sandboxes" -H "Authorization: Bearer $POD_API_KEY" ``` ## Keys [#keys] Send a key as a bearer token. A [test or live key](https://docs.mapier.ai/pod/sandboxes/keys-and-projects) sees only its own project's sandboxes of its own mode. A few calls are for signed-in people only, from the dashboard; their pages say so. ## Conventions [#conventions] - **JSON** with `snake_case` names. Timestamps are RFC 3339 in UTC, with milliseconds and a `Z`. Durations are integers with the unit in the name (`_ms`, `_s`). Memory is `memory_mb` (MiB), disk `disk_gb` (GiB), byte counts `_bytes`. Usage is seconds and bytes, never money. - **Ids** are a prefix, an underscore and lowercase letters and digits: `sbx_…` for a sandbox, `op_…` for an operation. An id says nothing else. - **Every answer** carries a `Request-Id` header (`req_…`), which an error's body repeats as `request_id`. - **Changes answer at once** with `202` and an operation. With `wait=true` the call waits, 60 seconds by default and 300 at most, and answers the result. A create is the exception: it waits for `running` by default and answers `201`, or `202` with the sandbox in `creating` when `wait` is false or the wait runs out. - **Lists** take `limit` (50 by default, 200 at most) and an opaque `cursor`, and answer `{"data": [...], "next_cursor": ...}`, newest first. A list can lag a few seconds behind a get by id, which is exact. - **Idempotency.** Every `POST`, `PUT`, `PATCH` and `DELETE` takes an `Idempotency-Key` header, except calls whose answer is a secret (a stream ticket, a port token, an end-user token, a sign-up). Those take none: a key sent anyway is ignored, and asking twice makes two. Creating or forking a sandbox requires one. A repeat within 24 hours with the same key and request answers what the first call answered, without acting again. The same key with a different request is [`idempotency_key_reused`](https://docs.mapier.ai/pod/api/errors#idempotency_key_reused). - **Errors** come from [one list](https://docs.mapier.ai/pod/api/errors). Branch on the name in `error`. ## Calls [#calls] The calls are grouped as in the menu: sandboxes, commands, files, snapshots, operations, usage, account, billing, end users, organizations and the service itself. Each page has the call's request, its fields, its answer, its errors and the same call in the SDKs and `mpod`. The sizes, counts and times the API holds you to are in [Limits](https://docs.mapier.ai/pod/api/limits). # Limits (https://docs.mapier.ai/pod/api/limits) > The sizes, counts, rates and times Pod's API holds you to ## Sizes [#sizes] | Size | Class | vCPU | Memory | Disk | | -------- | -------- | ---- | ------ | ------- | | `small` | `shared` | 2 | 4 GiB | 40 GiB | | `medium` | `shared` | 4 | 8 GiB | 80 GiB | | `large` | `shared` | 8 | 16 GiB | 160 GiB | | `xlarge` | `shared` | 16 | 32 GiB | 320 GiB | | `ci-2` | `ci` | 2 | 8 GiB | 100 GiB | | `ci-4` | `ci` | 4 | 16 GiB | 100 GiB | | `ci-8` | `ci` | 8 | 32 GiB | 100 GiB | | `ci-16` | `ci` | 16 | 64 GiB | 100 GiB | ## Calls [#calls] | What | Limit | | -------------------------------------------- | --------------------------------------------------------- | | A page of a list | 50 items by default, 200 at most (`limit`) | | A list cursor | Valid for 24 hours | | An `Idempotency-Key` | 1 to 200 printable characters; kept 24 hours | | Waiting for a change (`wait=true`) | 60 s by default, 300 s at most | | A command (`timeout_s`) | 60 s by default; `0` for no limit | | A file written in one call | 100 MiB | | Copies in one fork | 1 to 10 | | Sandboxes in one batch create (`count`) | 2 to 1000, and no more than your swarm cap (`max_swarm`) | | Ids hinted on one create (`hints`) | 16, volumes and snapshots together | | Idle time before a sandbox sleeps (`idle_s`) | 15 minutes by default, 60 s at least | | A stream ticket | 30 s by default, 60 s at most; one use; 20 unused at once | | An end user's own id (`ref`) | 1 to 200 printable characters | ## Sandboxes you may hold [#sandboxes-you-may-hold] | Limit | What it counts | Set for | | --------------- | ------------------------------- | --------------------------------------- | | `max_sandboxes` | Sandboxes held, asleep or awake | An organization, a project, an end user | | `max_awake` | Sandboxes awake | An organization, a project, an end user | A new organization may hold 5 sandboxes and keep 1 awake. An end user with no limit of its own, in a project with no default, may hold 5 sandboxes and keep 2 awake. A create, wake or start past a limit answers [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded), with the limit's name in `limit`. Pod sets your organization's and your projects' limits. Set each of your end users' limits yourself, with [Set an end user's limits](https://docs.mapier.ai/pod/api/end-users/set-end-user-limits), and each member's in the dashboard or with [Set a member's limits](https://docs.mapier.ai/pod/api/organisations/set-member-limits). [Read the limits](https://docs.mapier.ai/pod/api/usage/get-limits) to see every one that counts now and, for each size, why a create would be refused. ## Network [#network] | Limit | What it counts | Feature | | ---------------------- | -------------------------------------------------------- | ----------------------- | | `max_domains` | Custom domains an organization holds | `custom_domains` | | `max_static_addresses` | Static addresses a project holds at each site | `static_addresses` | | `max_private_ranges` | Private ranges an organization registers in its own cell | `private_ranges` | | `max_proxies` | Proxies a project holds | `own_proxy` | | `max_leases` | Leased home-connection addresses held at once | `leased_home_addresses` | The starting values are published here before the network features open. A create past a network limit answers [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded) with the limit's name in `limit`. [Network](https://docs.mapier.ai/pod/sandboxes/network) says what each feature needs. ## Request rates [#request-rates] The rates are published here before sign-up opens. Every answer to a call made with a key or a signed-in person carries two headers, `RateLimit-Policy` and `RateLimit` (the IETF rate-limit headers), with one item per policy that applies to you: | Header | What it says | | ------------------ | ------------------------------------------------------------------------------------------------------------- | | `RateLimit-Policy` | Each policy that applies to you: its name, `q` (how many in one window) and `w` (the window in seconds) | | `RateLimit` | What is left of each policy: its name, `r` (how many are left) and `t` (seconds until the window fills again) | | Policy | What it counts | Window | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------ | | `calls_per_minute` | Every call made with one key, or with one person’s sign-in | 60 s | | `creates_per_minute` | Sandboxes your organization makes; each copy of a batch create or a fork counts. Sent only when your organization has such a cap | 60 s | For example: ```http RateLimit-Policy: "calls_per_minute";q=600;w=60 RateLimit: "calls_per_minute";r=598;t=41 ``` The numbers in the example are not your limits; read your own from the headers. A call over the rate answers [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited) with `retry_after_s`, a `Retry-After` header and both headers, and `limit` names the policy that ran out. The SDKs keep the last headers they saw (`pod.rateLimit` in TypeScript, `pod.rate_limit` in Python), and a refusal carries its own. A [batch create](https://docs.mapier.ai/pod/api/sandboxes/create-sandbox) larger than your swarm cap answers [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded) with `limit: max_swarm`, and nothing is made. ## Durability [#durability] Losing a whole server can lose a sandbox's last writes, up to the durability window. Losing one drive loses nothing. Pod publishes the window here once it is measured. [Durability](https://docs.mapier.ai/pod/sandboxes/durability) says what is kept in each failure. # Add a proxy of your own for a project (https://docs.mapier.ai/pod/api/network/create-proxy) > A proxy the customer runs or rents. **POST** `/v1/proxies` A proxy the customer runs or rents. With `default_for_project` every sandbox of the project that follows its project leaves through it, and the old default's flag is cleared; otherwise a sandbox names it with `setSandboxExit`. HTTP CONNECT or SOCKS5, TCP only; names are resolved by the proxy. Its login (`credential`) is stored encrypted by Pod's secret broker on the way in and never answered again (`has_credential`). The address must be public, or in a customer's own cell, inside a registered private range (else `conflict` on `host`). A proxy that stops answering means refused connections, never traffic sent from Pod's own addresses. Needs the `own_proxy` entitlement (a verified account on a paid plan, refused with `conflict` on `patient_data` while that setting is on); `max_proxies` counts them per project. A key with the `network:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/proxies" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"label":"example","scheme":"http_connect","host":"example","port":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------------------- | ---------------------------- | -------- | --------------------------------------------------------------------------------------- | | `project` | `string` | No | The key's own project by default, and the only one it may name. A person must name one. | | `label` | `string` | Yes | | | `scheme` | `"http_connect" \| "socks5"` | Yes | HTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy. | | `host` | `string` | Yes | | | `port` | `integer` | Yes | From 1 to 65535. | | `tls` | `boolean` | No | Default `false`. | | `credential` | `ProxyCredential \| null` | No | | | `default_for_project` | `boolean` | No | Default `false`. | ## Answer [#answer] **201.** The proxy. ```json title="201" { "id": "prx_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "label": "example", "scheme": "http_connect", "host": "example", "port": 1, "tls": false, "has_credential": false, "default_for_project": false, "state": "ready", "version": 1, "updated_at": null, "updated_by": "example" } ``` | Field | Type | Always | What it is | | --------------------- | ---------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project_id` | `string` | Yes | | | `label` | `string` | Yes | | | `scheme` | `"http_connect" \| "socks5"` | Yes | HTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy. | | `host` | `string` | Yes | A DNS name or an address literal. | | `port` | `integer` | Yes | From 1 to 65535. | | `tls` | `boolean` | Yes | Speak TLS to the proxy itself. | | `has_credential` | `boolean` | Yes | | | `default_for_project` | `boolean` | Yes | Every sandbox of the project that follows its project leaves through it. At most one per project. | | `state` | `"ready" \| "login_failing"` | Yes | `login_failing` once the proxy keeps refusing the login: routes through it carry nothing until it is replaced with a new login. Treat a value you do not know as not ready. | | `version` | `integer` | Yes | Raised on each change. At least 1. | | `updated_at` | `string \| null` | Yes | | | `updated_by` | `string` | Yes | The person or key that last changed it. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`plan_required`](https://docs.mapier.ai/pod/api/errors#plan_required), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.network.proxies.create({ … })` | | Python | `pod.network.proxies.create({…})` | | mpod | `mpod proxies create` | # Take a static outbound address for a project (https://docs.mapier.ai/pod/api/network/create-static-address) > A fixed public address the project's sandboxes at that site leave from, for allowlists on the other end. **POST** `/v1/static-addresses` A fixed public address the project's sandboxes at that site leave from, for allowlists on the other end. It is outbound only; inbound traffic still reaches a sandbox through its port addresses and domains. A sandbox following its project (`setSandboxExit` `via: project`) leaves from it unless the project has a default proxy. The address stays the project's across sleep, wake and moves. Needs the `static_addresses` entitlement; `max_static_addresses` counts them per project and site. A site the cell does not run at is `invalid` on `site`. A key with the `network:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/static-addresses" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"site":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | -------- | -------- | --------------------------------------------------------------------------------------- | | `site` | `string` | Yes | A site the cell runs at; the catalog's `regions` names them. | | `project` | `string` | No | The key's own project by default, and the only one it may name. A person must name one. | ## Answer [#answer] **201.** The address, assigned. ```json title="201" { "id": "sip_3ahrz6dmv29gqy5ckt18fpx4b", "address": "example", "site": "example", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "assigned", "assigned_at": null, "cooling_until": null } ``` | Field | Type | Always | What it is | | --------------- | ------------------------- | ------ | ------------------------------------------------------------ | | `id` | `string` | Yes | | | `address` | `string` | Yes | The public IPv4 or IPv6 address. | | `site` | `string` | Yes | A site the cell runs at; the catalog's `regions` names them. | | `project_id` | `string` | Yes | | | `state` | `"assigned" \| "cooling"` | Yes | Treat a value you do not know as not assigned. | | `assigned_at` | `string \| null` | Yes | | | `cooling_until` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`plan_required`](https://docs.mapier.ai/pod/api/errors#plan_required), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------- | | TypeScript | `pod.network.staticAddresses.create({ site })` | | Python | `pod.network.static_addresses.create(site)` | | mpod | `mpod static-addresses create` | # Remove a proxy (https://docs.mapier.ai/pod/api/network/delete-proxy) > The project's default proxy is `conflict` until another is the default or its flag is cleared, and so is a proxy a sandbox names as its way out, until that sandbox's way out changes. **DELETE** `/v1/proxies/{proxy_id}` The project's default proxy is `conflict` until another is the default or its flag is cleared, and so is a proxy a sandbox names as its way out, until that sandbox's way out changes. Nothing ever falls back to Pod's own addresses by accident. Allowed whatever the account's standing or settings. A key with the `network:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/proxies/prx_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `proxy_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Removed. ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `pod.network.proxies.delete(id)` | | Python | `pod.network.proxies.delete(id)` | | mpod | `mpod proxies delete ` | # Read the organization's network settings and what its plan allows (https://docs.mapier.ai/pod/api/network/get-network-settings) > The patient-data setting, each network feature with whether the organization may use it and why not (`reasons`, in the order a refusal names them), and the network limits. **GET** `/v1/network` The patient-data setting, each network feature with whether the organization may use it and why not (`reasons`, in the order a refusal names them), and the network limits. The same entitlements travel to every cell in the signed standing list, so a feature refused here is refused by the cell with the error its first reason names: `account_restricted` (`limit: standing`) for an account past due or suspended, `plan_required` for an account that is not verified or on the free plan, and `conflict` (`field: patient_data`) for a home-connection feature while the patient-data setting is on. `customer_cells` names the cells inside the organization's own cloud account, the only cells that register private ranges. A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/network" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Answer [#answer] **200.** The organization's network settings. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "patient_data": false, "patient_data_set_by": null, "patient_data_set_at": null, "customer_cells": ["example"], "entitlements": [ { "feature": "custom_domains", "allowed": false, "reasons": ["standing"] } ], "limits": { "max_domains": 0, "max_static_addresses": 0, "max_private_ranges": 0, "max_proxies": 0, "max_leases": 0 } } ``` | Field | Type | Always | What it is | | --------------------- | ----------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `organisation` | `string` | Yes | | | `patient_data` | `boolean` | Yes | While true, the organization stays off home-connection addresses. | | `patient_data_set_by` | `string \| null` | Yes | The person who last changed it. | | `patient_data_set_at` | `string \| null` | Yes | | | `customer_cells` | `string[]` | Yes | The cells inside the organization's own cloud account, by tag. Private ranges are registered at such a cell's endpoint; empty for an organization that has none. | | `entitlements` | `NetworkFeatureEntitlement[]` | Yes | One entry per network feature. | | `limits` | `NetworkLimits` | Yes | The organization's network limits: its own where staff set one, else the plan's. Per project for `max_static_addresses` (at each site) and `max_proxies`, unless a project has its own. | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------ | | TypeScript | `pod.network.settings()` | | Python | `pod.network.settings()` | | mpod | `mpod network get` | # Get a proxy (https://docs.mapier.ai/pod/api/network/get-proxy) > Get a proxy **GET** `/v1/proxies/{proxy_id}` A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/proxies/prx_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ---------- | ---- | -------- | -------- | ---------- | | `proxy_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The proxy. ```json title="200" { "id": "prx_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "label": "example", "scheme": "http_connect", "host": "example", "port": 1, "tls": false, "has_credential": false, "default_for_project": false, "state": "ready", "version": 1, "updated_at": null, "updated_by": "example" } ``` | Field | Type | Always | What it is | | --------------------- | ---------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project_id` | `string` | Yes | | | `label` | `string` | Yes | | | `scheme` | `"http_connect" \| "socks5"` | Yes | HTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy. | | `host` | `string` | Yes | A DNS name or an address literal. | | `port` | `integer` | Yes | From 1 to 65535. | | `tls` | `boolean` | Yes | Speak TLS to the proxy itself. | | `has_credential` | `boolean` | Yes | | | `default_for_project` | `boolean` | Yes | Every sandbox of the project that follows its project leaves through it. At most one per project. | | `state` | `"ready" \| "login_failing"` | Yes | `login_failing` once the proxy keeps refusing the login: routes through it carry nothing until it is replaced with a new login. Treat a value you do not know as not ready. | | `version` | `integer` | Yes | Raised on each change. At least 1. | | `updated_at` | `string \| null` | Yes | | | `updated_by` | `string` | Yes | The person or key that last changed it. | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------- | | TypeScript | `pod.network.proxies.get(id)` | | Python | `pod.network.proxies.get(id)` | | mpod | `mpod proxies get ` | # Read how a sandbox's outbound traffic leaves (https://docs.mapier.ai/pod/api/network/get-sandbox-exit) > What the sandbox asked for (`via`) and where its traffic leaves now (`route`). **GET** `/v1/sandboxes/{sandbox_id}/exit` **Not available yet.** The API does not serve reading or choosing how a sandbox's outbound traffic leaves yet. What the sandbox asked for (`via`) and where its traffic leaves now (`route`). `carrying: false` while a home-connection route may not carry (the account lost its entitlement, the patient-data setting is on, the proxy's login keeps failing, or the organization is held): its traffic is then refused, never sent from Pod's own addresses. A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exit" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The sandbox's way out. ```json title="200" { "sandbox_id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "via": "project", "proxy_id": null, "home": null, "route": "pod", "static_address_id": null, "carrying": false, "version": 0, "updated_at": null } ``` | Field | Type | Always | What it is | | ------------------- | ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | `string` | Yes | | | `via` | `"project" \| "proxy" \| "home"` | Yes | What the sandbox asked for. | | `proxy_id` | `string \| null` | Yes | The proxy the traffic leaves through, named or the project's default; null otherwise. | | `home` | `HomeLease \| null` | Yes | The leased address, for `via: home`. | | `route` | `"pod" \| "static_address" \| "proxy" \| "home"` | Yes | Where the sandbox's traffic leaves now. Treat a value you do not know as not Pod's own addresses. | | `static_address_id` | `string \| null` | Yes | The project's static address the traffic leaves from, for `route: static_address`. | | `carrying` | `boolean` | Yes | False while the route may not carry; the sandbox's traffic is then refused, never sent from Pod's own addresses. | | `version` | `integer` | Yes | Raised by every change, a lease's renewal included. At least 0. | | `updated_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.network.exit(sandboxId)` | | Python | `pod.network.exit(sandbox_id)` | | mpod | `mpod sandboxes exit get ` | # Get a static address (https://docs.mapier.ai/pod/api/network/get-static-address) > Get a static address **GET** `/v1/static-addresses/{static_address_id}` A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/static-addresses/sip_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------- | ---- | -------- | -------- | ---------- | | `static_address_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The address. ```json title="200" { "id": "sip_3ahrz6dmv29gqy5ckt18fpx4b", "address": "example", "site": "example", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "assigned", "assigned_at": null, "cooling_until": null } ``` | Field | Type | Always | What it is | | --------------- | ------------------------- | ------ | ------------------------------------------------------------ | | `id` | `string` | Yes | | | `address` | `string` | Yes | The public IPv4 or IPv6 address. | | `site` | `string` | Yes | A site the cell runs at; the catalog's `regions` names them. | | `project_id` | `string` | Yes | | | `state` | `"assigned" \| "cooling"` | Yes | Treat a value you do not know as not assigned. | | `assigned_at` | `string \| null` | Yes | | | `cooling_until` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------- | | TypeScript | `pod.network.staticAddresses.get(id)` | | Python | `pod.network.static_addresses.get(id)` | | mpod | `mpod static-addresses get
` | # List the registered private ranges of your own cell (https://docs.mapier.ai/pod/api/network/list-private-ranges) > Newest first. **GET** `/v1/private-ranges` Newest first. Empty in Pod's own cells, and for any organization but the cell's owner. A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/private-ranges" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ----- | --------- | -------- | --------------------------------------------------------- | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of ranges, newest first. ```json title="200" { "data": [ { "id": "prg_3ahrz6dmv29gqy5ckt18fpx4b", "cidr": "example", "label": "example", "created_at": null, "created_by": "example" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `PrivateRange[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.network.privateRanges.list()` | | Python | `pod.network.private_ranges.list()` | | mpod | `mpod private-ranges list` | # List a project's proxies (https://docs.mapier.ai/pod/api/network/list-proxies) > List a project's proxies **GET** `/v1/proxies` A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/proxies" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | --------- | -------- | --------------------------------------------------------------------------------------------------- | | `project` | query | `string` | No | The project to list. A key lists its own; a person whose role reaches only some projects names one. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of proxies, newest first. ```json title="200" { "data": [ { "id": "prx_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "label": "example", "scheme": "http_connect", "host": "example", "port": 1, "tls": false, "has_credential": false, "default_for_project": false, "state": "ready", "version": 1, "updated_at": null, "updated_by": "example" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Proxy[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------- | | TypeScript | `pod.network.proxies.list()` | | Python | `pod.network.proxies.list()` | | mpod | `mpod proxies list` | # List static addresses (https://docs.mapier.ai/pod/api/network/list-static-addresses) > The project's addresses, assigned and cooling, newest first. **GET** `/v1/static-addresses` The project's addresses, assigned and cooling, newest first. A key with the `network:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/static-addresses" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | --------- | -------- | --------------------------------------------------------------------------------------------------- | | `project` | query | `string` | No | The project to list. A key lists its own; a person whose role reaches only some projects names one. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of addresses, newest first. ```json title="200" { "data": [ { "id": "sip_3ahrz6dmv29gqy5ckt18fpx4b", "address": "example", "site": "example", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "assigned", "assigned_at": null, "cooling_until": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ----------------- | ------ | ---------- | | `data` | `StaticAddress[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------- | | TypeScript | `pod.network.staticAddresses.list()` | | Python | `pod.network.static_addresses.list()` | | mpod | `mpod static-addresses list` | # Register a range of your own private network in your own cell (https://docs.mapier.ai/pod/api/network/register-private-range) > In a cell inside the customer's own cloud account, sandboxes may reach a range of the customer's private network that is registered here and that a policy grants; either alone opens nothing. **POST** `/v1/private-ranges` In a cell inside the customer's own cloud account, sandboxes may reach a range of the customer's private network that is registered here and that a policy grants; either alone opens nothing. Only the cell's owner organization registers, with `network:write`; Pod's own cells answer `not_supported`. The range is canonical CIDR wholly inside `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16` or `fc00::/7`. The cell's own networks, its storage and key endpoints, the metadata addresses and the sandbox's own network can never be registered (`invalid` on `cidr`); a range overlapping one already registered is `conflict`. `max_private_ranges` counts them. Slots take the new range within seconds. A key with the `network:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/private-ranges" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"cidr":"example","label":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------- | -------- | -------- | --------------------------------------------------------------------------------------------- | | `cidr` | `string` | Yes | An address range in canonical CIDR form, no bit set after the prefix, such as `10.20.0.0/16`. | | `label` | `string` | Yes | | ## Answer [#answer] **201.** The range, registered. ```json title="201" { "id": "prg_3ahrz6dmv29gqy5ckt18fpx4b", "cidr": "example", "label": "example", "created_at": null, "created_by": "example" } ``` | Field | Type | Always | What it is | | ------------ | ---------------- | ------ | --------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `cidr` | `string` | Yes | An address range in canonical CIDR form, no bit set after the prefix, such as `10.20.0.0/16`. | | `label` | `string` | Yes | | | `created_at` | `string \| null` | Yes | | | `created_by` | `string` | Yes | The person or key that registered it. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------------------- | | TypeScript | `pod.network.privateRanges.register({ cidr, label })` | | Python | `pod.network.private_ranges.register(cidr, label)` | | mpod | `mpod private-ranges register ` | # Release a static address (https://docs.mapier.ai/pod/api/network/release-static-address) > The project's sandboxes stop leaving from it. **DELETE** `/v1/static-addresses/{static_address_id}` The project's sandboxes stop leaving from it. It cools for 30 days before anyone else may be given it, and the project may take it back meanwhile by asking for an address at the same site. A repeat answers the address as it is. A key with the `network:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/static-addresses/sip_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------- | ------ | -------- | -------- | ---------------------------------------------- | | `static_address_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The address, cooling. ```json title="200" { "id": "sip_3ahrz6dmv29gqy5ckt18fpx4b", "address": "example", "site": "example", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "assigned", "assigned_at": null, "cooling_until": null } ``` | Field | Type | Always | What it is | | --------------- | ------------------------- | ------ | ------------------------------------------------------------ | | `id` | `string` | Yes | | | `address` | `string` | Yes | The public IPv4 or IPv6 address. | | `site` | `string` | Yes | A site the cell runs at; the catalog's `regions` names them. | | `project_id` | `string` | Yes | | | `state` | `"assigned" \| "cooling"` | Yes | Treat a value you do not know as not assigned. | | `assigned_at` | `string \| null` | Yes | | | `cooling_until` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------ | | TypeScript | `pod.network.staticAddresses.release(id)` | | Python | `pod.network.static_addresses.release(id)` | | mpod | `mpod static-addresses release
` | # Remove a registered private range (https://docs.mapier.ai/pod/api/network/remove-private-range) > A policy grant inside it stops working at once. **DELETE** `/v1/private-ranges/{range_id}` A policy grant inside it stops working at once. A range a proxy's address is in is `conflict`: replace or remove the proxy first. A key with the `network:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/private-ranges/prg_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `range_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Removed. ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------- | | TypeScript | `pod.network.privateRanges.remove(id)` | | Python | `pod.network.private_ranges.remove(id)` | | mpod | `mpod private-ranges remove ` | # Replace a proxy (https://docs.mapier.ai/pod/api/network/replace-proxy) > Every field is the request's; a `credential` left out keeps the one held, and `null` removes it. **PUT** `/v1/proxies/{proxy_id}` Every field is the request's; a `credential` left out keeps the one held, and `null` removes it. Replacing the project's default with `default_for_project: false` is `conflict` unless `clear_default` is true, so changing a label or a port never sends the project's traffic from Pod's own addresses by accident. A call that only clears the default (`clear_default`, every other field as held) is allowed whatever the account's standing or settings, so an account that lost its entitlement can stop routing through the proxy and then remove it. Any other replace needs the `own_proxy` entitlement. A key with the `network:write` scope. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/proxies/prx_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"label":"example","scheme":"http_connect","host":"example","port":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `proxy_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------------------- | ---------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `label` | `string` | Yes | | | `scheme` | `"http_connect" \| "socks5"` | Yes | HTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy. | | `host` | `string` | Yes | | | `port` | `integer` | Yes | From 1 to 65535. | | `tls` | `boolean` | No | Default `false`. | | `credential` | `ProxyCredential \| null` | No | Left out keeps the login held; null removes it. | | `default_for_project` | `boolean` | No | Default `false`. | | `clear_default` | `boolean` | No | With `default_for_project: false` on the project's default: the project has no default proxy afterwards. The one way to stop a project's default on purpose. `invalid` with `default_for_project: true`. Default `false`. | ## Answer [#answer] **200.** The proxy as it is now. ```json title="200" { "id": "prx_3ahrz6dmv29gqy5ckt18fpx4b", "project_id": "prj_3ahrz6dmv29gqy5ckt18fp", "label": "example", "scheme": "http_connect", "host": "example", "port": 1, "tls": false, "has_credential": false, "default_for_project": false, "state": "ready", "version": 1, "updated_at": null, "updated_by": "example" } ``` | Field | Type | Always | What it is | | --------------------- | ---------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project_id` | `string` | Yes | | | `label` | `string` | Yes | | | `scheme` | `"http_connect" \| "socks5"` | Yes | HTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy. | | `host` | `string` | Yes | A DNS name or an address literal. | | `port` | `integer` | Yes | From 1 to 65535. | | `tls` | `boolean` | Yes | Speak TLS to the proxy itself. | | `has_credential` | `boolean` | Yes | | | `default_for_project` | `boolean` | Yes | Every sandbox of the project that follows its project leaves through it. At most one per project. | | `state` | `"ready" \| "login_failing"` | Yes | `login_failing` once the proxy keeps refusing the login: routes through it carry nothing until it is replaced with a new login. Treat a value you do not know as not ready. | | `version` | `integer` | Yes | Raised on each change. At least 1. | | `updated_at` | `string \| null` | Yes | | | `updated_by` | `string` | Yes | The person or key that last changed it. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`plan_required`](https://docs.mapier.ai/pod/api/errors#plan_required), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------- | | TypeScript | `pod.network.proxies.replace(id, { … })` | | Python | `pod.network.proxies.replace(id, {…})` | | mpod | `mpod proxies replace ` | # Choose how a sandbox's outbound traffic leaves (https://docs.mapier.ai/pod/api/network/set-sandbox-exit) > `via: project` follows the project: its default proxy, else its static address at the sandbox's site, else Pod's own addresses. **PUT** `/v1/sandboxes/{sandbox_id}/exit` **Not available yet.** The API does not serve reading or choosing how a sandbox's outbound traffic leaves yet. `via: project` follows the project: its default proxy, else its static address at the sandbox's site, else Pod's own addresses. `via: proxy` names one of the project's proxies. `via: home` leases an address on a home connection that Pod resells from a provider, sticky for `session_minutes` or new per connection; `max_leases` counts the organization's. A replaced lease is given back. The way out follows the sandbox across sleep, wake and moves. `proxy` needs the `own_proxy` entitlement and `home` the `leased_home_addresses` one; both are refused with `conflict` on `patient_data` while that setting is on. `project` is always allowed, so a sandbox can be taken off a home route whatever the account's standing. A key with the `network:write` scope. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exit" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"via":"project"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ---------- | -------------------------------- | -------- | -------------------------------------------------------------- | | `via` | `"project" \| "proxy" \| "home"` | Yes | What the sandbox asked for. | | `proxy_id` | `string` | No | For `via: proxy`, one of the project's proxies; not otherwise. | | `home` | `HomeLeaseRequest` | No | For `via: home`; not otherwise. | ## Answer [#answer] **200.** The sandbox's way out as it is now. ```json title="200" { "sandbox_id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "via": "project", "proxy_id": null, "home": null, "route": "pod", "static_address_id": null, "carrying": false, "version": 0, "updated_at": null } ``` | Field | Type | Always | What it is | | ------------------- | ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | `string` | Yes | | | `via` | `"project" \| "proxy" \| "home"` | Yes | What the sandbox asked for. | | `proxy_id` | `string \| null` | Yes | The proxy the traffic leaves through, named or the project's default; null otherwise. | | `home` | `HomeLease \| null` | Yes | The leased address, for `via: home`. | | `route` | `"pod" \| "static_address" \| "proxy" \| "home"` | Yes | Where the sandbox's traffic leaves now. Treat a value you do not know as not Pod's own addresses. | | `static_address_id` | `string \| null` | Yes | The project's static address the traffic leaves from, for `route: static_address`. | | `carrying` | `boolean` | Yes | False while the route may not carry; the sandbox's traffic is then refused, never sent from Pod's own addresses. | | `version` | `integer` | Yes | Raised by every change, a lease's renewal included. At least 0. | | `updated_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`plan_required`](https://docs.mapier.ai/pod/api/errors#plan_required), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------- | | TypeScript | `pod.network.setExit(sandboxId, { via })` | | Python | `pod.network.set_exit(sandbox_id, {…})` | | mpod | `mpod sandboxes exit set ` | # Turn the patient-data setting on or off (https://docs.mapier.ai/pod/api/network/update-network-settings) > With `patient_data: true` the organization stays off home-connection addresses: a customer's own proxy and addresses resold from a provider are refused with `conflict` (`field: patient_data`), and what already routes through one stops carrying at once, with refused connections, never by sending the traffic from Pod's own addresses instead. **PATCH** `/v1/network` With `patient_data: true` the organization stays off home-connection addresses: a customer's own proxy and addresses resold from a provider are refused with `conflict` (`field: patient_data`), and what already routes through one stops carrying at once, with refused connections, never by sending the traffic from Pod's own addresses instead. Nothing is deleted. Turning it off lets them back in. People only: a signed-in owner or admin with a fresh second factor. An API key, and a person whose second factor is not fresh, answer `person_required`; another role answers `forbidden`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X PATCH "https://api.pod.mapier.ai/v1/network" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"patient_data":true}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------- | -------- | ---------- | | `patient_data` | `boolean` | Yes | | ## Answer [#answer] **200.** The settings as they count now. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "patient_data": false, "patient_data_set_by": null, "patient_data_set_at": null, "customer_cells": ["example"], "entitlements": [ { "feature": "custom_domains", "allowed": false, "reasons": ["standing"] } ], "limits": { "max_domains": 0, "max_static_addresses": 0, "max_private_ranges": 0, "max_proxies": 0, "max_leases": 0 } } ``` | Field | Type | Always | What it is | | --------------------- | ----------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `organisation` | `string` | Yes | | | `patient_data` | `boolean` | Yes | While true, the organization stays off home-connection addresses. | | `patient_data_set_by` | `string \| null` | Yes | The person who last changed it. | | `patient_data_set_at` | `string \| null` | Yes | | | `customer_cells` | `string[]` | Yes | The cells inside the organization's own cloud account, by tag. Private ranges are registered at such a cell's endpoint; empty for an organization that has none. | | `entitlements` | `NetworkFeatureEntitlement[]` | Yes | One entry per network feature. | | `limits` | `NetworkLimits` | Yes | The organization's network limits: its own where staff set one, else the plan's. Per project for `max_static_addresses` (at each site) and `max_proxies`, unless a project has its own. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------- | | TypeScript | `pod.network.setPatientData(on)` | | Python | `pod.network.set_patient_data(on)` | | mpod | `mpod network set` | # Read which notices you get, and where (https://docs.mapier.ai/pod/api/notices/get-notification-preferences) > The signed-in person's choices in the organization, one row per category their role hears. **GET** `/v1/notification_preferences` The signed-in person's choices in the organization, one row per category their role hears. A channel in `required` cannot be turned off (maintenance email: customers are told of outages and maintenance pauses). For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/notification_preferences" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Answer [#answer] **200.** The person's preferences. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "data": [ { "category": "billing", "email": false, "dashboard": false, "required": ["email"] } ] } ``` | Field | Type | Always | What it is | | -------------- | -------------------------- | ------ | ---------- | | `organisation` | `string` | Yes | | | `data` | `NotificationPreference[]` | Yes | | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.notices.preferences()` | | Python | `pod.notices.preferences()` | | mpod | `mpod notification-preferences get` | # List the notices Pod sent the organization's people (https://docs.mapier.ai/pod/api/notices/list-notices) > Notices of the last 90 days in the categories the person's role hears, newest first: billing, spend caps, members, maintenance (sandboxes moved for a security fix) and webhooks. **GET** `/v1/notices` Notices of the last 90 days in the categories the person's role hears, newest first: billing, spend caps, members, maintenance (sandboxes moved for a security fix) and webhooks. The dashboard shows them, and the maintenance ones in its banner. A signed-in person only. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/notices" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ---------- | ----- | ------------------------------------------------------------------ | -------- | --------------------------------------------------------- | | `category` | query | `"billing" \| "spend" \| "members" \| "maintenance" \| "webhooks"` | No | Only this category. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of notices, newest first. ```json title="200" { "data": [ { "id": "ntc_3ahrz6dmv29gqy5ckt18fp", "kind": "billing.invoice_overdue", "category": "billing", "severity": "info", "title": "example", "summary": "example", "target_type": null, "target_id": null, "by": null, "created_at": "2026-11-23T12:00:00.000Z" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Notice[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------- | | TypeScript | `pod.notices.list()` | | Python | `pod.notices.list()` | | mpod | `mpod notices list` | # Choose which notices you get, and where (https://docs.mapier.ai/pod/api/notices/set-notification-preferences) > Sets the person's own choices for the categories named; a category not named keeps its setting. **PUT** `/v1/notification_preferences` Sets the person's own choices for the categories named; a category not named keeps its setting. Turning off a required channel, or naming a category the person's role does not hear, is `invalid` naming `preferences`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/notification_preferences" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"preferences":[{"category":"billing"}]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------- | ---------- | -------- | ---------- | | `preferences` | `object[]` | Yes | | ## Answer [#answer] **200.** The person's preferences as they count now. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "data": [ { "category": "billing", "email": false, "dashboard": false, "required": ["email"] } ] } ``` | Field | Type | Always | What it is | | -------------- | -------------------------- | ------ | ---------- | | `organisation` | `string` | Yes | | | `data` | `NotificationPreference[]` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------- | | TypeScript | `pod.notices.setPreferences(preferences)` | | Python | `pod.notices.set_preferences(preferences)` | | mpod | `mpod notification-preferences set ` | # Get an operation started by a `202` (https://docs.mapier.ai/pod/api/operations/get-operation) > Get an operation started by a `202` **GET** `/v1/operations/{operation_id}` A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/operations/op_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ---- | -------- | -------- | ---------- | | `operation_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The operation. ```json title="200" { "id": "op_3ahrz6dmv29gqy5ckt18fpx4b", "kind": "sleep", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "running", "created_at": "2026-11-23T12:00:00.000Z", "finished_at": null, "error": null, "snapshot": null, "sandboxes": null, "first_actions": null } ``` | Field | Type | Always | What it is | | --------------- | ---------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `kind` | `"sleep" \| "wake" \| "stop" \| "start" \| "resize" \| "snapshot" \| "fork" \| "delete"` | Yes | | | `sandbox` | `string` | Yes | | | `state` | `"running" \| "succeeded" \| "failed"` | Yes | | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `finished_at` | `string \| null` | Yes | | | `error` | `Error \| null` | Yes | Set when `failed`. | | `snapshot` | `string \| null` | Yes | For a snapshot, the snapshot made. | | `sandboxes` | `string[] \| null` | Yes | For a fork, the copies made. | | `first_actions` | `FirstActionRun[] \| null` | Yes | For a fork with `first_action`, each copy's command. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `pod.operations.get(id)` | | Python | `pod.operations.get(id)` | | mpod | `mpod operations get ` | # Join an organization with an invitation (https://docs.mapier.ai/pod/api/organisations/accept-invitation) > People only, with a fresh second factor: the signed-in person who presents the secret joins with the invitation's role and projects. **POST** `/v1/invitations/accept` People only, with a fresh second factor: the signed-in person who presents the secret joins with the invitation's role and projects. An invitation that is unknown, expired, revoked or accepted by someone else is `not_found`, so a secret cannot be probed; a repeat by the person who accepted it answers the same membership. A person already in the organization is `conflict`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/invitations/accept" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"invitation":"pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | -------- | -------- | ---------------------------------------------------------------------------- | | `invitation` | `string` | Yes | Shown once, to the person who invited. Stored by Pod only as a SHA-256 hash. | ## Answer [#answer] **200.** The organization joined and the new membership. ```json title="200" { "organisation": { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null }, "member": { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "role": "owner", "projects": null, "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": null, "max_awake": null }, "spend_cap": null } } ``` | Field | Type | Always | What it is | | -------------- | -------------- | ------ | ---------- | | `organisation` | `Organisation` | Yes | | | `member` | `Member` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------- | | TypeScript | `pod.organisations.invitations.accept(secret)` | | Python | `pod.organisations.invitations.accept(secret)` | | mpod | `mpod invitations accept ` | # Claim an organization an agent started (https://docs.mapier.ai/pod/api/organisations/claim-signup) > A signed-in person claims the sign-up whose claim secret they hold (the fragment of the claim link), accepts the sign-up documents (`accept`, as for `createOrganisation`) and becomes its one owner and payer. **POST** `/v1/signups/claim` A signed-in person claims the sign-up whose claim secret they hold (the fragment of the claim link), accepts the sign-up documents (`accept`, as for `createOrganisation`) and becomes its one owner and payer. The organization then joins the free plan in the `new` trust tier, its sign-up caps are lifted, and its test key becomes the person's. A repeat by the same person answers the same organization (`200`). A claim that is unknown, expired or someone else's is `not_found`; a document version that changed is `conflict`. The caps on free organizations per person apply (`conflict`). An API key answers `person_required`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/signups/claim" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"claim":"pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm","accept":{"terms":"example","acceptable_use":"example","privacy":"example"}}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------ | | `claim` | `string` | Yes | Answered once, inside the claim link. Stored by Pod only as a SHA-256 hash. | | `name` | `string` | No | A new name for the organization. | | `accept` | `LegalAcceptance` | Yes | For public sign-up: the version of each sign-up document the person read and accepts. Not with `invitation`. | ## Answer [#answer] **200.** The organization, claimed. ```json title="200" { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null } ``` | Field | Type | Always | What it is | | ------------ | ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `plan` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer" \| null` | Yes | The calling person's role; null for an API key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `closure` | `Closure \| null` | Yes | The last closure, or null if it was never closed. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `pod.signups.claim(claim, { … })` | | Python | `pod.signups.claim(claim, …)` | | mpod | `mpod signups claim ` | # Close the organization (https://docs.mapier.ai/pod/api/organisations/close-organisation) > People only, with a fresh second factor: only an owner closes an organization, and `confirm` must be its name exactly. **POST** `/v1/organisations/{org_id}/close` People only, with a fresh second factor: only an owner closes an organization, and `confirm` must be its name exactly. In one change every key and service grant is revoked (refused everywhere within 60 seconds), the standing becomes `closed`, so anything still naming the organization is refused with `account_restricted`, and the closure is recorded. The billing subscription then ends; an open invoice stays open. An owner may reopen it until `closure.reopen_until`; after that the organization's encryption key is destroyed, its members are removed, and only the records the data retention page lists are kept. Closing a closed organization is `conflict`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/close" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"confirm":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | -------- | -------- | --------------------------------- | | `confirm` | `string` | Yes | The organization's name, exactly. | ## Answer [#answer] **200.** The organization, closed, with its closure. ```json title="200" { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null } ``` | Field | Type | Always | What it is | | ------------ | ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `plan` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer" \| null` | Yes | The calling person's role; null for an API key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `closure` | `Closure \| null` | Yes | The last closure, or null if it was never closed. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------- | | TypeScript | `pod.organisations.close(orgId, name)` | | Python | `pod.organisations.close(org_id, name)` | | mpod | `mpod organisations close ` | # Invite a person to the organization (https://docs.mapier.ai/pod/api/organisations/create-invitation) > People only, with a fresh second factor. **POST** `/v1/organisations/{org_id}/invitations` People only, with a fresh second factor. An owner or an admin invites; only an owner invites an owner. The secret is answered this once, with `Cache-Control: no-store`, and stored only as a SHA-256 hash; a repeat with the same `Idempotency-Key` answers `conflict` rather than the secret again. Whoever presents the secret, signed in, joins with the role and projects named here, so hand it only to the person invited. When `email` is given, Pod also sends the invitation there. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/invitations" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"role":"owner"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | -------------------------------------------- | -------- | --------------------------------------------------------------------------- | | `role` | `"owner" \| "admin" \| "member" \| "viewer"` | Yes | See `listRoles` for what each holds. `owner` and `admin` see every project. | | `email` | `string` | No | | | `projects` | `MemberProjects` | No | The projects a member or viewer reaches; null for every project. | | `expires_in_s` | `integer` | No | Default `604800`. From 3600 to 2592000. | ## Answer [#answer] **201.** The invitation and its secret, shown this once. ```json title="201" { "invitation": { "id": "inv_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "email": null, "role": "owner", "projects": null, "state": "pending", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "accepted_by": null, "accepted_at": null }, "secret": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ``` | Field | Type | Always | What it is | | ------------ | ------------ | ------ | ---------------------------------------------------------------------------- | | `invitation` | `Invitation` | Yes | | | `secret` | `string` | Yes | Shown once, to the person who invited. Stored by Pod only as a SHA-256 hash. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------------- | | TypeScript | `pod.organisations.invitations.create(orgId, { … })` | | Python | `pod.organisations.invitations.create(org_id, …)` | | mpod | `mpod organisations invitations create ` | # Make an organization, from an invitation or by signing up (https://docs.mapier.ai/pod/api/organisations/create-organisation) > A signed-in person makes an organization and is its one owner. **POST** `/v1/organisations` A signed-in person makes an organization and is its one owner. With `invitation`, a staff invitation is redeemed (invited customers): a repeat by the same person answers the organization it made (`200`), and an invitation that is unknown, expired or someone else's is `not_found`. With `accept`, the person signs up (public sign-up): it is `forbidden` while public sign-up is closed, and the organization starts on the free plan in the `new` trust tier. `accept` names, for every document a person accepts at sign-up, the version they read; a version that is no longer the current one is `conflict`, so the person reads it again. Sign-ups are capped per network and a person holds a limited number of free organizations, against abuse of the free plan (`rate_limited`, with `retry_after_s`; `conflict`). Send exactly one of `invitation` and `accept`. An API key answers `person_required`: only a person signs up. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/organisations" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------ | | `name` | `string` | Yes | | | `invitation` | `string` | No | A staff invitation's token. Not with `accept`. | | `accept` | `LegalAcceptance` | No | For public sign-up: the version of each sign-up document the person read and accepts. Not with `invitation`. | ## Answer [#answer] **200.** The organization this person already made from this invitation, or with this key. **201.** The organization, made. ```json title="200" { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null } ``` | Field | Type | Always | What it is | | ------------ | ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `plan` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer" \| null` | Yes | The calling person's role; null for an API key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `closure` | `Closure \| null` | Yes | The last closure, or null if it was never closed. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------- | | TypeScript | `pod.organisations.create({ name, … })` | | Python | `pod.organisations.create(name, …)` | | mpod | `mpod organisations create ` | # Start a sign-up as an agent (https://docs.mapier.ai/pod/api/organisations/create-signup) > An agent with no account starts one: Pod makes a pending organization with one project and one test key, and answers the key and a claim link. **POST** `/v1/signups` An agent with no account starts one: Pod makes a pending organization with one project and one test key, and answers the key and a claim link. Use the key at once; test usage is never billed, and until a person claims the organization it is held to 1 sandbox, 1 awake at a time. Give the link to your person: they sign in, accept the legal documents and become the owner, and the payer. Unclaimed after 72 hours, the sign-up expires and its key stops working. Takes no credential. Only where public sign-up is open (`forbidden` otherwise), and capped per network an hour (`rate_limited`, with `retry_after_s`). The answer holds the key's secret and the claim link: it is sent with `Cache-Control: no-store` and never kept for a replay, so the call takes no `Idempotency-Key`. Open to everyone: send it with no key. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/signups" \ -H "Content-Type: application/json" \ -d '{"name":"example"}' ``` ## Body [#body] | Field | Type | Required | What it is | | ------ | -------- | -------- | --------------------------------------------------------------------- | | `name` | `string` | No | The organization's name; the person may change it when they claim it. | ## Answer [#answer] **201.** The pending organization, its test key and the claim link, shown this once. ```json title="201" { "id": "sgu_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "key": { "key": { "id": "key_3ahrz6dmv29gqy5ckt18fp", "name": "example", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "mode": "test", "class": "person", "scopes": ["sandboxes:read"], "last_four": "example", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": null, "revoked_at": null, "service": null, "billing_mark": null, "parent_sandbox": null, "parent_scopes": null, "last_used_at": null, "rotated_at": null, "previous_secret_until": null }, "secret": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" }, "claim_url": "https://app.example.com", "state": "pending", "expires_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | -------------- | ------------------------------------- | ------ | ------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `organisation` | `string` | Yes | | | `project` | `string` | Yes | | | `key` | `CreatedKey` | Yes | | | `claim_url` | `string` | Yes | The dashboard page your person opens to claim the organization; the secret is its fragment. | | `state` | `"pending" \| "claimed" \| "expired"` | Yes | | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------- | | TypeScript | `pod.signups.start({ … })` | | Python | `pod.signups.start(…)` | | mpod | `mpod signups create` | # Get a member (https://docs.mapier.ai/pod/api/organisations/get-member) > Get a member **GET** `/v1/organisations/{org_id}/members/{account}` A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/members/example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ---- | -------- | -------- | --------------------------------- | | `org_id` | path | `string` | Yes | | | `account` | path | `string` | Yes | The member's identity account id. | ## Answer [#answer] **200.** The member. ```json title="200" { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "role": "owner", "projects": null, "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": null, "max_awake": null }, "spend_cap": null } ``` | Field | Type | Always | What it is | | -------------- | -------------------------------------------- | ------ | ---------------------------------------------------------------------------- | | `account` | `string` | Yes | An identity account id, the `sub` of the person's Mapier identity token. | | `organisation` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer"` | Yes | See `listRoles` for what each holds. `owner` and `admin` see every project. | | `projects` | `MemberProjects` | Yes | The projects a member or viewer reaches; null for every project. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `object` | Yes | The member's own count limits (`setMemberLimits`); null fields are no limit. | | `spend_cap` | `MemberSpendCap \| null` | Yes | The member's own spend cap this month; null when none is set. | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------ | | TypeScript | `pod.organisations.members.get(orgId, account)` | | Python | `pod.organisations.members.get(org_id, account)` | | mpod | `mpod organisations members get ` | # Get an organization (https://docs.mapier.ai/pod/api/organisations/get-organisation) > Another organization, or one the person does not belong to, is `not_found`. **GET** `/v1/organisations/{org_id}` Another organization, or one the person does not belong to, is `not_found`. A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ---- | -------- | -------- | ---------- | | `org_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The organization. ```json title="200" { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null } ``` | Field | Type | Always | What it is | | ------------ | ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `plan` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer" \| null` | Yes | The calling person's role; null for an API key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `closure` | `Closure \| null` | Yes | The last closure, or null if it was never closed. | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------ | | TypeScript | `pod.organisations.get(id)` | | Python | `pod.organisations.get(id)` | | mpod | `mpod organisations get ` | # Read the organization's data and privacy settings (https://docs.mapier.ai/pod/api/organisations/get-privacy) > The Data & privacy switches: as set, and as the cell applies them (`effective`: zero data retention also turns snapshots off). **GET** `/v1/organisations/{org_id}/privacy` The Data & privacy switches: as set, and as the cell applies them (`effective`: zero data retention also turns snapshots off). A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/privacy" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ---- | -------- | -------- | ---------- | | `org_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The settings. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "settings": { "zero_data_retention": false, "snapshots_off": false, "monitoring_off": false }, "effective": { "zero_data_retention": false, "snapshots_off": false, "monitoring_off": false }, "set_by": null, "set_at": null } ``` | Field | Type | Always | What it is | | -------------- | ----------------- | ------ | -------------------------------------------- | | `organisation` | `string` | Yes | | | `settings` | `PrivacySettings` | Yes | | | `effective` | `PrivacySettings` | Yes | | | `set_by` | `string \| null` | Yes | The identity account that last changed them. | | `set_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `pod.organisations.privacy(orgId)` | | Python | `pod.organisations.privacy(org_id)` | | mpod | `mpod organisations privacy ` | # Read whether a person has claimed the sign-up (https://docs.mapier.ai/pod/api/organisations/get-signup) > The agent polls this with the sign-up's test key: `pending` until a person claims it, then `claimed`, or `expired`. **GET** `/v1/signups/{signup_id}` The agent polls this with the sign-up's test key: `pending` until a person claims it, then `claimed`, or `expired`. `next_step` says what to tell the person. A key of any other organization is `not_found`. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/signups/sgu_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------- | ---- | -------- | -------- | ---------- | | `signup_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The sign-up. ```json title="200" { "id": "sgu_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "state": "pending", "next_step": "claim", "expires_at": "2026-11-23T12:00:00.000Z", "claimed_at": null } ``` | Field | Type | Always | What it is | | -------------- | ------------------------------------- | ------ | ------------------------------------------------------------------------------------ | | `id` | `string` | Yes | | | `organisation` | `string` | Yes | | | `state` | `"pending" \| "claimed" \| "expired"` | Yes | | | `next_step` | `"claim" \| "done" \| "start_again"` | Yes | What to tell your person: open the claim link, nothing more, or start a new sign-up. | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `claimed_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------- | | TypeScript | `pod.signups.get(id)` | | Python | `pod.signups.get(id)` | | mpod | `mpod signups get ` | # Read the organization's audit log (https://docs.mapier.ai/pod/api/organisations/list-audit-events) > Every change a person, a key or Mapier staff made in the organization, and every operator access to its sandboxes or data (`actor_kind: operator`, `action: operator_access.granted` and `.ended`, with who asked, who approved and why), newest first, kept 90 days. **GET** `/v1/organisations/{org_id}/audit` Every change a person, a key or Mapier staff made in the organization, and every operator access to its sandboxes or data (`actor_kind: operator`, `action: operator_access.granted` and `.ended`, with who asked, who approved and why), newest first, kept 90 days. Owners and admins only; any other member is `forbidden`. A signed-in person only. Metadata never holds a secret. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/audit" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ----- | ------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------- | | `org_id` | path | `string` | Yes | | | `action` | query | `string` | No | Only this action, or every action starting with this prefix and a dot (`member`, `key`). | | `actor_kind` | query | `"person" \| "key" \| "staff" \| "cell" \| "billing" \| "service" \| "operator" \| "system" \| "agent"` | No | Only this kind of actor; `operator` lists operator access. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of events, newest first. ```json title="200" { "data": [ { "id": "example", "action": "example", "actor_kind": "person", "actor_account": null, "actor_key": null, "target_type": null, "target_id": null, "metadata": {}, "address": null, "fresh_second_factor": false, "at": "2026-11-23T12:00:00.000Z" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `AuditEvent[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `pod.organisations.audit(orgId)` | | Python | `pod.organisations.audit(org_id)` | | mpod | `mpod organisations audit ` | # List an organization's invitations (https://docs.mapier.ai/pod/api/organisations/list-invitations) > Never answers an invitation's secret. **GET** `/v1/organisations/{org_id}/invitations` Never answers an invitation's secret. A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/invitations" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ----- | --------------------------------------------------- | -------- | --------------------------------------------------------- | | `org_id` | path | `string` | Yes | | | `state` | query | `"pending" \| "accepted" \| "revoked" \| "expired"` | No | | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of invitations, newest first. ```json title="200" { "data": [ { "id": "inv_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "email": null, "role": "owner", "projects": null, "state": "pending", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "accepted_by": null, "accepted_at": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Invitation[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------- | | TypeScript | `pod.organisations.invitations.list(orgId)` | | Python | `pod.organisations.invitations.list(org_id)` | | mpod | `mpod organisations invitations list ` | # List an organization's members (https://docs.mapier.ai/pod/api/organisations/list-members) > Each member is an identity account with a role and, for a member or viewer, their projects. **GET** `/v1/organisations/{org_id}/members` Each member is an identity account with a role and, for a member or viewer, their projects. A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/members" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ----- | --------- | -------- | --------------------------------------------------------- | | `org_id` | path | `string` | Yes | | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of members, newest first. ```json title="200" { "data": [ { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "role": "owner", "projects": null, "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": null, "max_awake": null }, "spend_cap": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Member[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------- | | TypeScript | `pod.organisations.members.list(orgId)` | | Python | `pod.organisations.members.list(org_id)` | | mpod | `mpod organisations members list ` | # List the caller's organizations (https://docs.mapier.ai/pod/api/organisations/list-organisations) > A person's token lists every organization the person belongs to, with their role in each; an API key lists its own organization, with `role` null. **GET** `/v1/organisations` A person's token lists every organization the person belongs to, with their role in each; an API key lists its own organization, with `role` null. A person who belongs to several names one in the `Pod-Organisation` header on calls that do not name it in the path. A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/organisations" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Answer [#answer] **200.** The organizations, newest first. ```json title="200" { "data": [ { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Organisation[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------- | | TypeScript | `pod.organisations.list()` | | Python | `pod.organisations.list()` | | mpod | `mpod organisations list` | # List the roles a member may hold (https://docs.mapier.ai/pod/api/organisations/list-roles) > The roles, highest first, each with the scopes it holds and the rights no scope carries. **GET** `/v1/roles` The roles, highest first, each with the scopes it holds and the rights no scope carries. A key with the `members:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/roles" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Answer [#answer] **200.** The roles. ```json title="200" { "data": [ { "name": "owner", "rank": 0, "scopes": ["sandboxes:read"], "every_project": false, "manages_members": false, "description": "example" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `RoleInfo[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------- | | TypeScript | `pod.organisations.roles()` | | Python | `pod.organisations.roles()` | | mpod | `mpod roles` | # Remove a member, or leave (https://docs.mapier.ai/pod/api/organisations/remove-member) > People only, with a fresh second factor. **DELETE** `/v1/organisations/{org_id}/members/{account}` People only, with a fresh second factor. Anyone may remove themselves; otherwise the rules of `updateMember` apply, and the last owner cannot go (`conflict`). The keys the member made are revoked, or with `keys=hand_over` handed to the owner `hand_to`. The member is refused everywhere within 60 seconds, as a revoked key is. Removing someone who is not a member is `not_found`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/members/example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | ------------------------- | -------- | ---------------------------------------------------- | | `org_id` | path | `string` | Yes | | | `account` | path | `string` | Yes | The member's identity account id. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `keys` | query | `"revoke" \| "hand_over"` | No | What happens to the keys the member made. | | `hand_to` | query | `string` | No | With `keys=hand_over`: the owner who takes the keys. | ## Answer [#answer] **200.** Who was removed and what became of their keys. ```json title="200" { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "keys_revoked": 0, "keys_handed_over": 0 } ``` | Field | Type | Always | What it is | | ------------------ | --------- | ------ | ------------------------------------------------------------------------ | | `account` | `string` | Yes | An identity account id, the `sub` of the person's Mapier identity token. | | `organisation` | `string` | Yes | | | `keys_revoked` | `integer` | Yes | At least 0. | | `keys_handed_over` | `integer` | Yes | At least 0. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------------- | | TypeScript | `pod.organisations.members.remove(orgId, account)` | | Python | `pod.organisations.members.remove(org_id, account)` | | mpod | `mpod organisations members remove ` | # Reopen a closed organization (https://docs.mapier.ai/pod/api/organisations/reopen-organisation) > People only, with a fresh second factor: an owner reopens a closed organization before `closure.reopen_until`. **POST** `/v1/organisations/{org_id}/reopen` People only, with a fresh second factor: an owner reopens a closed organization before `closure.reopen_until`. Its standing goes back to what billing and staff ask for. Keys and grants revoked by the closure stay revoked: make new ones. One that is not closed, or past its window, is `conflict`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/reopen" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The organization, reopened. ```json title="200" { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null } ``` | Field | Type | Always | What it is | | ------------ | ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `plan` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer" \| null` | Yes | The calling person's role; null for an API key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `closure` | `Closure \| null` | Yes | The last closure, or null if it was never closed. | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------- | | TypeScript | `pod.organisations.reopen(orgId)` | | Python | `pod.organisations.reopen(org_id)` | | mpod | `mpod organisations reopen ` | # Revoke an invitation (https://docs.mapier.ai/pod/api/organisations/revoke-invitation) > People only, with a fresh second factor, under the rules of `createInvitation`. **DELETE** `/v1/organisations/{org_id}/invitations/{invitation_id}` People only, with a fresh second factor, under the rules of `createInvitation`. A repeat is a no-op; an invitation already accepted or expired is `conflict`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/invitations/inv_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `invitation_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The invitation, `revoked`. ```json title="200" { "id": "inv_3ahrz6dmv29gqy5ckt18fp", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "email": null, "role": "owner", "projects": null, "state": "pending", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "accepted_by": null, "accepted_at": null } ``` | Field | Type | Always | What it is | | -------------- | --------------------------------------------------- | ------ | --------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `organisation` | `string` | Yes | | | `email` | `string \| null` | Yes | Where the invitation was sent, if anywhere. | | `role` | `"owner" \| "admin" \| "member" \| "viewer"` | Yes | See `listRoles` for what each holds. `owner` and `admin` see every project. | | `projects` | `MemberProjects` | Yes | The projects a member or viewer reaches; null for every project. | | `state` | `"pending" \| "accepted" \| "revoked" \| "expired"` | Yes | | | `created_by` | `string` | Yes | An identity account id, the `sub` of the person's Mapier identity token. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `accepted_by` | `string \| null` | Yes | | | `accepted_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------------------- | | TypeScript | `pod.organisations.invitations.revoke(orgId, id)` | | Python | `pod.organisations.invitations.revoke(org_id, id)` | | mpod | `mpod organisations invitations revoke ` | # Set how many sandboxes one member may hold and keep awake (https://docs.mapier.ai/pod/api/organisations/set-member-limits) > Per-member caps: the sandboxes a member made, with a key they made or signed in, count against their own `max_sandboxes` and `max_awake`; `null` removes one. **PUT** `/v1/organisations/{org_id}/members/{account}/limits` Per-member caps: the sandboxes a member made, with a key they made or signed in, count against their own `max_sandboxes` and `max_awake`; `null` removes one. The organization's and the project's limits still count on top, and a create or a wake past one answers `quota_exceeded`. A member's spend cap is `PUT /v1/spend_caps` with `scope: member`. People only, with a fresh second factor, by an owner or an admin; an admin cannot cap an owner (`forbidden`). An API key answers `person_required`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/members/example/limits" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"max_sandboxes":0}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `account` | path | `string` | Yes | The member's identity account id. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------------- | ----------------- | -------- | ------------------ | | `max_sandboxes` | `integer \| null` | No | From 0 to 1000000. | | `max_awake` | `integer \| null` | No | From 0 to 1000000. | ## Answer [#answer] **200.** The member, with their limits and spend cap now. ```json title="200" { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "role": "owner", "projects": null, "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": null, "max_awake": null }, "spend_cap": null } ``` | Field | Type | Always | What it is | | -------------- | -------------------------------------------- | ------ | ---------------------------------------------------------------------------- | | `account` | `string` | Yes | An identity account id, the `sub` of the person's Mapier identity token. | | `organisation` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer"` | Yes | See `listRoles` for what each holds. `owner` and `admin` see every project. | | `projects` | `MemberProjects` | Yes | The projects a member or viewer reaches; null for every project. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `object` | Yes | The member's own count limits (`setMemberLimits`); null fields are no limit. | | `spend_cap` | `MemberSpendCap \| null` | Yes | The member's own spend cap this month; null when none is set. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------------------ | | TypeScript | `pod.organisations.members.setLimits(orgId, account, { … })` | | Python | `pod.organisations.members.set_limits(org_id, account, …)` | | mpod | `mpod organisations members limits ` | # Change the organization's data and privacy settings (https://docs.mapier.ai/pod/api/organisations/set-privacy) > People only, with a fresh second factor: an owner or an admin. **PUT** `/v1/organisations/{org_id}/privacy` People only, with a fresh second factor: an owner or an admin. Switches left out keep their value. Turning `zero_data_retention` on erases data at every stop, so it also needs `confirm` set to `erase at every stop` (`invalid` without it). The settings travel in the signed standing list, and every server of the organization applies them within 60 seconds; a sandbox running when a switch changes follows it from its next stop. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/privacy" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"zero_data_retention":true}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------------------- | --------- | -------- | ----------------------------------------------------------- | | `zero_data_retention` | `boolean` | No | | | `snapshots_off` | `boolean` | No | | | `monitoring_off` | `boolean` | No | | | `confirm` | `string` | No | `erase at every stop`, when turning zero data retention on. | ## Answer [#answer] **200.** The settings as changed. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "settings": { "zero_data_retention": false, "snapshots_off": false, "monitoring_off": false }, "effective": { "zero_data_retention": false, "snapshots_off": false, "monitoring_off": false }, "set_by": null, "set_at": null } ``` | Field | Type | Always | What it is | | -------------- | ----------------- | ------ | -------------------------------------------- | | `organisation` | `string` | Yes | | | `settings` | `PrivacySettings` | Yes | | | `effective` | `PrivacySettings` | Yes | | | `set_by` | `string \| null` | Yes | The identity account that last changed them. | | `set_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------- | | TypeScript | `pod.organisations.setPrivacy(orgId, { … })` | | Python | `pod.organisations.set_privacy(org_id, …)` | | mpod | `mpod organisations set-privacy ` | # Hand the organization to another member (https://docs.mapier.ai/pod/api/organisations/transfer-organisation) > People only, with a fresh second factor. **POST** `/v1/organisations/{org_id}/transfer` People only, with a fresh second factor. An owner names a member, who becomes an owner; the person who handed it over becomes an admin, in the same change, so the organization always keeps an owner. Naming someone who is not a member is `not_found`; naming yourself, or an organization that is closed, is `conflict`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/transfer" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"to":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ----- | -------- | -------- | ------------------------------------------------------------------------ | | `to` | `string` | Yes | An identity account id, the `sub` of the person's Mapier identity token. | ## Answer [#answer] **200.** Both members as changed, the new owner first. ```json title="200" { "owner": { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "role": "owner", "projects": null, "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": null, "max_awake": null }, "spend_cap": null }, "previous_owner": { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "role": "owner", "projects": null, "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": null, "max_awake": null }, "spend_cap": null } } ``` | Field | Type | Always | What it is | | ---------------- | -------- | ------ | ---------- | | `owner` | `Member` | Yes | | | `previous_owner` | `Member` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------- | | TypeScript | `pod.organisations.transfer(orgId, account)` | | Python | `pod.organisations.transfer(org_id, account)` | | mpod | `mpod organisations transfer ` | # Change a member's role or projects (https://docs.mapier.ai/pod/api/organisations/update-member) > People only, with a fresh second factor; an API key answers `person_required`. **PATCH** `/v1/organisations/{org_id}/members/{account}` People only, with a fresh second factor; an API key answers `person_required`. An owner or an admin changes members; only an owner makes, changes or removes an owner, and the organization always keeps one (`conflict`). A role that sees every project (owner, admin) takes no `projects`. Keys the member made that the new role or projects no longer cover are revoked in the same change, since a key never holds more than the person who made it. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X PATCH "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp/members/example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"role":"owner"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `account` | path | `string` | Yes | The member's identity account id. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ---------- | -------------------------------------------- | -------- | --------------------------------------------------------------------------- | | `role` | `"owner" \| "admin" \| "member" \| "viewer"` | No | See `listRoles` for what each holds. `owner` and `admin` see every project. | | `projects` | `MemberProjects` | No | The projects a member or viewer reaches; null for every project. | ## Answer [#answer] **200.** The member as changed. ```json title="200" { "account": "example", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "role": "owner", "projects": null, "created_at": "2026-11-23T12:00:00.000Z", "limits": { "max_sandboxes": null, "max_awake": null }, "spend_cap": null } ``` | Field | Type | Always | What it is | | -------------- | -------------------------------------------- | ------ | ---------------------------------------------------------------------------- | | `account` | `string` | Yes | An identity account id, the `sub` of the person's Mapier identity token. | | `organisation` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer"` | Yes | See `listRoles` for what each holds. `owner` and `admin` see every project. | | `projects` | `MemberProjects` | Yes | The projects a member or viewer reaches; null for every project. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `limits` | `object` | Yes | The member's own count limits (`setMemberLimits`); null fields are no limit. | | `spend_cap` | `MemberSpendCap \| null` | Yes | The member's own spend cap this month; null when none is set. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------------------- | | TypeScript | `pod.organisations.members.update(orgId, account, { … })` | | Python | `pod.organisations.members.update(org_id, account, …)` | | mpod | `mpod organisations members update ` | # Rename an organization (https://docs.mapier.ai/pod/api/organisations/update-organisation) > People only, with a fresh second factor; an API key answers `person_required`. **PATCH** `/v1/organisations/{org_id}` People only, with a fresh second factor; an API key answers `person_required`. An owner or an admin renames the organization; its id stays. A closed organization is `conflict`. For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with `person_required`. ## Request [#request] ```bash curl -X PATCH "https://api.pod.mapier.ai/v1/organisations/org_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `org_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------ | -------- | -------- | ---------- | | `name` | `string` | Yes | | ## Answer [#answer] **200.** The organization as changed. ```json title="200" { "id": "org_3ahrz6dmv29gqy5ckt18fp", "name": "example", "standing": "good", "plan": "example", "role": null, "created_at": "2026-11-23T12:00:00.000Z", "closure": null } ``` | Field | Type | Always | What it is | | ------------ | ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `plan` | `string` | Yes | | | `role` | `"owner" \| "admin" \| "member" \| "viewer" \| null` | Yes | The calling person's role; null for an API key. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `closure` | `Closure \| null` | Yes | The last closure, or null if it was never closed. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------- | | TypeScript | `pod.organisations.update(orgId, { name })` | | Python | `pod.organisations.update(org_id, name=…)` | | mpod | `mpod organisations update ` | # Open a raw TCP or UDP connection to a port (https://docs.mapier.ai/pod/api/ports/connect-port) > A WebSocket upgrade (RFC 6455) whose binary frames are the bytes of one TCP connection to the port, each way. **GET** `/v1/sandboxes/{sandbox_id}/ports/{port}/connect` A WebSocket upgrade (RFC 6455) whose binary frames are the bytes of one TCP connection to the port, each way. With `protocol=udp` each binary frame is one datagram instead. `mpod sandboxes ports forward` and an SSH `ProxyCommand` are built on it. A text frame from the client ends the connection. The port is connected before the upgrade, so a port nothing listens on answers `port_closed` instead of a socket. A sleeping sandbox is woken first, waiting up to 30 seconds (`not_ready` after). An open connection is checked again every 30 seconds and closed once its key is revoked or loses `sandboxes:exec`. A key sends `Authorization`, as on every call; a browser has no use for raw bytes, so no stream ticket opens it. A key with the `sandboxes:exec` scope. ## Request [#request] A WebSocket. Open the `stream_url` the command's answer gives, with your key in `Authorization`; a browser opens it with a [stream ticket](https://docs.mapier.ai/pod/api/commands/create-exec-stream-ticket) instead. The SDKs open it for you. ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ----- | ---------------- | -------- | ------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `port` | path | `integer` | Yes | A TCP or UDP port number, 1 to 65535. | | `protocol` | query | `"tcp" \| "udp"` | No | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`port_closed`](https://docs.mapier.ai/pod/api/errors#port_closed), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------------- | | TypeScript | `pod.ports.connect(sandboxId, port)` | | Python | `pod.ports.connect(sandbox_id, port)` | | mpod | `mpod sandboxes ports connect ` | # Make a link that opens a private port for a while (https://docs.mapier.ai/pod/api/ports/create-port-share-link) > A share link is the port's URL with a grant signed by the cell (`?pod_share=…`), for this port only, until `expires_at`: 1 minute to 7 days, 24 hours by default. **POST** `/v1/sandboxes/{sandbox_id}/ports/{port}/share-links` A share link is the port's URL with a grant signed by the cell (`?pod_share=…`), for this port only, until `expires_at`: 1 minute to 7 days, 24 hours by default. Anyone holding it opens the port until then. Nothing is stored, so a link is revoked by making a new token (`createPortToken`) or resetting the port, which ends every link made before. Opening it gives a session cookie for the port's host, at most 12 hours and never past the link, and a redirect to the URL without the grant. Refused to all but the creator of a `no_save` sandbox (`saves_refused`). A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/1/share-links" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"expires_in_s":86400}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `port` | path | `integer` | Yes | A TCP or UDP port number, 1 to 65535. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------- | -------- | ---------------------------------------------------------------------------- | | `expires_in_s` | `integer` | No | 1 minute to 7 days, 24 hours by default. Default `86400`. From 60 to 604800. | ## Answer [#answer] **201.** The link. ```json title="201" { "url": "https://app.example.com", "expires_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------ | -------- | ------ | ----------------------------------------------------------------------------------- | | `url` | `string` | Yes | The port's URL with `?pod_share=…`. A secret until it expires; never logged by Pod. | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`saves_refused`](https://docs.mapier.ai/pod/api/errors#saves_refused), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------- | | TypeScript | `pod.ports.shareLink(sandboxId, port, { … })` | | Python | `pod.ports.share_link(sandbox_id, port, …)` | | mpod | `mpod sandboxes ports share ` | # Make a new token for a private port (https://docs.mapier.ai/pod/api/ports/create-port-token) > Answers the port with a new `token` (`podpt_…`), shown this once; Pod keeps only its SHA-256. **POST** `/v1/sandboxes/{sandbox_id}/ports/{port}/token` Answers the port with a new `token` (`podpt_…`), shown this once; Pod keeps only its SHA-256. A program sends it in the `Pod-Port-Token` header; a browser opens `{url}?pod_token=…` once, and Pod answers with a redirect to the same URL without it and a session cookie for that host only, so the token leaves the address bar before the sandbox's page loads. A new token replaces the old one and ends every share link and session made before it: that is how a leaked link is revoked. The answer is a secret, sent with `Cache-Control: no-store` and never stored for a replay, so the call takes no `Idempotency-Key`, as a stream ticket does; each call makes a new token. Refused to all but the creator of a `no_save` sandbox (`saves_refused`). A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/1/token" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | --------- | -------- | ------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `port` | path | `integer` | Yes | A TCP or UDP port number, 1 to 65535. | ## Answer [#answer] **201.** The port, with its new `token`. ```json title="201" { "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "port": 1, "visibility": "private", "name": null, "url": "https://app.example.com", "name_url": null, "has_token": false, "updated_at": null, "token": "podpt_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ``` | Field | Type | Always | What it is | | ------------ | ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- | | `sandbox` | `string` | Yes | | | `port` | `integer` | Yes | From 1 to 65535. | | `visibility` | `"private" \| "public"` | Yes | `private` (the default): opened by a key, the port's token, a share link or their session. `public`: opened by anyone. | | `name` | `string \| null` | Yes | | | `url` | `string` | Yes | `https://{port}-{sandbox id without sbx_}.{content domain}`; the sandbox id's body starts with its cell tag. | | `name_url` | `string \| null` | Yes | `https://{name}--{cell tag}.{content domain}`, the cell tag being the sandbox's, when the port has a name. | | `has_token` | `boolean` | Yes | | | `updated_at` | `string \| null` | Yes | | | `token` | `string` | No | Only in the answer of `createPortToken`, once. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`saves_refused`](https://docs.mapier.ai/pod/api/errors#saves_refused), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------- | | TypeScript | `pod.ports.createToken(sandboxId, port)` | | Python | `pod.ports.create_token(sandbox_id, port)` | | mpod | `mpod sandboxes ports token ` | # How to reach a sandbox by SSH (https://docs.mapier.ai/pod/api/ports/get-sandbox-ssh) > The cell's SSH endpoint (`ssh.{cell}.{domain}`, port 22, one host key per cell), the login (the sandbox's id; `{id}+{user}` runs as that user) and a command line that connects. **GET** `/v1/sandboxes/{sandbox_id}/ssh` The cell's SSH endpoint (`ssh.{cell}.{domain}`, port 22, one host key per cell), the login (the sandbox's id; `{id}+{user}` runs as that user) and a command line that connects. Signing in takes an SSH key the person added to their account (`addSshKey`) and a role that holds `sandboxes:exec` in the sandbox's project; no SSH server or key is needed in the sandbox, so every image works, VS Code and Cursor Remote-SSH included. Commands, shells, `sftp`, `ssh -L` and `ssh -R` to the sandbox's own loopback work; password sign-in, agent and X11 forwarding do not. An API key reads it, but no API key signs in. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ssh" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The sandbox's SSH endpoint. ```json title="200" { "host": "example", "port": 1, "user": "example", "command": "example" } ``` | Field | Type | Always | What it is | | --------- | --------- | ------ | ---------------------------------------------------------------------- | | `host` | `string` | Yes | The cell's SSH endpoint, `ssh.{cell}.{domain}`. | | `port` | `integer` | Yes | From 1 to 65535. | | `user` | `string` | Yes | The login: the sandbox's id; `{id}+{user}` runs as that user. | | `command` | `string` | Yes | A command line that connects, such as `ssh sbx_…@ssh.c7k.pod.example`. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------ | | TypeScript | `pod.ports.ssh(sandboxId)` | | Python | `pod.ports.ssh(sandbox_id)` | | mpod | `mpod sandboxes ssh ` | # List what listens in a sandbox now (https://docs.mapier.ai/pod/api/ports/list-listening-ports) > Every TCP and UDP port a program in the sandbox listens on, with its setting and, for TCP, its URL. **GET** `/v1/sandboxes/{sandbox_id}/ports/listening` Every TCP and UDP port a program in the sandbox listens on, with its setting and, for TCP, its URL. It wakes nothing: a sandbox that is not running answers `conflict`. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/listening" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Answer [#answer] **200.** What listens now. ```json title="200" { "data": [ { "port": 1, "protocol": "tcp", "address": "example", "visibility": "private", "name": null, "url": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ----------------- | ------ | ------------ | | `data` | `ListeningPort[]` | Yes | | | `next_cursor` | `string \| null` | Yes | Always null. | ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`guest_unavailable`](https://docs.mapier.ai/pod/api/errors#guest_unavailable), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------ | | TypeScript | `pod.ports.listening(sandboxId)` | | Python | `pod.ports.listening(sandbox_id)` | | mpod | `mpod sandboxes ports listening ` | # List a sandbox's ports that have a setting (https://docs.mapier.ai/pod/api/ports/list-ports) > The ports whose visibility, name or token was set, with their URLs. **GET** `/v1/sandboxes/{sandbox_id}/ports` The ports whose visibility, name or token was set, with their URLs. Every port of a sandbox has a URL whether or not it has a setting, `https://{port}-{sandbox id without sbx_}.{content domain}`, and a port with no setting is private, so it is not listed. A named port also has `https://{name}--{cell tag}.{content domain}`. What listens in the sandbox now is `listListeningPorts`. The content domain is `mapier.dev`, a registered domain of Pod's own that serves sandbox URLs and nothing else, apart from Pod's API and dashboard and on the Public Suffix List, so one sandbox's page cannot read another's cookies or Pod's own. Clients use the URLs answered here and never build one. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The ports with a setting. ```json title="200" { "data": [ { "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "port": 1, "visibility": "private", "name": null, "url": "https://app.example.com", "name_url": null, "has_token": false, "updated_at": null, "token": "podpt_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ----------------------------------------------- | | `data` | `Port[]` | Yes | | | `next_cursor` | `string \| null` | Yes | Always null; a sandbox's settings fit one page. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------- | | TypeScript | `pod.ports.list(sandboxId)` | | Python | `pod.ports.list(sandbox_id)` | | mpod | `mpod sandboxes ports list ` | # Put a port back to private, with no name and no token (https://docs.mapier.ai/pod/api/ports/reset-port) > Ends every share link and every browser session the port gave, and any WebSocket they opened within 30 seconds. **DELETE** `/v1/sandboxes/{sandbox_id}/ports/{port}` Ends every share link and every browser session the port gave, and any WebSocket they opened within 30 seconds. Resetting a port that has no setting is a no-op. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/1" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `port` | path | `integer` | Yes | A TCP or UDP port number, 1 to 65535. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The port, private and unnamed. ```json title="200" { "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "port": 1, "visibility": "private", "name": null, "url": "https://app.example.com", "name_url": null, "has_token": false, "updated_at": null, "token": "podpt_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ``` | Field | Type | Always | What it is | | ------------ | ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- | | `sandbox` | `string` | Yes | | | `port` | `integer` | Yes | From 1 to 65535. | | `visibility` | `"private" \| "public"` | Yes | `private` (the default): opened by a key, the port's token, a share link or their session. `public`: opened by anyone. | | `name` | `string \| null` | Yes | | | `url` | `string` | Yes | `https://{port}-{sandbox id without sbx_}.{content domain}`; the sandbox id's body starts with its cell tag. | | `name_url` | `string \| null` | Yes | `https://{name}--{cell tag}.{content domain}`, the cell tag being the sandbox's, when the port has a name. | | `has_token` | `boolean` | Yes | | | `updated_at` | `string \| null` | Yes | | | `token` | `string` | No | Only in the answer of `createPortToken`, once. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------- | | TypeScript | `pod.ports.reset(sandboxId, port)` | | Python | `pod.ports.reset(sandbox_id, port)` | | mpod | `mpod sandboxes ports reset ` | # Make a port public or private, and name it (https://docs.mapier.ai/pod/api/ports/set-port) > Sets the port's visibility and its chosen name, and keeps its token. **PUT** `/v1/sandboxes/{sandbox_id}/ports/{port}` Sets the port's visibility and its chosen name, and keeps its token. A port is private by default: its URL opens for an API key with `sandboxes:exec`, the port's token, a share link or the browser session one of them gave. A public port opens for anyone. A chosen name gives the port a second URL, `https://{name}--{cell tag}.{content domain}`, the cell tag being the sandbox's (the three characters after `sbx_`): the name is 3 to 40 lowercase letters, digits and single hyphens, starting with a letter and not reserved, and never holds `--`. It is unique across the sandbox's cell, so its label carries the cell's tag; a name another port of the cell holds is `conflict`. `null` or no name removes it. A sandbox made with `no_save` refuses making a port public to every caller but its creator (`saves_refused`), as it refuses tokens and share links. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/1" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"visibility":"private"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `port` | path | `integer` | Yes | A TCP or UDP port number, 1 to 65535. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | | `visibility` | `"private" \| "public"` | No | `private` (the default): opened by a key, the port's token, a share link or their session. `public`: opened by anyone. | | `name` | `string \| null` | No | | ## Answer [#answer] **200.** The port. ```json title="200" { "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "port": 1, "visibility": "private", "name": null, "url": "https://app.example.com", "name_url": null, "has_token": false, "updated_at": null, "token": "podpt_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm" } ``` | Field | Type | Always | What it is | | ------------ | ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- | | `sandbox` | `string` | Yes | | | `port` | `integer` | Yes | From 1 to 65535. | | `visibility` | `"private" \| "public"` | Yes | `private` (the default): opened by a key, the port's token, a share link or their session. `public`: opened by anyone. | | `name` | `string \| null` | Yes | | | `url` | `string` | Yes | `https://{port}-{sandbox id without sbx_}.{content domain}`; the sandbox id's body starts with its cell tag. | | `name_url` | `string \| null` | Yes | `https://{name}--{cell tag}.{content domain}`, the cell tag being the sandbox's, when the port has a name. | | `has_token` | `boolean` | Yes | | | `updated_at` | `string \| null` | Yes | | | `token` | `string` | No | Only in the answer of `createPortToken`, once. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`saves_refused`](https://docs.mapier.ai/pod/api/errors#saves_refused), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------- | | TypeScript | `pod.ports.set(sandboxId, port, { … })` | | Python | `pod.ports.set(sandbox_id, port, …)` | | mpod | `mpod sandboxes ports set ` | # Check a spec file and write its lock (https://docs.mapier.ai/pod/api/sandboxes/check-spec) > Reads a sandbox spec file as the project would make it, and answers every problem with it and the lock Pod would write for it now. **POST** `/v1/specs:check` Reads a sandbox spec file as the project would make it, and answers every problem with it and the lock Pod would write for it now. Nothing is made, stored or billed. The file's own rules are checked first, as both SDKs check them before sending; then what only Pod knows: that the template, image or snapshot is one the project can see and its digest, that the cell and the plan offer the system, the size and each capability, and, once rules are enforced, that the policy compiler accepts the rules. With `lock`, it also says whether that lock was written for this file and whether its pins still exist. A problem is never an error answer: a file with problems answers `200` with `ok` false and no lock. An image built from a Dockerfile or a repository needs a lock that pins the image built; without one such a file has `needs_build`. Commit `lock_text` as `pod.lock` beside `pod.yaml`; writing it again with nothing changed writes the same bytes. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/specs:check" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"spec":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | ---------------- | -------- | ------------------------------------------------------------------- | | `project` | `string` | No | The project to check against, as on create. A key's own by default. | | `spec` | `string` | Yes | The spec file's text, YAML (`pod.yaml`). | | `lock` | `string \| null` | No | The lock file's text (`pod.lock`), when the repository has one. | ## Answer [#answer] **200.** The problems, and the lock Pod would write. ```json title="200" { "ok": false, "spec_hash": null, "problems": [ { "code": "yaml", "severity": "error", "path": "example", "message": "example", "line": 1 } ], "lock_state": "missing", "lock": null, "lock_text": null } ``` | Field | Type | Always | What it is | | ------------ | --------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------- | | `ok` | `boolean` | Yes | The file has no error and can be made. | | `spec_hash` | `string \| null` | Yes | The spec file's hash; null when it could not be read. Sandboxes made from it carry it in the `pod.spec` label. | | `problems` | `SpecProblem[]` | Yes | | | `lock_state` | `"missing" \| "fresh" \| "stale"` | Yes | Whether the lock sent was written for this file. | | `lock` | `SpecLock \| null` | Yes | The lock Pod would write for the file now; null when `ok` is false. | | `lock_text` | `string \| null` | Yes | The lock's text, to commit as it is. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `pod.specs.check(text, { lock })` | | Python | `pod.specs.check(text, lock=…)` | | mpod | `mpod specs check [FILE]` | # Create a sandbox (https://docs.mapier.ai/pod/api/sandboxes/create-sandbox) > Creates a sandbox by restoring a template or a snapshot, or by booting an image. **POST** `/v1/sandboxes` Creates a sandbox by restoring a template or a snapshot, or by booting an image. By default the call waits until the sandbox is `running` and answers `201`. If the sandbox is still `creating` when `wait_timeout_s` passes, or if `wait` is false, the call answers `202` with the sandbox in `creating`. Poll its state with a get. If a waiting call observes the placed sandbox in `error`, it answers `202` with that sandbox's ID, `error` state and `reason`, such as `create_failed`. When no server has room, the call answers `503 no_capacity` with `retry_after_s`. Nothing is made or billed. With `hold_server`, `server_held` in that answer says a whole server is now held for this create: retry at `retry_after_s` with the same idempotency key, and it lands there once the server has room. With `count` above 1, a `swarm` name or `roles`, it is a batch create: the copies make one group, and it always answers `202` with `BatchCreated` at once (`wait: true` is `invalid`). Each copy counts against `creates_per_minute`. A batch larger than the trust tier's swarm cap is `quota_exceeded` with `limit: max_swarm`; nothing is made. Copies no server took are listed in `unplaced`, and the rest carry on. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"system":"linux","size":"small","labels":{"app":"quickstart"}}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | Yes | Required on this call. Makes a repeat safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ----------------------- | ------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `project` | `string` | No | The project the sandbox belongs to. A key's own project by default, and a key may name only that one; a signed-in person names any project of the organization (the organization's first by default). A project the caller may not see answers `forbidden`. | | `system` | `"linux"` | No | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | No | `small` by default. | | `template` | `string` | No | Restore this template. Give at most one of `template`, `snapshot` and `image`; with none, the system's default template. | | `snapshot` | `string` | No | Restore this snapshot. | | `image` | `string` | No | Boot this image from its disk; slower than a restore. | | `class` | `"shared" \| "ci" \| "nested"` | No | The size's class by default; must match it. | | `wait` | `boolean` | No | Wait until `running` and answer `201`. Default `true`. | | `wait_timeout_s` | `integer` | No | Default `60`. From 1 to 300. | | `time_limit_s` | `integer \| null` | No | Stop the sandbox this long after it starts. None by default. At least 1. | | `idle_s` | `integer \| null` | No | Sleep after this long with no activity. The project's default, 15 minutes unless set. `null`: never sleep for want of activity, for a sandbox that must stay awake while it waits, such as a CI runner waiting for its job or a quiet build step. Its time limit still applies, and a sleep call still puts it to sleep. At least 60. | | `disk` | `"persistent" \| "throwaway"` | No | `persistent` by default; always `throwaway` on CI sizes. | | `no_save` | `boolean` | No | Refuse snapshots, share links and forks to every key but the one that created the sandbox. Default `false`. | | `env` | `Env` | No | Environment variables. Never logged, stored or answered back. | | `labels` | `Labels` | No | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `end_user` | `string` | No | Label the sandbox with this end user of the project (`POST /v1/end_users`), so its usage can be read by end user and the end user's limits count it. Never changed after the create. An end user the key cannot see is `invalid`. | | `volumes` | `AttachVolumeRequest[]` | No | Volumes to attach at create, usually `locked` until the sandbox's work is known. Each is checked before anything is made: one that does not exist is `invalid`, one attached elsewhere `conflict`. Volumes must belong to the sandbox's project and mode. A batch with volumes is `invalid` because a volume has one attachment. | | `needs` | `"kvm" \| "ios-simulator"[]` | No | Capabilities the sandbox needs, in the spec file's words: the scheduler places it where they are, `kvm` in the pool kept for VMs inside sandboxes. A capability the system does not have is `invalid`; one this cell does not offer yet is `system_not_offered`. | | `nested_virtualization` | `boolean` | No | Run VMs inside this sandbox: it is placed in the `nested` class's pool, on servers of its own, Linux only, in a shared size. The same as `class: nested` or `kvm` in `needs`; `false` beside either is `invalid`. It cannot be switched on later. A cell without the pool answers `system_not_offered`. | | `hints` | `PlacementHints` | No | "This sandbox will use these volumes or this snapshot": the scheduler prefers a server that already holds them for this organization. A hint never refuses a create and never overrides room; an id of another organization's object is found nowhere. At most 16 ids together, repeats dropped. A create from a snapshot hints its own snapshot. | | `hold_server` | `boolean` | No | Hold a whole server for this create when none has room now. Only for a CI size of at least 16 cores (`ci-16`); on any other size it is `invalid`. The answer is still `503 no_capacity`, with `server_held` saying whether a server is held; the retry with the same idempotency key lands there once it has room. Nothing is queued. A batch cannot hold a server (`invalid`). Default `false`. | | `count` | `integer` | No | How many copies to make. Above 1 it is a batch create: `2` to `1000` copies as one swarm, answered `202` with `BatchCreated`. With `roles`, the roles' counts must add up to it; without `count` they set it. `0` is `invalid`. From 0 to 1000. | | `swarm` | `string` | No | The swarm's name. Makes the create a batch. | | `roles` | `BatchRole[]` | No | The copies' roles, each with its count. Copies are named `-` in the order given, `n` from 0 within its role, or `member-` with no roles; the name is the copy's name on the group's private network. Makes the create a batch. | | `policy` | `string` | No | Run the sandbox under this stored policy of the project (Pod Agent IAM's `listPolicies`). The front door binds it before the sandbox runs anything (Pod Agent IAM's `bindSandbox`), so the sandbox reaches only what the policy grants. Left out, with no `rules`, the sandbox runs under the project's default for sandboxes with no policy: the public internet within Pod's baseline, unless the project switched its default to deny. A policy the project does not hold is `invalid` (field `policy`); a key issued inside a sandbox may name only its parent's policy or one that narrows it. | | `rules` | `string` | No | Rules for this sandbox alone, in the simple form, one a line (`Allow net api.github.com GET /repos/*`). They are cut to the ceiling (the policy and, above it, the project's and the organization's), and what was cut is in the sandbox's binding. Rules here close the network as a policy does: the sandbox reaches only what they and its policy allow. A rule the compiler refuses is `invalid` (field `rules`). | ## Answer [#answer] **201.** The sandbox, `running`. **202.** A single sandbox in `creating` or a waiting create's sandbox in `error`. For a batch, the group and its copies. ```json title="201" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded), [`plan_required`](https://docs.mapier.ai/pod/api/errors#plan_required), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`spend_cap_reached`](https://docs.mapier.ai/pod/api/errors#spend_cap_reached), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited), [`no_capacity`](https://docs.mapier.ai/pod/api/errors#no_capacity), [`system_not_offered`](https://docs.mapier.ai/pod/api/errors#system_not_offered), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------- | | TypeScript | `pod.sandboxes.create({ … })` | | Python | `pod.sandboxes.create(…)` | | mpod | `mpod sandboxes create` | # Delete a sandbox (https://docs.mapier.ai/pod/api/sandboxes/delete-sandbox) > Ends the VM, removes its local files and destroys its data keys. **DELETE** `/v1/sandboxes/{sandbox_id}` Ends the VM, removes its local files and destroys its data keys. Never answers `conflict`; a repeat on a deleted sandbox is a no-op. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | ## Answer [#answer] **200.** With `wait=true`, the sandbox, `deleted`. **202.** The work started; follow the operation. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `sandbox.delete()` | | Python | `sandbox.delete()` | | mpod | `mpod sandboxes delete ` | # Set the time a running sandbox has left (https://docs.mapier.ai/pod/api/sandboxes/extend-sandbox) > Sets `time_limit_at` to now plus `time_limit_s`. **POST** `/v1/sandboxes/{sandbox_id}/extend` Sets `time_limit_at` to now plus `time_limit_s`. When the time limit passes the sandbox stops, keeps its disk, and shows `reason: time_limit`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/extend" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"time_limit_s":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------- | -------- | -------------------------------------------- | | `time_limit_s` | `integer` | Yes | The time left, counted from now. At least 1. | ## Answer [#answer] **200.** The sandbox with its new `time_limit_at`. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------ | | TypeScript | `sandbox.extend(timeLimitS)` | | Python | `sandbox.extend(time_limit_s)` | | mpod | `mpod sandboxes extend ` | # Get a group of sandboxes (https://docs.mapier.ai/pod/api/sandboxes/get-group) > A group: a swarm made by one batch create, or a sandbox's group of one, whose id is the sandbox's with `grp_` for `sbx_`. **GET** `/v1/groups/{group_id}` A group: a swarm made by one batch create, or a sandbox's group of one, whose id is the sandbox's with `grp_` for `sbx_`. A key sees a group only as it would see its sandboxes: same organization, project and mode, and a key issued inside a sandbox only a group its sandbox is in. Anything else is `not_found`, and so is a group of a kind the public API does not offer yet (the scheduler's `machines` groups): `kind` is only ever one of `GroupKind`. Where its sandboxes run is never shown. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/groups/grp_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ---------- | ---- | -------- | -------- | ---------- | | `group_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The group. ```json title="200" { "id": "grp_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "name": null, "kind": "single", "system": "linux", "members": [ { "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "name": "example", "role": null } ], "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------ | --------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `name` | `string \| null` | Yes | The swarm's name, if the batch gave one. | | `kind` | `"single" \| "swarm"` | Yes | `swarm`: made by one batch create. `single`: a sandbox's group of one. Treat a value you do not know as unknown. | | `system` | `"linux"` | Yes | | | `members` | `GroupMember[]` | Yes | | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------- | | TypeScript | `pod.groups.get(id)` | | Python | `pod.groups.get(id)` | | mpod | `mpod groups get ` | # Get a sandbox (https://docs.mapier.ai/pod/api/sandboxes/get-sandbox) > Exact, from the sandbox's server. **GET** `/v1/sandboxes/{sandbox_id}` Exact, from the sandbox's server. A deleted sandbox answers as `deleted` for 24 hours. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | ## Answer [#answer] **200.** The sandbox. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------ | | TypeScript | `pod.sandboxes.get(id)` | | Python | `pod.sandboxes.get(id)` | | mpod | `mpod sandboxes get ` | # List sandboxes (https://docs.mapier.ai/pod/api/sandboxes/list-sandboxes) > A key lists its own project's sandboxes. **GET** `/v1/sandboxes` A key lists its own project's sandboxes. A signed-in person sees every project of the organization, so the dashboard names one with `project`; a project the caller may not see answers `forbidden`. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | -------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `project` | query | `string` | No | Only this project's sandboxes. | | `state` | query | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | No | Only sandboxes in this state. | | `label` | query | `string[]` | No | Only sandboxes with every `key=value` label given. | | `template` | query | `string` | No | Only sandboxes made from this template. | | `end_user` | query | `string` | No | Only sandboxes labelled with this end user. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of sandboxes, newest first. ```json title="200" { "data": [ { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Sandbox[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------- | | TypeScript | `pod.sandboxes.list({ … })` | | Python | `pod.sandboxes.list(…)` | | mpod | `mpod sandboxes list` | # Report activity, for idle sleep (https://docs.mapier.ai/pod/api/sandboxes/report-activity) > Counts as activity for idle sleep. **POST** `/v1/sandboxes/{sandbox_id}/activity` Counts as activity for idle sleep. A busy report counts for at most 10 minutes. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/activity" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"busy":true,"at":"2026-11-23T12:00:00.000Z"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------ | --------- | -------- | -------------------------------------------------------------------------- | | `busy` | `boolean` | Yes | A busy report keeps the sandbox awake for at most 10 minutes. | | `at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Answer [#answer] **204.** Recorded. ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------- | | TypeScript | `sandbox.reportActivity()` | | Python | `sandbox.report_activity()` | | mpod | `mpod sandboxes activity ` | # Change a sandbox's size (https://docs.mapier.ai/pod/api/sandboxes/resize-sandbox) > Resize follows the sandbox's state. **POST** `/v1/sandboxes/{sandbox_id}/resize` Resize follows the sandbox's state. A `running` sandbox restarts at the new size and answers `restarted: true`. A `sleeping` one stays asleep at the new size with `tier: none`, since its memory belongs to the old size; the next wake boots. A `stopped` one stays stopped at the new size. If the boot at the new size fails, the sandbox boots again at the old size. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/resize" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"size":"small"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | ## Body [#body] | Field | Type | Required | What it is | | ------ | ------------------------------------------------------------------------------------- | -------- | ---------- | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | ## Answer [#answer] **200.** With `wait=true`, the sandbox once the call finished. **202.** The work started; follow the operation. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`plan_required`](https://docs.mapier.ai/pod/api/errors#plan_required), [`no_capacity`](https://docs.mapier.ai/pod/api/errors#no_capacity), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------- | | TypeScript | `sandbox.resize(size)` | | Python | `sandbox.resize(size)` | | mpod | `mpod sandboxes resize ` | # Put a sandbox to sleep (https://docs.mapier.ai/pod/api/sandboxes/sleep-sandbox) > A `running` sandbox goes through `stopping` to `sleeping` with `tier: memory`. **POST** `/v1/sandboxes/{sandbox_id}/sleep` A `running` sandbox goes through `stopping` to `sleeping` with `tier: memory`. After 10 minutes, or when the server needs the memory, it moves to `tier: disk`. A sandbox also sleeps by itself after its idle time with no activity. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/sleep" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | ## Answer [#answer] **200.** With `wait=true`, the sandbox once the call finished. **202.** The work started; follow the operation. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `sandbox.sleep()` | | Python | `sandbox.sleep()` | | mpod | `mpod sandboxes sleep ` | # Start a stopped sandbox (https://docs.mapier.ai/pod/api/sandboxes/start-sandbox) > Boots a `stopped` sandbox, one asleep with `tier: none`, or one in `error` whose disk can be read. **POST** `/v1/sandboxes/{sandbox_id}/start` Boots a `stopped` sandbox, one asleep with `tier: none`, or one in `error` whose disk can be read. It answers `restarted: true`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/start" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | ## Answer [#answer] **200.** With `wait=true`, the sandbox once the call finished. **202.** The work started; follow the operation. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`spend_cap_reached`](https://docs.mapier.ai/pod/api/errors#spend_cap_reached), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `sandbox.start()` | | Python | `sandbox.start()` | | mpod | `mpod sandboxes start ` | # Stop a sandbox (https://docs.mapier.ai/pod/api/sandboxes/stop-sandbox) > The guest shuts down and the disk's write tail is shipped; the sandbox is then `stopped`, with its disk kept and its memory gone. **POST** `/v1/sandboxes/{sandbox_id}/stop` The guest shuts down and the disk's write tail is shipped; the sandbox is then `stopped`, with its disk kept and its memory gone. Only a call brings it back. `force` stops from the last shipped point and drops the unsent tail. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/stop" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | | `force` | query | `boolean` | No | Stop at once from the last shipped point, dropping writes not yet shipped. | ## Answer [#answer] **200.** With `wait=true`, the sandbox once the call finished. **202.** The work started; follow the operation. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `sandbox.stop()` | | Python | `sandbox.stop()` | | mpod | `mpod sandboxes stop ` | # Wake a sandbox (https://docs.mapier.ai/pod/api/sandboxes/wake-sandbox) > A `sleeping` or `stopped` sandbox goes through `waking` to `running`. **POST** `/v1/sandboxes/{sandbox_id}/wake` A `sleeping` or `stopped` sandbox goes through `waking` to `running`. From `tier: none` or `stopped` it boots, and answers `restarted: true`. When no server has room, the wake waits in a queue and the sandbox shows `queue_position`; it never answers `no_capacity`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/wake" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | ## Answer [#answer] **200.** With `wait=true`, the sandbox once the call finished. **202.** The work started; follow the operation. ```json title="200" { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `state` | `"creating" \| "running" \| "stopping" \| "sleeping" \| "waking" \| "stopped" \| "deleting" \| "deleted" \| "error"` | Yes | `running` means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows `running` only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. | | `tier` | `"memory" \| "disk" \| "none" \| null` | Yes | Set only while `sleeping`. | | `operation` | `"snapshotting" \| "forking" \| "moving" \| null` | Yes | | | `reason` | `"create_failed" \| "boot_failed" \| "server_lost" \| "resize_failed" \| "vm_crashed" \| "time_limit" \| "no_capacity" \| "idle" \| "stopped" \| null` | Yes | | | `restarted` | `boolean` | Yes | True when the last wake booted, so programs started again. | | `system` | `"linux"` | Yes | | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | Yes | | | `class` | `"shared" \| "ci" \| "nested"` | Yes | | | `disk` | `"persistent" \| "throwaway"` | Yes | `throwaway` keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with `no_save`, every other key is refused. | | `template` | `string \| null` | Yes | | | `parent` | `string \| null` | Yes | The sandbox this one was forked from. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `state_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `time_limit_at` | `string \| null` | Yes | | | `idle_s` | `integer \| null` | Yes | Seconds with no activity before it sleeps; `null` when it never sleeps for want of activity. At least 60. | | `flags` | `SandboxFlags` | Yes | | | `labels` | `Labels` | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. | | `queue_position` | `integer \| null` | Yes | While `waking` and waiting for room. At least 1. | | `end_user` | `string \| null` | Yes | The end user the sandbox was made for, if any. | | `group` | `string \| null` | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with `grp_` for `sbx_`. Null only from a cell that predates groups. | ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded), [`account_restricted`](https://docs.mapier.ai/pod/api/errors#account_restricted), [`spend_cap_reached`](https://docs.mapier.ai/pod/api/errors#spend_cap_reached), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `sandbox.wake()` | | Python | `sandbox.wake()` | | mpod | `mpod sandboxes wake ` | # Make a ticket that lets a browser open the screen's stream (https://docs.mapier.ai/pod/api/screens/create-screen-stream-ticket) > A short-lived, single-use ticket for this sandbox's screen stream (`streamScreen`), with the same rules as a command's ticket (`createExecStreamTicket`): bound to the screen, the caller, the organization and project, `origin` and an expiry of at most 60 seconds; a person's token may name only Pod's own clients' origins; a call that carries `Origin` must name it. **POST** `/v1/sandboxes/{sandbox_id}/screen/stream-ticket` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. A short-lived, single-use ticket for this sandbox's screen stream (`streamScreen`), with the same rules as a command's ticket (`createExecStreamTicket`): bound to the screen, the caller, the organization and project, `origin` and an expiry of at most 60 seconds; a person's token may name only Pod's own clients' origins; a call that carries `Origin` must name it. The dashboard's page asks for it itself when the sandbox is in a customer cell, at the cell's endpoint. `mode` is `watch` by default. A `takeover` ticket also carries the input, and only the person who holds the screen's takeover may ask for one (`forbidden` otherwise); it ends with the takeover. The answer is a secret: `Cache-Control: no-store`, never logged, never kept for a replay, so the call takes no `Idempotency-Key`. A caller holds at most 20 unused tickets. A key with the `screen:read` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/stream-ticket" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"origin":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Body [#body] | Field | Type | Required | What it is | | -------- | ----------------------- | -------- | --------------------------------------------------------------------------------------- | | `origin` | `string` | Yes | The origin of the page that will open the stream. The upgrade's `Origin` must equal it. | | `ttl_s` | `integer` | No | Default `30`. From 1 to 60. | | `mode` | `"watch" \| "takeover"` | No | | ## Answer [#answer] **201.** The ticket. ```json title="201" { "ticket": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm", "stream": "screen", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "mode": "watch", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "origin": "example", "stream_url": "wss://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream", "expires_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | -------------- | ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ticket` | `string` | Yes | Single use, for one stream, for at most 60 seconds. Stored by Pod only as a SHA-256 hash. | | `stream` | `"screen"` | Yes | | | `sandbox` | `string` | Yes | | | `mode` | `"watch" \| "takeover"` | Yes | | | `organisation` | `string` | Yes | | | `project` | `string` | Yes | | | `origin` | `string` | Yes | A browser origin as the browser sends it in `Origin` (RFC 6454): scheme, host and port, no path and no default port. `https://`, or `http://` on loopback for development. | | `stream_url` | `string` | Yes | The address of a WebSocket stream: `wss://`, or `ws://` only on a plain `http://` development server. | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------------------- | | TypeScript | `sandbox.screen.streamTicket({ origin })` | | Python | `sandbox.screen.stream_ticket(origin=…)` | | mpod | `mpod sandboxes screen ticket --origin ` | # Make a watch ticket through a watch link (https://docs.mapier.ai/pod/api/screens/create-watch-link-ticket) > A fresh `watch` ticket for a link already opened, when the page's first was spent or expired. **POST** `/v1/screen/watch-links/{link_id}/stream-ticket` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. A fresh `watch` ticket for a link already opened, when the page's first was spent or expired. The same people may ask as for `openWatchLink`, with the same refusals. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/screen/watch-links/wlk_3ahrz6dmv29gqy5ckt18fpx4b/stream-ticket" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"origin":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ---- | -------- | -------- | ---------- | | `link_id` | path | `string` | Yes | | ## Body [#body] | Field | Type | Required | What it is | | -------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `origin` | `string` | Yes | A browser origin as the browser sends it in `Origin` (RFC 6454): scheme, host and port, no path and no default port. `https://`, or `http://` on loopback for development. | | `ttl_s` | `integer` | No | Default `30`. From 1 to 60. | ## Answer [#answer] **201.** The ticket. ```json title="201" { "ticket": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm", "stream": "screen", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "mode": "watch", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "origin": "example", "stream_url": "wss://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream", "expires_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | -------------- | ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ticket` | `string` | Yes | Single use, for one stream, for at most 60 seconds. Stored by Pod only as a SHA-256 hash. | | `stream` | `"screen"` | Yes | | | `sandbox` | `string` | Yes | | | `mode` | `"watch" \| "takeover"` | Yes | | | `organisation` | `string` | Yes | | | `project` | `string` | Yes | | | `origin` | `string` | Yes | A browser origin as the browser sends it in `Origin` (RFC 6454): scheme, host and port, no path and no default port. `https://`, or `http://` on loopback for development. | | `stream_url` | `string` | Yes | The address of a WebSocket stream: `wss://`, or `ws://` only on a plain `http://` development server. | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------------------- | | TypeScript | `pod.watchLinks.ticket(linkId, { origin })` | | Python | `pod.watch_links.ticket(link_id, origin=…)` | | mpod | `mpod watch-links stream-ticket --origin ` | # Make a watch link for named people (https://docs.mapier.ai/pod/api/screens/create-watch-link) > An address (`url`, the dashboard's watch page) that lets the people it names watch this screen for a while, each signed in. **POST** `/v1/sandboxes/{sandbox_id}/screen/watch-links` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. An address (`url`, the dashboard's watch page) that lets the people it names watch this screen for a while, each signed in. Name them by email in `viewers`, or leave it empty for the members of the project whose role holds `screen:read`. It lives 15 minutes, an hour or 8 hours (`ttl_s`, the v1 lengths), never longer, and can be revoked. Whoever else holds the address sees nothing. A link that works for whoever holds it (`bearer: true`) waits on the owner's choice and is `not_supported`. A key with the `screen:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/watch-links" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"viewers":["example"]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | ---------------------- | -------- | --------------------------------------------------------------------------------- | | `viewers` | `string[]` | No | The people who may open it, by email. Empty, the project's members who may watch. | | `ttl_s` | `900 \| 3600 \| 28800` | No | How long it lives. The v1 lengths. Default `3600`. | | `bearer` | `boolean` | No | A link for whoever holds it. Not offered yet (`not_supported`). Default `false`. | ## Answer [#answer] **201.** The watch link. ```json title="201" { "id": "wlk_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "viewers": ["example"], "bearer": false, "url": "https://app.example.com", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "revoked_at": null } ``` | Field | Type | Always | What it is | | ------------ | ---------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `project` | `string` | Yes | | | `viewers` | `string[]` | Yes | | | `bearer` | `boolean` | Yes | | | `url` | `string` | Yes | The dashboard's watch page for this link. | | `created_by` | `string` | Yes | The key or the person's account that made it. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `revoked_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------------------------- | | TypeScript | `sandbox.screen.createWatchLink({ viewers })` | | Python | `sandbox.screen.create_watch_link(viewers=…)` | | mpod | `mpod sandboxes screen watch-links create ` | # Hand the screen's input back (https://docs.mapier.ai/pod/api/screens/end-takeover) > Ends the takeover: its streams get `takeover` with `held: false` and stop taking input, and agents' actions are accepted again. **DELETE** `/v1/sandboxes/{sandbox_id}/screen/takeover/{takeover_id}` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. Ends the takeover: its streams get `takeover` with `held: false` and stop taking input, and agents' actions are accepted again. The person who holds it, or a person whose role holds `screen:write` in the project, may end it. One that has already ended is `not_found`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. The person's role needs the `screen:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/takeover/tko_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `takeover_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Handed back. ## Errors [#errors] The refusals this call is known for: [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------------------- | | TypeScript | `sandbox.screen.handBack(takeoverId)` | | Python | `sandbox.screen.hand_back(takeover_id)` | | mpod | `mpod sandboxes screen takeover end ` | # Get a recording (https://docs.mapier.ai/pod/api/screens/get-recording) > Get a recording **GET** `/v1/sandboxes/{sandbox_id}/screen/recordings/{recording_id}` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. A key with the `screen:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/recordings/rec_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | | `recording_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The recording. ```json title="200" { "id": "rec_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "recording", "mask_typing": false, "started_at": "2026-11-23T12:00:00.000Z", "stopped_at": null, "segments": 0, "gaps": 0, "masked_spans": 0 } ``` | Field | Type | Always | What it is | | -------------- | -------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `state` | `"recording" \| "stopped"` | Yes | | | `mask_typing` | `boolean` | Yes | | | `started_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `stopped_at` | `string \| null` | Yes | | | `segments` | `integer` | Yes | Segments of 10 s written so far. At least 0. | | `gaps` | `integer` | Yes | Spans lost and marked: a restarted worker, a lost stream. At least 0. | | `masked_spans` | `integer` | Yes | Spans left out while text was typed under a mask. At least 0. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------------------ | | TypeScript | `sandbox.screen.getRecording(recordingId)` | | Python | `sandbox.screen.get_recording(recording_id)` | | mpod | `mpod sandboxes screen recordings get ` | # Read the screen's accessibility tree (https://docs.mapier.ai/pod/api/screens/get-screen-tree) > The accessibility tree where the system has one, flattened in document order, for a model to read beside a screenshot. **GET** `/v1/sandboxes/{sandbox_id}/screen/tree` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. The accessibility tree where the system has one, flattened in document order, for a model to read beside a screenshot. A system without one answers `not_supported`. A key with the `screen:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/tree" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The tree. ```json title="200" { "frame_seq": 0, "nodes": [ { "depth": 0, "role": "example", "name": "example", "value": null, "bounds": null, "visible": false } ] } ``` | Field | Type | Always | What it is | | ----------- | ------------------ | ------ | ----------- | | `frame_seq` | `integer` | Yes | At least 0. | | `nodes` | `ScreenTreeNode[]` | Yes | | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported), [`unavailable`](https://docs.mapier.ai/pod/api/errors#unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------- | | TypeScript | `sandbox.screen.tree()` | | Python | `sandbox.screen.tree()` | | mpod | `mpod sandboxes screen tree ` | # Describe a sandbox's screen (https://docs.mapier.ai/pod/api/screens/get-screen) > Whether the screen can be shown and driven now, its size, the image formats and whether it has an accessibility tree, the takeover in force, the recording, and how many people watch. **GET** `/v1/sandboxes/{sandbox_id}/screen` **Not available yet.** Seeing and acting on a sandbox's screen is not offered yet. Commands, files and ports work today. Whether the screen can be shown and driven now, its size, the image formats and whether it has an accessibility tree, the takeover in force, the recording, and how many people watch. A sandbox with no screen answers with `unavailable` set rather than an error, so a page can say why. Needs no video encoder. A key with the `screen:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The screen. ```json title="200" { "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "system": "linux", "unavailable": null, "width": null, "height": null, "input": false, "tree": false, "image_formats": ["png"], "frame_seq": null, "tee": false, "recording": { "on": false, "mask_typing": false, "recording": null }, "takeover": null, "watchers": 0 } ``` | Field | Type | Always | What it is | | --------------- | -------------------------------------------------------------------- | ------ | --------------------------------------------------------------------------- | | `sandbox` | `string` | Yes | | | `system` | `"linux"` | Yes | | | `unavailable` | `"no_desktop" \| "not_running" \| "tee_off" \| "restarting" \| null` | Yes | `null` when the screen can be shown and driven. | | `width` | `integer \| null` | Yes | At least 1. | | `height` | `integer \| null` | Yes | At least 1. | | `input` | `boolean` | Yes | Whether actions reach the screen. | | `tree` | `boolean` | Yes | Whether `getScreenTree` answers on this system. | | `image_formats` | `"png" \| "jpeg"[]` | Yes | | | `frame_seq` | `integer \| null` | Yes | The newest frame's number, for `unless_unchanged_since`. At least 0. | | `tee` | `boolean` | Yes | A TEE sandbox whose screen a person switched on; Pod's software can see it. | | `recording` | `ScreenRecordingSettings` | Yes | | | `takeover` | `Takeover \| null` | Yes | | | `watchers` | `integer` | Yes | People watching now. At least 0. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------- | | TypeScript | `sandbox.screen.describe()` | | Python | `sandbox.screen.describe()` | | mpod | `mpod sandboxes screen get ` | # List the screen's recordings (https://docs.mapier.ai/pod/api/screens/list-recordings) > List the screen's recordings **GET** `/v1/sandboxes/{sandbox_id}/screen/recordings` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. A key with the `screen:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/recordings" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ----- | --------- | -------- | --------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of recordings, newest first. ```json title="200" { "data": [ { "id": "rec_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "recording", "mask_typing": false, "started_at": "2026-11-23T12:00:00.000Z", "stopped_at": null, "segments": 0, "gaps": 0, "masked_spans": 0 } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Recording[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------- | | TypeScript | `sandbox.screen.recordings()` | | Python | `sandbox.screen.recordings()` | | mpod | `mpod sandboxes screen recordings list ` | # List the screen's watch links (https://docs.mapier.ai/pod/api/screens/list-watch-links) > The sandbox's watch links, live and ended, newest first, and `limits`: the lengths and the number of people the gateway takes for a new link, which a client offers in place of numbers of its own. **GET** `/v1/sandboxes/{sandbox_id}/screen/watch-links` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. The sandbox's watch links, live and ended, newest first, and `limits`: the lengths and the number of people the gateway takes for a new link, which a client offers in place of numbers of its own. A key with the `screen:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/watch-links" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ----- | --------- | -------- | --------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of watch links. ```json title="200" { "data": [ { "id": "wlk_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "viewers": ["example"], "bearer": false, "url": "https://app.example.com", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "revoked_at": null } ], "next_cursor": null, "limits": { "ttl_s_choices": [900], "ttl_s_default": 900, "max_viewers": 1 } } ``` | Field | Type | Always | What it is | | ------------- | ----------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `data` | `WatchLink[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | | `limits` | `WatchLinkLimits` | No | What the gateway takes for a new watch link on this sandbox now: the lengths it offers and how many people one link may name, each within `CreateWatchLinkRequest`'s bounds. Clients offer these, not numbers of their own. Absent from a server before it; `CreateWatchLinkRequest`'s bounds hold then. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------------- | | TypeScript | `sandbox.screen.watchLinks()` | | Python | `sandbox.screen.watch_links()` | | mpod | `mpod sandboxes screen watch-links list ` | # Open a watch link (a person it names) (https://docs.mapier.ai/pod/api/screens/open-watch-link) > For the dashboard's watch page: a signed-in person the link names (by email, or as a member of the project when it names nobody) gets the link, the screen and a first watch ticket bound to `origin`. **POST** `/v1/screen/watch-links/{link_id}/open` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. For the dashboard's watch page: a signed-in person the link names (by email, or as a member of the project when it names nobody) gets the link, the screen and a first watch ticket bound to `origin`. Anyone else is `forbidden`; a link that is unknown, expired or revoked is `not_found`. The link carries its own scope, so the person needs no role in the organization. The answer holds a ticket: `no-store`, no `Idempotency-Key`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/screen/watch-links/wlk_3ahrz6dmv29gqy5ckt18fpx4b/open" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"origin":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ---- | -------- | -------- | ---------- | | `link_id` | path | `string` | Yes | | ## Body [#body] | Field | Type | Required | What it is | | -------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `origin` | `string` | Yes | A browser origin as the browser sends it in `Origin` (RFC 6454): scheme, host and port, no path and no default port. `https://`, or `http://` on loopback for development. | | `ttl_s` | `integer` | No | Default `30`. From 1 to 60. | ## Answer [#answer] **200.** The link, its screen and a ticket. ```json title="200" { "link": { "id": "wlk_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "viewers": ["example"], "bearer": false, "url": "https://app.example.com", "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "revoked_at": null }, "screen": { "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "system": "linux", "unavailable": null, "width": null, "height": null, "input": false, "tree": false, "image_formats": ["png"], "frame_seq": null, "tee": false, "recording": { "on": false, "mask_typing": false, "recording": null }, "takeover": null, "watchers": 0 }, "ticket": { "ticket": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm", "stream": "screen", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "mode": "watch", "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "origin": "example", "stream_url": "wss://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exec/op_3ahrz6dmv29gqy5ckt18fpx4b/stream", "expires_at": "2026-11-23T12:00:00.000Z" } } ``` | Field | Type | Always | What it is | | -------- | -------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `link` | `WatchLink` | Yes | | | `screen` | `Screen` | Yes | | | `ticket` | `ScreenStreamTicket` | Yes | A ticket for one sandbox's screen stream. `ticket` is a secret: hand it only to the page at `origin`, which offers it with `pod.stream.v1` as the WebSocket's subprotocols. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------ | | TypeScript | `pod.watchLinks.open(linkId, { origin })` | | Python | `pod.watch_links.open(link_id, origin=…)` | | mpod | `mpod watch-links open --origin ` | # Click, type and press keys on the screen (https://docs.mapier.ai/pod/api/screens/perform-screen-actions) > Runs `actions` in order: one action or a batch of up to 100. **POST** `/v1/sandboxes/{sandbox_id}/screen/actions` **Not available yet.** Seeing and acting on a sandbox's screen is not offered yet. Commands, files and ports work today. Runs `actions` in order: one action or a batch of up to 100. Pointer moves, clicks, button presses, drags, wheel scrolls, typed text, key chords (`["Control", "c"]`, pressed in order and released in reverse), single key presses and releases, and waits. Keys are named as the browser's `KeyboardEvent.key` names them, X's and xdotool's spellings are accepted in any case, and one printable character is its own key. A model's own actions (OpenAI's, Anthropic's, Gemini's) are converted by the SDKs' `dialects`. Typed text is never logged or stored and never appears in an error: an `invalid` text names only its field. With `mask_in_recording`, nothing captured while the call types, or in the second after, is kept in a recording; the span is marked instead. With `screenshot`, the answer carries a screenshot taken after the last action. The call changes the sandbox, so it takes an `Idempotency-Key`. A repeat with the same key delivers nothing again. A call whose deadline passes partway answers `deadline_exceeded`; a repeat with the same key delivers only what the first did not, so nothing is typed twice. While a person holds the screen's takeover, actions are `conflict` until they hand it back. A key with the `screen:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/actions" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"actions":[{"type":"move","x":0,"y":0}]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------------- | ---------------- | -------- | ----------------------------------------------------------------- | | `actions` | `ScreenAction[]` | Yes | | | `mask_in_recording` | `boolean` | No | Leave what this call types out of any recording. Default `false`. | | `screenshot` | `object` | No | Answer a screenshot taken after the last action. | ## Answer [#answer] **200.** Every action was delivered. ```json title="200" { "delivered": 0, "screenshot": null } ``` | Field | Type | Always | What it is | | ------------ | -------------------- | ------ | ------------------------------------------------- | | `delivered` | `integer` | Yes | Input events that reached the screen. At least 0. | | `screenshot` | `Screenshot \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`idempotency_key_reused`](https://docs.mapier.ai/pod/api/errors#idempotency_key_reused), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported), [`unavailable`](https://docs.mapier.ai/pod/api/errors#unavailable), [`deadline_exceeded`](https://docs.mapier.ai/pod/api/errors#deadline_exceeded), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------------- | | TypeScript | `sandbox.screen.act(actions)` | | Python | `sandbox.screen.act(actions)` | | mpod | `mpod sandboxes screen act ` | # Revoke a watch link (https://docs.mapier.ai/pod/api/screens/revoke-watch-link) > The link opens for nobody from then on, and its streams end with `link_revoked`. **DELETE** `/v1/screen/watch-links/{link_id}` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. The link opens for nobody from then on, and its streams end with `link_revoked`. A repeat is a no-op. A key with the `screen:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/screen/watch-links/wlk_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `link_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Revoked. ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------- | | TypeScript | `sandbox.screen.revokeWatchLink(linkId)` | | Python | `sandbox.screen.revoke_watch_link(link_id)` | | mpod | `mpod watch-links revoke ` | # Start recording the screen (https://docs.mapier.ai/pod/api/screens/start-recording) > Records the screen into object storage under the organization's key, in encrypted segments of 10 seconds, so deleting that key deletes the recording. **POST** `/v1/sandboxes/{sandbox_id}/screen/recordings` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. Records the screen into object storage under the organization's key, in encrypted segments of 10 seconds, so deleting that key deletes the recording. A gap (the worker restarted, the stream was lost) is marked, never hidden. Typing during a takeover is left out by default (`mask_typing`), and so is whatever an actions call with `mask_in_recording` types. Starting while a recording is running answers that recording. A TEE sandbox records only once a person switched its screen on. A key with the `screen:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/recordings" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"mask_typing":true}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------- | --------- | -------- | -------------------------------------------------------------------- | | `mask_typing` | `boolean` | No | Leave typing during a takeover out of the recording. Default `true`. | ## Answer [#answer] **201.** The recording, started. ```json title="201" { "id": "rec_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "recording", "mask_typing": false, "started_at": "2026-11-23T12:00:00.000Z", "stopped_at": null, "segments": 0, "gaps": 0, "masked_spans": 0 } ``` | Field | Type | Always | What it is | | -------------- | -------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `state` | `"recording" \| "stopped"` | Yes | | | `mask_typing` | `boolean` | Yes | | | `started_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `stopped_at` | `string \| null` | Yes | | | `segments` | `integer` | Yes | Segments of 10 s written so far. At least 0. | | `gaps` | `integer` | Yes | Spans lost and marked: a restarted worker, a lost stream. At least 0. | | `masked_spans` | `integer` | Yes | Spans left out while text was typed under a mask. At least 0. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------------- | | TypeScript | `sandbox.screen.startRecording()` | | Python | `sandbox.screen.start_recording()` | | mpod | `mpod sandboxes screen recordings start ` | # Take over the screen's input (a person) (https://docs.mapier.ai/pod/api/screens/start-takeover) > A signed-in person takes the screen's input for a while: agents' actions are `conflict` until they hand it back, and their own input travels on a `takeover` stream. **POST** `/v1/sandboxes/{sandbox_id}/screen/takeover` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. A signed-in person takes the screen's input for a while: agents' actions are `conflict` until they hand it back, and their own input travels on a `takeover` stream. `acknowledged` says the person accepted what a takeover shows and keeps: whoever watches sees what is typed, and with the recording's typing mask off it lands in the recording. Typing during a takeover is masked out of recordings by default. The takeover ends by itself after 15 minutes without input. Someone else's takeover in force is `conflict`; the person's own answers it again. An API key is `person_required`. For people only: a signed-in person's token makes this call. An API key is refused with `person_required`. The person's role needs the `screen:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/takeover" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"acknowledged":true}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ | | `acknowledged` | `true` | Yes | The person accepted that watchers see what they type, and that with the recording's typing mask off it lands in the recording. | ## Answer [#answer] **201.** The takeover. ```json title="201" { "id": "tko_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "held_by": "example", "mine": false, "started_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------ | --------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `held_by` | `string` | Yes | An identity account id, the `sub` of the person's Mapier identity token. | | `mine` | `boolean` | Yes | Whether the person reading the answer holds it. | | `started_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string` | Yes | When it ends by itself without more input. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------ | | TypeScript | `sandbox.screen.takeover()` | | Python | `sandbox.screen.takeover()` | | mpod | `mpod sandboxes screen takeover start ` | # Stop a recording (https://docs.mapier.ai/pod/api/screens/stop-recording) > Writes the last segment and marks the recording stopped; it answers once the store holds it stopped. **POST** `/v1/sandboxes/{sandbox_id}/screen/recordings/{recording_id}/stop` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. Writes the last segment and marks the recording stopped; it answers once the store holds it stopped. Stopping one already stopped answers it again. A key with the `screen:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/recordings/rec_3ahrz6dmv29gqy5ckt18fpx4b/stop" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `recording_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The recording, stopped. ```json title="200" { "id": "rec_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "state": "recording", "mask_typing": false, "started_at": "2026-11-23T12:00:00.000Z", "stopped_at": null, "segments": 0, "gaps": 0, "masked_spans": 0 } ``` | Field | Type | Always | What it is | | -------------- | -------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `state` | `"recording" \| "stopped"` | Yes | | | `mask_typing` | `boolean` | Yes | | | `started_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `stopped_at` | `string \| null` | Yes | | | `segments` | `integer` | Yes | Segments of 10 s written so far. At least 0. | | `gaps` | `integer` | Yes | Spans lost and marked: a restarted worker, a lost stream. At least 0. | | `masked_spans` | `integer` | Yes | Spans left out while text was typed under a mask. At least 0. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`unavailable`](https://docs.mapier.ai/pod/api/errors#unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------------------------- | | TypeScript | `sandbox.screen.stopRecording(recordingId)` | | Python | `sandbox.screen.stop_recording(recording_id)` | | mpod | `mpod sandboxes screen recordings stop ` | # Watch the screen live (https://docs.mapier.ai/pod/api/screens/stream-screen) > A WebSocket upgrade (RFC 6455) carrying the screen as H.264 for WebCodecs. **GET** `/v1/sandboxes/{sandbox_id}/screen/stream` **Not available yet.** The API does not serve a screen's tree, live stream, takeovers, watch links or recordings yet. A WebSocket upgrade (RFC 6455) carrying the screen as H.264 for WebCodecs. Pod sends text frames holding one JSON message each (`ScreenStreamServerMessage`: `start` first and again when the settings change, `gap` when pictures were lost, `takeover` when the person's takeover ends elsewhere, `end` before it closes with 1000) and binary frames holding one picture each: byte 0 the flags (bit 0, a key frame), bytes 1 to 8 the capture time in microseconds (big-endian), the rest the picture in Annex B, as the screen worker makes it. The first picture after `start` is a key frame, so a late watcher decodes at once. A still screen sends nothing. On a stream opened with a `takeover` ticket the client sends `ScreenStreamClientMessage`: `input` with actions of `ScreenAction` and an idempotency key of its own, so a resend types nothing twice. A watch stream refuses input with an `error` message and stays open. **Two ways in,** as on a command's stream: `Authorization` from a client that can send headers (watch only), or a ticket from `createScreenStreamTicket` or a watch link, offered beside `pod.stream.v1` in `Sec-WebSocket-Protocol`, never in the address. Every well-formed ticket an upgrade offers is spent first, and every refusal of a ticket is the same `unauthorized` (`createExecStreamTicket`'s rules). Tickets are never logged. A key with the `screen:read` scope. ## Request [#request] A WebSocket. Open the `stream_url` the command's answer gives, with your key in `Authorization`; a browser opens it with a [stream ticket](https://docs.mapier.ai/pod/api/commands/create-exec-stream-ticket) instead. The SDKs open it for you. ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------------ | ------ | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Sec-WebSocket-Protocol` | header | `string` | No | With a stream ticket: `pod.stream.v1, pod_ticket_…`. Without one, `pod.stream.v1` may be offered and is then selected. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------- | | TypeScript | `sandbox.screen.watch()` | | Python | `sandbox.screen.watch()` | | mpod | `mpod sandboxes screen watch ` | # Take a screenshot (https://docs.mapier.ai/pod/api/screens/take-screenshot) > One still image of the newest frame, base64 in JSON, as every model API takes an image. **GET** `/v1/sandboxes/{sandbox_id}/screen/screenshot` **Not available yet.** Seeing and acting on a sandbox's screen is not offered yet. Commands, files and ports work today. One still image of the newest frame, base64 in JSON, as every model API takes an image. PNG by default, JPEG with `format=jpeg` (a busy 1080p PNG is near 2 MB). A region (`x`, `y`, `width`, `height`, all four or none) must lie inside the screen. With `unless_unchanged_since` set to a `frame_seq` this screen handed out, an unchanged screen (inside the region) answers `unchanged: true` with no image, so a model that polls skips a screen it has seen; a number from before the screen's worker restarted always gets the image. An image above 4 MiB less 64 KiB is `payload_too_large`: ask for JPEG or a region. A screen that cannot be shown answers by its reason (`Screen.unavailable`): `not_supported` with no desktop or a TEE screen switched off, `not_ready` while the sandbox is not running, `unavailable` while the worker restarts. Pixels are customer content: never logged. A key with the `screen:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/screenshot" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------------ | ----- | ----------------- | -------- | ------------------------------------------ | | `sandbox_id` | path | `string` | Yes | | | `format` | query | `"png" \| "jpeg"` | No | | | `quality` | query | `integer` | No | JPEG only, 1 to 100. 80 by default. | | `x` | query | `integer` | No | A pixel of the screen, from the top left. | | `y` | query | `integer` | No | A pixel of the screen, from the top left. | | `width` | query | `integer` | No | | | `height` | query | `integer` | No | | | `unless_unchanged_since` | query | `integer` | No | A `frame_seq` this screen answered before. | ## Answer [#answer] **200.** The screenshot. ```json title="200" { "format": "png", "width": 1, "height": 1, "frame_seq": 0, "captured_at": "2026-11-23T12:00:00.000Z", "unchanged": false, "image": null } ``` | Field | Type | Always | What it is | | ------------- | ----------------- | ------ | -------------------------------------------------------------------------- | | `format` | `"png" \| "jpeg"` | Yes | Default `"png"`. | | `width` | `integer` | Yes | At least 1. | | `height` | `integer` | Yes | At least 1. | | `frame_seq` | `integer` | Yes | At least 0. | | `captured_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `unchanged` | `boolean` | Yes | True when `unless_unchanged_since` matched; `image` is then null. | | `image` | `string \| null` | Yes | The image, base64. Customer content, never logged. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`not_ready`](https://docs.mapier.ai/pod/api/errors#not_ready), [`payload_too_large`](https://docs.mapier.ai/pod/api/errors#payload_too_large), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported), [`unavailable`](https://docs.mapier.ai/pod/api/errors#unavailable), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell), [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------- | | TypeScript | `sandbox.screen.screenshot({ … })` | | Python | `sandbox.screen.screenshot(…)` | | mpod | `mpod sandboxes screen shot ` | # List the sizes, systems, classes and regions on offer (https://docs.mapier.ai/pod/api/service/get-catalog) > Open to everyone, without a key. **GET** `/v1/catalog` Open to everyone, without a key. Prices wait, so `price` is null. Open to everyone: send it with no key. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/catalog" ``` ## Answer [#answer] **200.** The catalog. ```json title="200" { "sizes": [ { "name": "small", "class": "shared", "vcpu": 1, "memory_mb": 1, "disk_gb": 1, "disk": "either", "price": null } ], "systems": [ { "name": "linux", "sleep_keeps_memory": false } ], "classes": [ { "name": "shared", "description": "example", "sizes": ["small"], "has_room": false } ], "regions": [ { "name": "example" } ] } ``` | Field | Type | Always | What it is | | --------- | ----------------- | ------ | ---------- | | `sizes` | `CatalogSize[]` | Yes | | | `systems` | `CatalogSystem[]` | Yes | | | `classes` | `CatalogClass[]` | Yes | | | `regions` | `CatalogRegion[]` | Yes | | ## Errors [#errors] The refusals this call is known for: [`rate_limited`](https://docs.mapier.ai/pod/api/errors#rate_limited). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------- | | TypeScript | `pod.catalog()` | | Python | `pod.catalog()` | | mpod | `mpod catalog` | # Check that the API answers (https://docs.mapier.ai/pod/api/service/get-health) > Check that the API answers **GET** `/v1/health` Open to everyone: send it with no key. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/health" ``` ## Answer [#answer] **200.** The gateway is serving. ```json title="200" { "status": "ok", "time": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | -------- | -------- | ------ | -------------------------------------------------------------------------- | | `status` | `"ok"` | Yes | | | `time` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------- | | TypeScript | `pod.health()` | | Python | `pod.health()` | | mpod | `mpod health` | # Snapshot a sandbox (https://docs.mapier.ai/pod/api/snapshots/create-snapshot) > A `running` sandbox pauses briefly (`operation: snapshotting`). **POST** `/v1/sandboxes/{sandbox_id}/snapshots` A `running` sandbox pauses briefly (`operation: snapshotting`). A `sleeping` or `stopped` sandbox is saved as it is: disk only, unless it sleeps with `tier: disk`. A sandbox made with `no_save` refuses every key but its creator's with `saves_refused`. A sandbox with a `throwaway` disk is saved the same way, memory included, by the key that created it; the snapshot restores at the same size. A key with the `snapshots:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/snapshots" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"before-upgrade"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | ## Body [#body] | Field | Type | Required | What it is | | ------ | ----------------------------- | -------- | ------------------------------------------------------------------------------ | | `kind` | `"disk" \| "disk_and_memory"` | No | `disk_and_memory` by default on a running sandbox; a stopped one saves `disk`. | | `name` | `string` | No | | ## Answer [#answer] **201.** With `wait=true`, the snapshot, `ready`. **202.** The work started; follow the operation. ```json title="201" { "id": "snp_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "kind": "disk", "name": null, "state": "creating", "size_bytes": null, "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------ | ------------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `project` | `string` | Yes | | | `kind` | `"disk" \| "disk_and_memory"` | Yes | | | `name` | `string \| null` | Yes | | | `state` | `"creating" \| "ready" \| "failed" \| "deleting"` | Yes | | | `size_bytes` | `integer \| null` | Yes | At least 0. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`saves_refused`](https://docs.mapier.ai/pod/api/errors#saves_refused), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------------- | | TypeScript | `sandbox.snapshot({ … })` | | Python | `sandbox.snapshot(…)` | | mpod | `mpod sandboxes snapshots create ` | # Delete a snapshot (https://docs.mapier.ai/pod/api/snapshots/delete-snapshot) > A repeat on a deleted snapshot is a no-op. **DELETE** `/v1/snapshots/{snapshot_id}` A repeat on a deleted snapshot is a no-op. A key with the `snapshots:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/snapshots/snp_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `snapshot_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Deleted. ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------------------- | | TypeScript | `pod.snapshots.delete(id)` | | Python | `pod.snapshots.delete(id)` | | mpod | `mpod snapshots delete ` | # Fork a running sandbox into copies (https://docs.mapier.ai/pod/api/snapshots/fork-sandbox) > The parent pauses briefly (`operation: forking`); each copy is created as by a create and answers `parent`. **POST** `/v1/sandboxes/{sandbox_id}/fork` The parent pauses briefly (`operation: forking`); each copy is created as by a create and answers `parent`. If any copy fails, the copies made so far are deleted and the call fails. Each copy counts against `creates_per_minute`. With `first_action`, each copy stops the parent's commands named in `stop_execs` (`TERM`, then `KILL` after 5 s) and runs one command before anything else runs, with `POD_FORK_INDEX` (0 to `count` − 1), `POD_FORK_COUNT` and `POD_FORK_PARENT` in its environment. `first_actions` names each copy's command, an exec operation read with `GET /v1/sandboxes/{sandbox_id}/exec/{operation_id}`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/fork" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"count":2}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `Idempotency-Key` | header | `string` | Yes | Required on this call. Makes a repeat safe for 24 hours. | | `wait` | query | `boolean` | No | Wait for the result instead of answering `202` with an operation. | | `wait_timeout_s` | query | `integer` | No | How long `wait=true` waits before answering `202` after all. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | ------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `count` | `integer` | No | Default `1`. From 1 to 10. | | `size` | `"small" \| "medium" \| "large" \| "xlarge" \| "ci-2" \| "ci-4" \| "ci-8" \| "ci-16"` | No | The parent's size by default. A different size boots the copies from disk. | | `first_action` | `FirstAction` | No | Run in each copy before anything else: first the parent's commands named in `stop_execs` are stopped (`TERM`, then `KILL` after 5 s), then one command runs as an exec would, with `POD_FORK_INDEX`, `POD_FORK_COUNT` and `POD_FORK_PARENT` added to its environment (naming one of them in `env` is `invalid`). Give `argv` or `command`, not both. A copy whose memory was not kept (a fork to another size boots from disk) has no processes to stop. | ## Answer [#answer] **201.** With `wait=true`, the copies, `running`. **202.** The work started; follow the operation. ```json title="201" { "data": [ { "id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "state": "running", "tier": null, "operation": null, "reason": null, "restarted": false, "system": "linux", "size": "small", "class": "shared", "disk": "persistent", "template": null, "parent": null, "created_at": "2026-11-23T12:00:00.000Z", "state_at": "2026-11-23T12:00:00.000Z", "time_limit_at": null, "idle_s": 900, "flags": { "no_save": false, "billing_mark": null }, "labels": { "app": "quickstart" }, "queue_position": null, "end_user": null, "group": null } ], "first_actions": null } ``` | Field | Type | Always | What it is | | --------------- | -------------------------- | ------ | ----------------------------------------------------------- | | `data` | `Sandbox[]` | Yes | | | `first_actions` | `FirstActionRun[] \| null` | Yes | With `first_action`, each copy's command; null without one. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`saves_refused`](https://docs.mapier.ai/pod/api/errors#saves_refused), [`not_supported`](https://docs.mapier.ai/pod/api/errors#not_supported), [`no_capacity`](https://docs.mapier.ai/pod/api/errors#no_capacity), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `sandbox.fork({ count })` | | Python | `sandbox.fork(count=…)` | | mpod | `mpod sandboxes fork ` | # Get a snapshot (https://docs.mapier.ai/pod/api/snapshots/get-snapshot) > Get a snapshot **GET** `/v1/snapshots/{snapshot_id}` A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/snapshots/snp_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------- | ---- | -------- | -------- | ---------- | | `snapshot_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The snapshot. ```json title="200" { "id": "snp_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "kind": "disk", "name": null, "state": "creating", "size_bytes": null, "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------ | ------------------------------------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `sandbox` | `string` | Yes | | | `project` | `string` | Yes | | | `kind` | `"disk" \| "disk_and_memory"` | Yes | | | `name` | `string \| null` | Yes | | | `state` | `"creating" \| "ready" \| "failed" \| "deleting"` | Yes | | | `size_bytes` | `integer \| null` | Yes | At least 0. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `pod.snapshots.get(id)` | | Python | `pod.snapshots.get(id)` | | mpod | `mpod snapshots get ` | # List snapshots (https://docs.mapier.ai/pod/api/snapshots/list-snapshots) > A key lists its own project's snapshots. **GET** `/v1/snapshots` A key lists its own project's snapshots. A signed-in person sees every project of the organization, so the dashboard names one with `project`; a project the caller may not see answers `forbidden`. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/snapshots" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | --------- | -------- | --------------------------------------------------------- | | `project` | query | `string` | No | Only this project's snapshots. | | `sandbox` | query | `string` | No | Only snapshots of this sandbox. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of snapshots, newest first. ```json title="200" { "data": [ { "id": "snp_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "kind": "disk", "name": null, "state": "creating", "size_bytes": null, "created_at": "2026-11-23T12:00:00.000Z" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Snapshot[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`in_other_cell`](https://docs.mapier.ai/pod/api/errors#in_other_cell). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------- | | TypeScript | `pod.snapshots.list()` | | Python | `pod.snapshots.list()` | | mpod | `mpod snapshots list` | # List spend caps and this month's spend under each (https://docs.mapier.ai/pod/api/spend-caps/list-spend-caps) > Every spend cap of the organization: its own, its projects', its projects' defaults for their end users and each end user's, with the month's spend as last worked out (`spent_cents`, as of `spent_as_of`). **GET** `/v1/spend_caps` Every spend cap of the organization: its own, its projects', its projects' defaults for their end users and each end user's, with the month's spend as last worked out (`spent_cents`, as of `spent_as_of`). A key sees its own project's caps and the organization's. A key with the `usage:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/spend_caps" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | ----------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------- | | `project` | query | `string` | No | Only this project's caps, its end users' and the organization's. A key sees only its own. | | `scope` | query | `"organisation" \| "project" \| "end_user" \| "end_user_default" \| "member"` | No | Only caps of this scope. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of caps, the most recently set first. ```json title="200" { "data": [ { "scope": "organisation", "target": "example", "amount_cents": null, "on_reach": "refuse", "currency": "example", "period": "example", "spent_cents": null, "spent_as_of": null, "reached": false, "set_by": null, "set_at": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `SpendCap[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------- | | TypeScript | `pod.spendCaps.list()` | | Python | `pod.spend_caps.list()` | | mpod | `mpod spend-caps list` | # Set or remove the spend cap of the organization, a project, or a project's end users (https://docs.mapier.ai/pod/api/spend-caps/set-spend-cap) > Sets a cap of scope `organisation`, `project`, `end_user_default` (each end user of the project that has no cap of its own) or `member` (one member of the organization, by identity account id: the sandboxes they made count); `amount_cents: null` removes it. **PUT** `/v1/spend_caps` Sets a cap of scope `organisation`, `project`, `end_user_default` (each end user of the project that has no cap of its own) or `member` (one member of the organization, by identity account id: the sandboxes they made count); `amount_cents: null` removes it. A higher cap is agreeing to pay more, so only a signed-in person whose role may read billing can call it, with a fresh second factor; an API key answers `person_required`, and so does a person whose second factor is not fresh. One end user's cap is `PUT /v1/end_users/{end_user_id}/spend_cap`. For people only: a signed-in person with a fresh second factor makes this call. An API key is refused with `person_required`. The person's role must be one that may read billing. ## Request [#request] ```bash curl -X PUT "https://api.pod.mapier.ai/v1/spend_caps" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"scope":"organisation","target":"example","amount_cents":0}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `scope` | `"organisation" \| "project" \| "end_user_default" \| "member"` | Yes | | | `target` | `string` | Yes | The organization for `organisation`; the project for `project` and `end_user_default`; the member's identity account id for `member`. | | `amount_cents` | `integer \| null` | Yes | The cap a month, in the currency's minor unit. `null` removes it. From 0 to 100000000. | | `on_reach` | `"refuse" \| "sleep"` | No | Once the month's spend reaches the cap: `refuse` new creates and wakes, or also put to `sleep` what is awake. Nothing is deleted. | ## Answer [#answer] **200.** The cap as it counts now; after a removal, with `amount_cents` null. ```json title="200" { "scope": "organisation", "target": "example", "amount_cents": null, "on_reach": "refuse", "currency": "example", "period": "example", "spent_cents": null, "spent_as_of": null, "reached": false, "set_by": null, "set_at": null } ``` | Field | Type | Always | What it is | | -------------- | ----------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `scope` | `"organisation" \| "project" \| "end_user" \| "end_user_default" \| "member"` | Yes | Whose spend the cap counts. `end_user_default` targets a project and counts for each of its end users that has no cap of its own. `member` targets one member by identity account id: the sandboxes they made, with a key they made or signed in. | | `target` | `string` | Yes | The organization, project or end user; the project for `end_user_default`; an identity account for `member`. | | `amount_cents` | `integer \| null` | Yes | The cap a month, in the currency's minor unit; null once removed. From 0 to 100000000. | | `on_reach` | `"refuse" \| "sleep"` | Yes | Once the month's spend reaches the cap: `refuse` new creates and wakes, or also put to `sleep` what is awake. Nothing is deleted. | | `currency` | `string` | Yes | ISO 4217. | | `period` | `string` | Yes | A calendar month in UTC. | | `spent_cents` | `integer \| null` | Yes | This month's spend under the cap as last worked out, an estimate at Pod's rates; the invoice is the billing provider's. Null until first worked out, and for `end_user_default`, which each end user counts apart. At least 0. | | `spent_as_of` | `string \| null` | Yes | | | `reached` | `boolean` | Yes | | | `set_by` | `string \| null` | Yes | The person or key that set it. | | `set_at` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------- | | TypeScript | `pod.spendCaps.set({ … })` | | Python | `pod.spend_caps.set({…})` | | mpod | `mpod spend-caps set` | # Read everything that can refuse a create or a wake (https://docs.mapier.ai/pod/api/usage/get-limits) > The plan, the trust tier and its caps, the organization's and the project's limits (staff's), the end user's (with `end_user`), the free plan's allowance left, the spend caps reached this month, and for each size whether a create would be refused now and why (`blocked_reason`). **GET** `/v1/limits` The plan, the trust tier and its caps, the organization's and the project's limits (staff's), the end user's (with `end_user`), the free plan's allowance left, the spend caps reached this month, and for each size whether a create would be refused now and why (`blocked_reason`). Read from the organization's signed standing entry, exactly as the gateway enforces it. A key reads its own project; a person names one (`project`) or reads the organization's alone. How many sandboxes are held and awake now (`counts`) is the registry's, and is `null` until the account service reads it; `quota_exceeded` is then named only for a limit of 0. With the usage store down the allowance's numbers are `null` and everything else still answers. A key with the `usage:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/limits" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | No | The project whose limits to read. A key's own by default, and the only one it may name. | | `end_user` | query | `string` | No | Also the limits, policy and state of this end user of the project. | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | ## Answer [#answer] **200.** The limits. ```json title="200" { "organisation": "org_3ahrz6dmv29gqy5ckt18fp", "project": null, "plan": "invited", "trust_tier": "new", "standing": "good", "tier_caps": null, "organisation_limits": { "max_sandboxes": null, "max_awake": null }, "project_limits": null, "end_user": null, "counts": { "held": null, "awake": null }, "allowance": null, "spend_caps_reached": [ { "scope": "organisation", "target": "example", "on_reach": "refuse", "period": "example" } ], "sizes": [ { "size": "small", "blocked_reason": null } ] } ``` | Field | Type | Always | What it is | | --------------------- | ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `organisation` | `string` | Yes | | | `project` | `string \| null` | Yes | | | `plan` | `"invited" \| "free" \| "pro"` | Yes | | | `trust_tier` | `"new" \| "verified" \| "established" \| "contract"` | Yes | | | `standing` | `"good" \| "past_due" \| "suspended" \| "closed"` | Yes | The organization's standing; past due and suspended answer `account_restricted` on creates and wakes, and closed (its owner closed it) on every call. | | `tier_caps` | `TierCaps \| null` | Yes | The trust tier's caps; null on an invited or contract organization, whose limits staff set. | | `organisation_limits` | `CountLimits` | Yes | Sandboxes held and awake; null is no limit of this scope. | | `project_limits` | `CountLimits \| null` | Yes | | | `end_user` | `AccountLimitsEndUser \| null` | Yes | | | `counts` | `SandboxCounts` | Yes | How many sandboxes are held and awake now; null until the account service reads the registry. | | `allowance` | `BillingAllowance \| null` | Yes | The free plan's allowance this month, with what is left; null on any other plan. | | `spend_caps_reached` | `ReachedSpendCap[]` | Yes | Spend caps reached this month that count for this project, end user and caller. | | `sizes` | `SizeAvailability[]` | Yes | Each size, and why a create of it would be refused now. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------- | | TypeScript | `pod.limits.get({ … })` | | Python | `pod.limits.get(…)` | | mpod | `mpod limits` | # Read metered usage (https://docs.mapier.ai/pod/api/usage/get-usage) > Usage by the second for one calendar month in UTC, grouped as asked. **GET** `/v1/usage` Usage by the second for one calendar month in UTC, grouped as asked. Seconds asleep and stopped and stored bytes are metered even before they have a price. Usage reaches this call within 3 minutes of the host's log. Usage has the mode of its sandbox, which is the mode of the key that created it. A key reads only its own project and mode; naming the other mode, or a sandbox of another mode or project, answers `not_found` exactly as a sandbox that does not exist (the test and live rule). A signed-in person reads either mode, live by default. A sandbox with no usage yet in reach is also `not_found`. A key with the `usage:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/usage" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------------- | ------ | ------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `period` | query | `string` | No | The month, `YYYY-MM`. The current month by default. | | `group_by` | query | `"project" \| "size" \| "sandbox" \| "end_user" \| "product"` | No | `product`: Pod's own sandboxes (`sandboxes`) apart from each connected service's (`pod-ci`), by billing mark. | | `project` | query | `string` | No | Only this project. | | `sandbox` | query | `string` | No | Only this sandbox. | | `end_user` | query | `string` | No | Only sandboxes labelled with this end user. One the caller cannot see is `not_found`. | | `mode` | query | `"test" \| "live"` | No | Test or live usage. A key's own mode by default; for a person, `live`. | | `include` | query | `string` | No | `cost` adds each row's estimated cost (`cost_cents`) and the page's total (`cost`), at Pod's rates, for resale. Comma-separated. | | `Pod-End-User` | header | `string` | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering `not_found`, and a create is labelled with it. An end user of another project, or one that is not there, is `not_found`; a suspended one refuses creates and wakes (`account_restricted`). | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** The usage. ```json title="200" { "cost": { "currency": "example", "total_cents": 0, "estimate": true }, "services": [ { "service": "example", "kind": "ci_runner", "unit": "seconds", "quantity": 0, "events": 0, "cost_cents": null } ], "period": "example", "start": "2026-11-23T12:00:00.000Z", "end": "2026-11-23T12:00:00.000Z", "mode": "test", "group_by": "project", "data": [ { "project": null, "size": null, "sandbox": null, "end_user": null, "awake_s": 0, "asleep_s": 0, "stopped_s": 0, "stored_byte_hours": 0, "egress_bytes": 0, "billing_mark": null, "product": null, "cost_cents": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cost` | `UsageCost` | No | With `include=cost`: the currency and the page's total, an estimate at Pod's rates: its rows' and, grouped by product, its `services`' `cost_cents`. | | `services` | `ServiceUsageRow[]` | No | With `group_by=product` only: each connected service's own usage, one row per service and kind, sorted by service and kind. Naming a sandbox keeps only the events that name it; naming an end user lists none. The same on every page. | | `period` | `string` | Yes | | | `start` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `end` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `mode` | `"test" \| "live"` | Yes | | | `group_by` | `"project" \| "size" \| "sandbox" \| "end_user" \| "product"` | Yes | `product`: Pod's own sandboxes (`sandboxes`) apart from each connected service's (`pod-ci`), by billing mark. Default `"project"`. | | `data` | `UsageRow[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ---------------------- | | TypeScript | `pod.usage.get({ … })` | | Python | `pod.usage.get(…)` | | mpod | `mpod usage` | # Attach a volume to a running sandbox (https://docs.mapier.ai/pod/api/volumes/attach-volume) > The volume appears in the sandbox as a disk of its own. **POST** `/v1/sandboxes/{sandbox_id}/volumes` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. The volume appears in the sandbox as a disk of its own. A volume is attached to one sandbox at a time: one attached elsewhere is `conflict`, and so is a sandbox that is not `running`. With `locked`, the volume is made ready but the sandbox cannot see it until `unlock` (Pod CI attaches a warm folder at create and unlocks it once the job is known). With `throwaway`, its writes stay on the sandbox's server and are gone when it is detached; it cannot be published. A volume can also be attached at create (`CreateSandboxRequest.volumes`). The volume and sandbox must belong to the same project and test or live mode. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/volumes" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"volume":"vol_3ahrz6dmv29gqy5ckt18fpx4b"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ----------- | --------- | -------- | --------------------------------------------------------------------------------------- | | `volume` | `string` | Yes | A block volume. | | `locked` | `boolean` | No | Make the volume ready but hidden from the sandbox until `unlock`. Default `false`. | | `throwaway` | `boolean` | No | Keep the sandbox's writes on its server only; they are gone at detach. Default `false`. | ## Answer [#answer] **200.** The volume, attached. ```json title="200" { "volume": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "locked": false, "throwaway": false, "attached_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | --------- | ------ | -------------------------------------------------------------------------- | | `volume` | `string` | Yes | A block volume. | | `sandbox` | `string` | Yes | | | `locked` | `boolean` | Yes | | | `throwaway` | `boolean` | Yes | | | `attached_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------------- | | TypeScript | `pod.volumes.attach(sandbox, volume, { locked })` | | Python | `pod.volumes.attach(sandbox, volume, locked=…)` | | mpod | `mpod sandboxes volumes attach ` | # Copy one generation of a volume (https://docs.mapier.ai/pod/api/volumes/copy-volume) > A new volume that starts from one generation (the newest by default) and shares every unchanged block with it, so it costs nothing to make. **POST** `/v1/volumes/{volume_id}/copy` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. A new volume that starts from one generation (the newest by default) and shares every unchanged block with it, so it costs nothing to make. A copy of a volume with no generation is empty ("stale beats missing": with none, a job runs cold). A generation past the cell's retention is gone: `not_found`. A generation that does not exist is `invalid`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/volumes/vol_3ahrz6dmv29gqy5ckt18fpx4b/copy" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"generation":0}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `volume_id` | path | `string` | Yes | A block volume. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | --------- | -------- | ------------------------------------------------------------------ | | `generation` | `integer` | No | The generation to copy; 0 for the newest. Default `0`. At least 0. | | `name` | `string` | No | The copy's label; the source's by default. | ## Answer [#answer] **201.** The copy. ```json title="201" { "id": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "size_gb": 1, "copied_from": null, "generations": [ { "number": 1, "created_at": "2026-11-23T12:00:00.000Z", "size_gb": 1 } ], "attached_to": null, "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ---------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | A block volume. | | `project` | `string` | Yes | | | `name` | `string` | Yes | A label, not unique. | | `size_gb` | `integer` | Yes | GiB. From 1 to 256. | | `copied_from` | `VolumeSource \| null` | Yes | | | `generations` | `VolumeGeneration[]` | Yes | Oldest first. A copy of one past the cell's retention is `not_found`. | | `attached_to` | `string \| null` | Yes | The sandbox the volume is attached to, if any. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------- | | TypeScript | `pod.volumes.copy(id, { generation })` | | Python | `pod.volumes.copy(id, generation=…)` | | mpod | `mpod volumes copy ` | # Make a volume (https://docs.mapier.ai/pod/api/volumes/create-volume) > A named block volume: a disk of its own that outlives any sandbox, with generations (frozen, read-only states) and copy-on-write copies. **POST** `/v1/volumes` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. A named block volume: a disk of its own that outlives any sandbox, with generations (frozen, read-only states) and copy-on-write copies. A new volume is empty and has no generation. It is attached to a sandbox with `POST /v1/sandboxes/{sandbox_id}/volumes`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/volumes" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"size_gb":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | --------- | -------- | ----------------------------------------------------------------- | | `name` | `string` | No | A label, not unique. | | `size_gb` | `integer` | Yes | GiB. From 1 to 256. | | `project` | `string` | No | A key's own project by default, and a key may name only that one. | ## Answer [#answer] **201.** The volume, made. ```json title="201" { "id": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "size_gb": 1, "copied_from": null, "generations": [ { "number": 1, "created_at": "2026-11-23T12:00:00.000Z", "size_gb": 1 } ], "attached_to": null, "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ---------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | A block volume. | | `project` | `string` | Yes | | | `name` | `string` | Yes | A label, not unique. | | `size_gb` | `integer` | Yes | GiB. From 1 to 256. | | `copied_from` | `VolumeSource \| null` | Yes | | | `generations` | `VolumeGeneration[]` | Yes | Oldest first. A copy of one past the cell's retention is `not_found`. | | `attached_to` | `string \| null` | Yes | The sandbox the volume is attached to, if any. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `pod.volumes.create({ size_gb })` | | Python | `pod.volumes.create(size_gb)` | | mpod | `mpod volumes create` | # Delete a volume (https://docs.mapier.ai/pod/api/volumes/delete-volume) > `conflict` while it is attached to a sandbox: detach it first. **DELETE** `/v1/volumes/{volume_id}` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. `conflict` while it is attached to a sandbox: detach it first. Its generations stay readable to copies made from them. Pod removes its data once nothing names it. A repeat on a deleted volume answers `204`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/volumes/vol_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `volume_id` | path | `string` | Yes | A block volume. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Deleted. ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------ | | TypeScript | `pod.volumes.delete(id)` | | Python | `pod.volumes.delete(id)` | | mpod | `mpod volumes delete ` | # Detach a volume from a sandbox (https://docs.mapier.ai/pod/api/volumes/detach-volume) > A kept volume's writes are saved first; a throwaway volume's are gone. **DELETE** `/v1/sandboxes/{sandbox_id}/volumes/{volume_id}` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. A kept volume's writes are saved first; a throwaway volume's are gone. The volume can then be attached elsewhere. Deleting the sandbox detaches its volumes. A volume not attached to this sandbox is `not_found`. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/volumes/vol_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `volume_id` | path | `string` | Yes | A block volume. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Detached. ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------------- | | TypeScript | `pod.volumes.detach(sandbox, volume)` | | Python | `pod.volumes.detach(sandbox, volume)` | | mpod | `mpod sandboxes volumes detach ` | # Get a volume, its generations and the sandbox it is attached to (https://docs.mapier.ai/pod/api/volumes/get-volume) > Get a volume, its generations and the sandbox it is attached to **GET** `/v1/volumes/{volume_id}` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/volumes/vol_3ahrz6dmv29gqy5ckt18fpx4b" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------- | ---- | -------- | -------- | --------------- | | `volume_id` | path | `string` | Yes | A block volume. | ## Answer [#answer] **200.** The volume. ```json title="200" { "id": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "size_gb": 1, "copied_from": null, "generations": [ { "number": 1, "created_at": "2026-11-23T12:00:00.000Z", "size_gb": 1 } ], "attached_to": null, "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ---------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | A block volume. | | `project` | `string` | Yes | | | `name` | `string` | Yes | A label, not unique. | | `size_gb` | `integer` | Yes | GiB. From 1 to 256. | | `copied_from` | `VolumeSource \| null` | Yes | | | `generations` | `VolumeGeneration[]` | Yes | Oldest first. A copy of one past the cell's retention is `not_found`. | | `attached_to` | `string \| null` | Yes | The sandbox the volume is attached to, if any. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------- | | TypeScript | `pod.volumes.get(id)` | | Python | `pod.volumes.get(id)` | | mpod | `mpod volumes get ` | # Grow a volume (https://docs.mapier.ai/pod/api/volumes/grow-volume) > Volumes never shrink: a size below the volume's is `invalid`, the same size changes nothing. **POST** `/v1/volumes/{volume_id}/grow` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. Volumes never shrink: a size below the volume's is `invalid`, the same size changes nothing. A volume attached to a sandbox grows there too; its filesystem is the guest's to grow. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/volumes/vol_3ahrz6dmv29gqy5ckt18fpx4b/grow" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"size_gb":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `volume_id` | path | `string` | Yes | A block volume. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | --------- | -------- | ------------------- | | `size_gb` | `integer` | Yes | GiB. From 1 to 256. | ## Answer [#answer] **200.** The volume at its new size. ```json title="200" { "id": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "size_gb": 1, "copied_from": null, "generations": [ { "number": 1, "created_at": "2026-11-23T12:00:00.000Z", "size_gb": 1 } ], "attached_to": null, "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ---------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | A block volume. | | `project` | `string` | Yes | | | `name` | `string` | Yes | A label, not unique. | | `size_gb` | `integer` | Yes | GiB. From 1 to 256. | | `copied_from` | `VolumeSource \| null` | Yes | | | `generations` | `VolumeGeneration[]` | Yes | Oldest first. A copy of one past the cell's retention is `not_found`. | | `attached_to` | `string \| null` | Yes | The sandbox the volume is attached to, if any. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------- | | TypeScript | `pod.volumes.grow(id, size_gb)` | | Python | `pod.volumes.grow(id, size_gb)` | | mpod | `mpod volumes grow ` | # List the volumes attached to a sandbox (https://docs.mapier.ai/pod/api/volumes/list-sandbox-volumes) > List the volumes attached to a sandbox **GET** `/v1/sandboxes/{sandbox_id}/volumes` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/volumes" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `sandbox_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The sandbox's volumes. ```json title="200" { "data": [ { "volume": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "locked": false, "throwaway": false, "attached_at": "2026-11-23T12:00:00.000Z" } ] } ``` | Field | Type | Always | What it is | | ------ | -------------------- | ------ | ---------- | | `data` | `VolumeAttachment[]` | Yes | | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------- | | TypeScript | `pod.volumes.attached(sandbox)` | | Python | `pod.volumes.attached(sandbox)` | | mpod | `mpod sandboxes volumes list ` | # List volumes (https://docs.mapier.ai/pod/api/volumes/list-volumes) > Deleted volumes are left out. **GET** `/v1/volumes` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. Deleted volumes are left out. A key with the `sandboxes:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/volumes" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | -------- | ----- | --------- | -------- | --------------------------------------------------------- | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of volumes, newest first. ```json title="200" { "data": [ { "id": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "size_gb": 1, "copied_from": null, "generations": [ { "number": 1, "created_at": "2026-11-23T12:00:00.000Z", "size_gb": 1 } ], "attached_to": null, "created_at": "2026-11-23T12:00:00.000Z" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Volume[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------- | | TypeScript | `pod.volumes.list()` | | Python | `pod.volumes.list()` | | mpod | `mpod volumes list` | # Save a volume's current state as a new generation (https://docs.mapier.ai/pod/api/volumes/publish-volume) > Freezes what the sandbox wrote to the volume into a read-only generation, which copies can start from, and goes on writing on top of it. **POST** `/v1/sandboxes/{sandbox_id}/volumes/{volume_id}/publish` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. Freezes what the sandbox wrote to the volume into a read-only generation, which copies can start from, and goes on writing on top of it. A throwaway or locked volume is `conflict`. The cell keeps the newest generations and drops older ones after a while (the cell's retention). A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/volumes/vol_3ahrz6dmv29gqy5ckt18fpx4b/publish" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `volume_id` | path | `string` | Yes | A block volume. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The volume, with its new generation last. ```json title="200" { "id": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "name": "example", "size_gb": 1, "copied_from": null, "generations": [ { "number": 1, "created_at": "2026-11-23T12:00:00.000Z", "size_gb": 1 } ], "attached_to": null, "created_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | ---------------------- | ------ | -------------------------------------------------------------------------- | | `id` | `string` | Yes | A block volume. | | `project` | `string` | Yes | | | `name` | `string` | Yes | A label, not unique. | | `size_gb` | `integer` | Yes | GiB. From 1 to 256. | | `copied_from` | `VolumeSource \| null` | Yes | | | `generations` | `VolumeGeneration[]` | Yes | Oldest first. A copy of one past the cell's retention is `not_found`. | | `attached_to` | `string \| null` | Yes | The sandbox the volume is attached to, if any. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`conflict`](https://docs.mapier.ai/pod/api/errors#conflict), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------------------------- | | TypeScript | `pod.volumes.publish(sandbox, volume)` | | Python | `pod.volumes.publish(sandbox, volume)` | | mpod | `mpod sandboxes volumes publish ` | # Let a sandbox see a volume attached locked (https://docs.mapier.ai/pod/api/volumes/unlock-volume) > Unlocking a volume that is not locked answers it as it is. **POST** `/v1/sandboxes/{sandbox_id}/volumes/{volume_id}/unlock` **Not available yet.** Volumes are not served by the API yet. Their calls answer from a stand-in. Unlocking a volume that is not locked answers it as it is. A key with the `sandboxes:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/volumes/vol_3ahrz6dmv29gqy5ckt18fpx4b/unlock" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `volume_id` | path | `string` | Yes | A block volume. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The volume, unlocked. ```json title="200" { "volume": "vol_3ahrz6dmv29gqy5ckt18fpx4b", "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b", "locked": false, "throwaway": false, "attached_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------- | --------- | ------ | -------------------------------------------------------------------------- | | `volume` | `string` | Yes | A block volume. | | `sandbox` | `string` | Yes | | | `locked` | `boolean` | Yes | | | `throwaway` | `boolean` | Yes | | | `attached_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------------------------- | | TypeScript | `pod.volumes.unlock(sandbox, volume)` | | Python | `pod.volumes.unlock(sandbox, volume)` | | mpod | `mpod sandboxes volumes unlock ` | # Make a webhook (https://docs.mapier.ai/pod/api/webhooks/create-webhook) > Makes a webhook for a project: its HTTPS address, the event types it takes (none named takes every type) and its signing secret, `whsec_…`, answered this once. **POST** `/v1/webhooks` Makes a webhook for a project: its HTTPS address, the event types it takes (none named takes every type) and its signing secret, `whsec_…`, answered this once. A key makes one for its own project; a person names the project. A project holds at most 10 (`quota_exceeded` naming `max_webhooks`). The address is `https`, carries no user name or password, and is not an internal or reserved address or name (`invalid` naming `url`); the same rule is checked again before every delivery. A repeat with the same `Idempotency-Key` answers `conflict`: the secret is never answered twice. A key with the `webhooks:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/webhooks" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------- | | `project` | `object` | No | The project; a key's own when absent. A person names one. | | `url` | `string` | Yes | | | `types` | `"sandbox.creating" \| "sandbox.running" \| "sandbox.stopping" \| "sandbox.sleeping" \| "sandbox.waking" \| "sandbox.stopped" \| "sandbox.deleting" \| "sandbox.deleted" \| "sandbox.error" \| "sandbox.changed"[]` | No | | | `description` | `string` | No | | | `enabled` | `boolean` | No | Default `true`. | ## Answer [#answer] **201.** The webhook and its secret, shown this once. ```json title="201" { "webhook": { "id": "whk_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "url": "https://app.example.com", "types": ["sandbox.creating"], "description": null, "enabled": false, "disabled_reason": null, "secret_rotation_ends_at": null, "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z" }, "secret": "example" } ``` | Field | Type | Always | What it is | | --------- | --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `webhook` | `Webhook` | Yes | | | `secret` | `string` | Yes | `whsec_` and the base64 of 32 random bytes. Shown once; Pod keeps it only encrypted for its cells. Check deliveries with it (Standard Webhooks `v1`; the SDKs' `verifyWebhook`). | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`quota_exceeded`](https://docs.mapier.ai/pod/api/errors#quota_exceeded). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------------------- | | TypeScript | `pod.webhooks.create({ url, … })` | | Python | `pod.webhooks.create(url=…, …)` | | mpod | `mpod webhooks create ` | # Remove a webhook (https://docs.mapier.ai/pod/api/webhooks/delete-webhook) > Stops every delivery to it, those waiting for a retry included. **DELETE** `/v1/webhooks/{webhook_id}` Stops every delivery to it, those waiting for a retry included. Its delivery log goes with it. The gateway has the change within the time the signed lists take to arrive (about 10 seconds). A key with the `webhooks:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/webhooks/whk_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `webhook_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Removed. ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | -------------------------------- | | TypeScript | `pod.webhooks.delete(id)` | | Python | `pod.webhooks.delete(id)` | | mpod | `mpod webhooks delete ` | # Get a webhook (https://docs.mapier.ai/pod/api/webhooks/get-webhook) > A webhook of a project the caller cannot reach is `not_found`, as one that does not exist. **GET** `/v1/webhooks/{webhook_id}` A webhook of a project the caller cannot reach is `not_found`, as one that does not exist. A key with the `webhooks:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/webhooks/whk_3ahrz6dmv29gqy5ckt18fp" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ---- | -------- | -------- | ---------- | | `webhook_id` | path | `string` | Yes | | ## Answer [#answer] **200.** The webhook. ```json title="200" { "id": "whk_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "url": "https://app.example.com", "types": ["sandbox.creating"], "description": null, "enabled": false, "disabled_reason": null, "secret_rotation_ends_at": null, "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `project` | `string` | Yes | | | `url` | `string` | Yes | | | `types` | `"sandbox.creating" \| "sandbox.running" \| "sandbox.stopping" \| "sandbox.sleeping" \| "sandbox.waking" \| "sandbox.stopped" \| "sandbox.deleting" \| "sandbox.deleted" \| "sandbox.error" \| "sandbox.changed"[]` | Yes | The types it takes; empty takes every type. | | `description` | `string \| null` | Yes | | | `enabled` | `boolean` | Yes | | | `disabled_reason` | `"failing" \| null` | Yes | | | `secret_rotation_ends_at` | `string \| null` | Yes | While a rotation's overlap runs, when the old secret stops signing; null otherwise. | | `created_by` | `string` | Yes | The identity account or key id that made it. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | ## Errors [#errors] The refusals this call is known for: [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------- | | TypeScript | `pod.webhooks.get(id)` | | Python | `pod.webhooks.get(id)` | | mpod | `mpod webhooks get ` | # Read a webhook's delivery log (https://docs.mapier.ai/pod/api/webhooks/list-webhook-deliveries) > Each attempt to deliver an event, newest first: when, the answer's status, how long it took, and what happens next. **GET** `/v1/webhooks/{webhook_id}/deliveries` Each attempt to deliver an event, newest first: when, the answer's status, how long it took, and what happens next. The log keeps a webhook's latest 1,000 attempts; this call answers the newest `limit` of them in one page, with no cursor. The answer a receiver gave is never read or kept, only its status. Served by the cell's gateway, which delivers. A key with the `webhooks:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/webhooks/whk_3ahrz6dmv29gqy5ckt18fp/deliveries" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------ | ----- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `webhook_id` | path | `string` | Yes | | | `limit` | query | `integer` | No | How many of the newest attempts to answer: 1 to 100, 20 when not given. The delivery log has its own bounds, as the gateway serves them. | ## Answer [#answer] **200.** The newest attempts, newest first. ```json title="200" { "data": [ { "event_id": "evt_3ahrz6dmv29gqy5ckt18fp", "replay_id": null, "attempt": 1, "at": "2026-11-23T12:00:00.000Z", "outcome": "delivered", "status": null, "error": null, "duration_ms": 0, "next_attempt_at": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ------------------- | ------ | ---------- | | `data` | `WebhookDelivery[]` | Yes | | | `next_cursor` | `string \| null` | No | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ------------------------------------ | | TypeScript | `pod.webhooks.deliveries(id)` | | Python | `pod.webhooks.deliveries(id)` | | mpod | `mpod webhooks deliveries ` | # List webhooks (https://docs.mapier.ai/pod/api/webhooks/list-webhooks) > The organization's webhooks, newest first. **GET** `/v1/webhooks` The organization's webhooks, newest first. A key sees its own project's; a person, those of the projects their role reaches. Never answers a secret. A key with the `webhooks:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/webhooks" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | --------- | ----- | --------- | -------- | ------------------------------------------------------------------------------- | | `project` | query | `string` | No | Only this project's webhooks. A project the caller cannot reach is `not_found`. | | `limit` | query | `integer` | No | | | `cursor` | query | `string` | No | The `next_cursor` of the page before. Valid for 24 hours. | ## Answer [#answer] **200.** A page of webhooks, newest first. ```json title="200" { "data": [ { "id": "whk_3ahrz6dmv29gqy5ckt18fp", "project": "prj_3ahrz6dmv29gqy5ckt18fp", "url": "https://app.example.com", "types": ["sandbox.creating"], "description": null, "enabled": false, "disabled_reason": null, "secret_rotation_ends_at": null, "created_by": "example", "created_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Webhook[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | --------------------- | | TypeScript | `pod.webhooks.list()` | | Python | `pod.webhooks.list()` | | mpod | `mpod webhooks list` | # Send a webhook's events again, from a time (https://docs.mapier.ai/pod/api/webhooks/replay-webhook) > Queues every event of the webhook's project since `since` (at most 7 days back), or of one sandbox, to be delivered again, in order per sandbox, with the ids they first had, so a receiver drops what it already has. **POST** `/v1/webhooks/{webhook_id}/replay` Queues every event of the webhook's project since `since` (at most 7 days back), or of one sandbox, to be delivered again, in order per sandbox, with the ids they first had, so a receiver drops what it already has. A replay runs in a lane of its own (`replay_id`, named in the delivery log) beside live delivery. `full` counts events not queued because the webhook's queue was full; `stale` those older than one the receiver already acknowledged for the same sandbox. A replay sends what live delivery would: only the webhook's types, and nothing while the webhook is off (`queued` is 0). Served by the cell's gateway. A key with the `webhooks:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/webhooks/whk_3ahrz6dmv29gqy5ckt18fp/replay" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"since":{}}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ----------------- | ------ | -------- | -------- | ---------------------------------------------- | | `webhook_id` | path | `string` | Yes | | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | -------- | -------- | ------------------------------------------------------- | | `since` | `object` | Yes | The first change to send again, within the last 7 days. | | `sandbox_id` | `object` | No | Only this sandbox's events. | ## Answer [#answer] **202.** The replay, queued. ```json title="202" { "replay_id": "rpl_3ahrz6dmv29gqy5ckt18fp", "queued": 0, "full": 0, "stale": 0 } ``` | Field | Type | Always | What it is | | ----------- | --------- | ------ | ------------------------------------------------------------------ | | `replay_id` | `string` | Yes | | | `queued` | `integer` | Yes | At least 0. | | `full` | `integer` | Yes | Not queued because the webhook's queue was full. At least 0. | | `stale` | `integer` | Yes | Older than a change the receiver already acknowledged. At least 0. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found). Any call can also answer `unauthorized`, `rate_limited`, `unavailable` or `internal`; the [error list](https://docs.mapier.ai/pod/api/errors) says what each means and when to send the call again. ## In the SDKs [#in-the-sdks] | Client | Call | | ---------- | ----------------------------------------------- | | TypeScript | `pod.webhooks.replay(id, { since })` | | Python | `pod.webhooks.replay(id, since=…)` | | mpod | `mpod webhooks replay --since