# Mapier Pod Agent IAM (Preview) # Answer an approval request (https://docs.mapier.ai/pod/iam/api/asks/answer-ask) > A person named as an approver for the project, with a second factor made after the question was opened and used for this answer only: `proof`, from Mapier identity, bound to this Ask, this answer and its duration, and the sandboxes named. **POST** `/v1/iam/asks/{ask_id}/answer` A person named as an approver for the project, with a second factor made after the question was opened and used for this answer only: `proof`, from Mapier identity, bound to this Ask, this answer and its duration, and the sandboxes named. No API key, webhook, automated system or session an agent is driving may answer, and Mapier staff never do. An answer becomes a grant in the signed grant list of each sandbox named, and only those: a sandbox that joined the Ask after it was shown, a fork, or a sandbox made later gets nothing. There is no "always". An Ask already answered or expired is `conflict`. A proof that does not check, or was used before, is `person_required`: confirm again. A `spend` Ask is answered the same way, by the same people, with the same proof and `Idempotency-Key`, for that one payment: `allow_once` or `deny`, with no `duration_s` (either is `invalid`, naming the field). It grants nothing; its answer goes to Pod's account service, where paying stays a person's act and the account's spend cap still applies (`spend.handover`). 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/iam/asks/example/answer?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"answer":"allow_once","sandboxes":["example"],"proof":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `ask_id` | path | `string` | Yes | Made by the server that refused the request, so it exists even while approvals is down. | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------ | -------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `answer` | `"allow_once" \| "allow_for_time" \| "deny"` | Yes | `allow_once`: this sandbox, this exact request, one use within 10 minutes. `allow_for_time`: this sandbox, the rule and thing as shown, 1 hour unless the approver picks otherwise, up to the policy's cap. `deny`: the same scope and time, so retries do not ask again. There is no "always". A `spend` Ask is answered `allow_once` (that one payment, within 10 minutes: one payment in total for every sandbox it names) or `deny`; never `allow_for_time`. | | `duration_s` | `integer \| null` | No | How long, for `allow_for_time` and `deny`; null or absent for the answer's default. Never past the policy's cap. `allow_once` ignores it. A `spend` Ask takes none: null or absent. From 1 to 86400. | | `sandboxes` | `string[]` | Yes | The sandboxes the approver was shown and answers for, from the Ask's `sandboxes`. The answer covers these and only these; one deleted since is skipped; one never listed on the Ask is `invalid`. | | `proof` | `string` | Yes | Mapier identity's one-answer second-factor proof: a signed token made when the person confirms with an authenticator app or a passkey, after the Ask was opened, naming this Ask, this answer, `duration_s` and a digest of `sandboxes`. Good for one answer, for at most 5 minutes. | ## Answer [#answer] **200.** The Ask with its answer. ```json title="200" { "id": "example", "kind": "permission", "spend": null, "state": "waiting", "opened_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "sandboxes": ["example"], "end_user": null, "policy": "example", "rule": "example", "request": { "action": "read", "method": null, "address": "example", "bytes": null, "content_type": null, "tool": null }, "claimed_reason": null, "allows": { "allow_once": "example", "allow_for_time": "example", "deny": "example" }, "policy_cap_s": null, "answer": null, "grants": [ { "sandbox": "example", "state": "waiting_to_apply" } ] } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | Made by the server that refused the request, so it exists even while approvals is down. | | `kind` | `"permission" \| "spend"` | No | Always sent by the approvals service; absent is read as `permission`. | | `spend` | `AskSpend \| null` | No | For a `spend` Ask, the amount; null otherwise. | | `state` | `"waiting" \| "allowed" \| "denied" \| "expired"` | Yes | | | `opened_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string` | Yes | An Ask nobody answers ends as Deny after 24 hours. | | `sandboxes` | `string[]` | Yes | The sandboxes asking. One question from many sandboxes under one policy is grouped. | | `end_user` | `string \| null` | Yes | The end user the sandboxes work for, if any. | | `policy` | `string` | Yes | | | `rule` | `string` | Yes | The rule that asked, in the simple form. | | `request` | `AskRequest` | Yes | The request behind an Ask, decoded on the server. A host name alone is never the whole question. | | `claimed_reason` | `string \| null` | Yes | What the agent said about why. A guest claim, shown apart; no decision uses it. | | `allows` | `object` | Yes | Exactly what each answer would allow, in plain words. | | `policy_cap_s` | `integer \| null` | Yes | The policy's cap on how long an answer lasts; null for 24 hours. | | `answer` | `AskGivenAnswer \| null` | Yes | The answer; null while waiting or once expired. | | `grants` | `AskGrant[]` | No | The grants the answer made, one for each sandbox it covers, and whether each sandbox's server has applied it. Empty while waiting, once expired, and for a spend request. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get who may answer the project's approval requests (https://docs.mapier.ai/pod/iam/api/asks/get-approvers) > The approver list is read as Asks are, with `permissions:read`. **GET** `/v1/iam/approvers` The approver list is read as Asks are, with `permissions:read`. `caller_may_answer` says whether the caller is on it. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/approvers?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The approver list. ```json title="200" { "project": "example", "accounts": ["example"], "caller_may_answer": false, "updated_at": null, "updated_by": null } ``` | Field | Type | Always | What it is | | ------------------- | ---------------- | ------ | ---------------------------------- | | `project` | `string` | Yes | | | `accounts` | `string[]` | Yes | | | `caller_may_answer` | `boolean` | Yes | Whether the caller is on the list. | | `updated_at` | `string \| null` | Yes | | | `updated_by` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get an approval request, decoded (https://docs.mapier.ai/pod/iam/api/asks/get-ask) > Get an approval request, decoded **GET** `/v1/iam/asks/{ask_id}` A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/asks/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `ask_id` | path | `string` | Yes | Made by the server that refused the request, so it exists even while approvals is down. | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The Ask. ```json title="200" { "id": "example", "kind": "permission", "spend": null, "state": "waiting", "opened_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "sandboxes": ["example"], "end_user": null, "policy": "example", "rule": "example", "request": { "action": "read", "method": null, "address": "example", "bytes": null, "content_type": null, "tool": null }, "claimed_reason": null, "allows": { "allow_once": "example", "allow_for_time": "example", "deny": "example" }, "policy_cap_s": null, "answer": null, "grants": [ { "sandbox": "example", "state": "waiting_to_apply" } ] } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | Made by the server that refused the request, so it exists even while approvals is down. | | `kind` | `"permission" \| "spend"` | No | Always sent by the approvals service; absent is read as `permission`. | | `spend` | `AskSpend \| null` | No | For a `spend` Ask, the amount; null otherwise. | | `state` | `"waiting" \| "allowed" \| "denied" \| "expired"` | Yes | | | `opened_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `expires_at` | `string` | Yes | An Ask nobody answers ends as Deny after 24 hours. | | `sandboxes` | `string[]` | Yes | The sandboxes asking. One question from many sandboxes under one policy is grouped. | | `end_user` | `string \| null` | Yes | The end user the sandboxes work for, if any. | | `policy` | `string` | Yes | | | `rule` | `string` | Yes | The rule that asked, in the simple form. | | `request` | `AskRequest` | Yes | The request behind an Ask, decoded on the server. A host name alone is never the whole question. | | `claimed_reason` | `string \| null` | Yes | What the agent said about why. A guest claim, shown apart; no decision uses it. | | `allows` | `object` | Yes | Exactly what each answer would allow, in plain words. | | `policy_cap_s` | `integer \| null` | Yes | The policy's cap on how long an answer lasts; null for 24 hours. | | `answer` | `AskGivenAnswer \| null` | Yes | The answer; null while waiting or once expired. | | `grants` | `AskGrant[]` | No | The grants the answer made, one for each sandbox it covers, and whether each sandbox's server has applied it. Empty while waiting, once expired, and for a spend request. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List approval requests (https://docs.mapier.ai/pod/iam/api/asks/list-asks) > Waiting Asks oldest first, or answered and ended ones newest first. **GET** `/v1/iam/asks` Waiting Asks oldest first, or answered and ended ones newest first. The same question from many sandboxes under one policy is one Ask, with the sandboxes listed. A person named as an approver is shown at most 10 waiting Asks at once, oldest first, and none while they have given 30 answers in the last hour; `approver` says so. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/asks?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `state` | query | `"waiting" \| "answered"` | No | `waiting`, or `answered` for those answered or expired. | | `kind` | query | `"permission" \| "spend"` | No | `permission` or `spend`; absent for both. | | `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 Asks. ```json title="200" { "data": [ { "id": "example", "kind": "permission", "spend": null, "state": "waiting", "opened_at": "2026-11-23T12:00:00.000Z", "expires_at": "2026-11-23T12:00:00.000Z", "sandboxes": ["example"], "end_user": null, "policy": "example", "rule": "example", "request": { "action": "read", "method": null, "address": "example", "bytes": null, "content_type": null, "tool": null }, "claimed_reason": null, "allows": { "allow_once": "example", "allow_for_time": "example", "deny": "example" }, "policy_cap_s": null, "answer": null, "grants": [ { "sandbox": "example", "state": "waiting_to_apply" } ] } ], "next_cursor": null, "approver": null } ``` | Field | Type | Always | What it is | | ------------- | ------------------------- | ------ | ----------------------------------------------------------------------------- | | `data` | `Ask[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | | `approver` | `AskApproverView \| null` | No | For a person named as an approver listing waiting Asks; null for anyone else. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Set who may answer the project's approval requests (https://docs.mapier.ai/pod/iam/api/asks/set-approvers) > People only, with a fresh second factor. **PUT** `/v1/iam/approvers` People only, with a fresh second factor. Each account must be a member of the organization. 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/iam/approvers?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"accounts":["example"]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 | Optional; when sent it must be the `project` of the query. | | `accounts` | `string[]` | Yes | | ## Answer [#answer] **200.** The approver list as set. ```json title="200" { "project": "example", "accounts": ["example"], "caller_may_answer": false, "updated_at": null, "updated_by": null } ``` | Field | Type | Always | What it is | | ------------------- | ---------------- | ------ | ---------------------------------- | | `project` | `string` | Yes | | | `accounts` | `string[]` | Yes | | | `caller_may_answer` | `boolean` | Yes | Whether the caller is on the list. | | `updated_at` | `string \| null` | Yes | | | `updated_by` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`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. # Add rules for one sandbox, beneath the ceiling (https://docs.mapier.ai/pod/iam/api/bindings/add-sandbox-rules) > Adds rules at the sandbox layer: they are added to the policy the sandbox runs under, and cut to the ceiling, the project's and the organization's policies. **POST** `/v1/iam/bindings/{sandbox_id}/rules` Adds rules at the sandbox layer: they are added to the policy the sandbox runs under, and cut to the ceiling, the project's and the organization's policies. A rule cut is listed in `cut` and not stored. Mounting a folder through Pod's API calls this with a `read` or `write` rule. A rule can never share a folder with another policy domain or message one; only a person writes those, into a stored policy (`invalid`). A key with the `permissions:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/bindings/example/rules?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"rules":"example","base_version":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `base_version` | `integer` | Yes | At least 1. | ## Answer [#answer] **200.** The binding at its new version, and what was cut to the ceiling. ```json title="200" { "binding": { "sandbox": "example", "policy": null, "sandbox_rules": "example", "version": 1, "table_hash": null, "applied_version": null, "parent": null, "bound_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "person": null, "groups": [ { "group_policy": "example", "group": "example", "group_name": "example", "policy": "example" } ], "matter": null, "cleared": null }, "cut": [ { "line": 1, "rule": "example", "reason": "example", "group": { "group_policy": "example", "group": "example", "group_name": "example", "policy": "example" }, "matter": "example", "wall": false } ] } ``` | Field | Type | Always | What it is | | --------- | ----------- | ------ | ------------------------------------------------------------------------ | | `binding` | `Binding` | Yes | The policy one sandbox runs under, and its rules for that sandbox alone. | | `cut` | `CutRule[]` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Bind a policy to a new sandbox (https://docs.mapier.ai/pod/iam/api/bindings/bind-sandbox) > Names the policy a sandbox about to be made runs under, with rules for that one sandbox. **POST** `/v1/iam/bindings` Names the policy a sandbox about to be made runs under, with rules for that one sandbox. Pod's front door calls this during a create that names a policy or carries rules from a spec file, made by a person or with a project key, and passes on that caller's own credentials, so the callers below are the create's; the server must hold the compiled table before the sandbox runs anything. `policy: null` is the project's default. Rules for the sandbox are cut to the ceiling, and the answer says what was cut. A sandbox already bound in this project is `conflict`. Only attaching a policy closes the network. A sandbox id proves nothing by itself, and only the front door's registry knows the sandbox being made is in the caller's project. So only Pod's front door makes this call, while it creates a sandbox: a call you send yourself is `forbidden`. A sandbox bound in another project or organization is `not_found`, the same answer as for any sandbox this project does not have. A create made with a key issued inside a sandbox never reaches this route: that key is refused here like everywhere in this API. The front door binds such a child itself, and binds only the parent's policy or one whose table lists the parent's among those it narrows, never none and never the project's default. A key with the `permissions:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/bindings?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"sandbox":"example","policy":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox` | `string` | Yes | | | `policy` | `string \| null` | Yes | The policy; null for the project's default. | | `rules` | `string` | No | Rules for this sandbox alone, from a create call or a spec file. Cut to the ceiling. | | `parent` | `string` | No | For a child, the sandbox it is made from. The child gets its parent's policy or a narrower one. | | `matter` | `string` | No | The person it acts for must be cleared for the matter, or the call answers `forbidden` and the refusal is written to the matter's log; a sandbox made with a key acts for nobody and is never cleared. A child stays on its parent's matter. | ## Answer [#answer] **201.** The binding, and what was cut to the ceiling. ```json title="201" { "binding": { "sandbox": "example", "policy": null, "sandbox_rules": "example", "version": 1, "table_hash": null, "applied_version": null, "parent": null, "bound_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "person": null, "groups": [ { "group_policy": "example", "group": "example", "group_name": "example", "policy": "example" } ], "matter": null, "cleared": null }, "cut": [ { "line": 1, "rule": "example", "reason": "example", "group": { "group_policy": "example", "group": "example", "group_name": "example", "policy": "example" }, "matter": "example", "wall": false } ] } ``` | Field | Type | Always | What it is | | --------- | ----------- | ------ | ------------------------------------------------------------------------ | | `binding` | `Binding` | Yes | The policy one sandbox runs under, and its rules for that sandbox alone. | | `cut` | `CutRule[]` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get the policy a sandbox runs under (https://docs.mapier.ai/pod/iam/api/bindings/get-binding) > Get the policy a sandbox runs under **GET** `/v1/iam/bindings/{sandbox_id}` A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/bindings/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The binding. ```json title="200" { "sandbox": "example", "policy": null, "sandbox_rules": "example", "version": 1, "table_hash": null, "applied_version": null, "parent": null, "bound_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "person": null, "groups": [ { "group_policy": "example", "group": "example", "group_name": "example", "policy": "example" } ], "matter": null, "cleared": null } ``` | Field | Type | Always | What it is | | ----------------- | ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox` | `string` | Yes | | | `policy` | `string \| null` | Yes | The policy; null for the project's default, for a sandbox with no policy. | | `sandbox_rules` | `string` | Yes | The sandbox layer's rules, empty when there are none. | | `version` | `integer` | Yes | The binding's version. Only goes up. At least 1. | | `table_hash` | `string \| null` | Yes | The hash of the compiled table the sandbox should run; null until compiled. | | `applied_version` | `integer \| null` | Yes | The binding version the sandbox's server reports applied; null until it reports one. | | `parent` | `string \| null` | Yes | The sandbox it was made from, for a child; null otherwise. | | `bound_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`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `person` | `string \| null` | No | The identity account the sandbox acts for: the person who made it, or a child's parent's person. Null for a sandbox made with a key. | | `groups` | `AppliedGroup[]` | No | The group bindings that add their policy's rules to this sandbox's table now: the person's groups, as the directory holds them, that the project binds to a policy. | | `matter` | `string \| null` | No | The client matter the sandbox was opened for; null for none. Set once. | | `cleared` | `boolean \| null` | No | For a sandbox on a matter, whether its person is cleared for the matter now; while false its table allows nothing. Null for a sandbox on no matter. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List which policy each sandbox runs under (https://docs.mapier.ai/pod/iam/api/bindings/list-bindings) > List which policy each sandbox runs under **GET** `/v1/iam/bindings` A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/bindings?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `policy` | query | `string` | No | Only the sandboxes bound to this policy. | | `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 bindings, newest first. ```json title="200" { "data": [ { "sandbox": "example", "policy": null, "sandbox_rules": "example", "version": 1, "table_hash": null, "applied_version": null, "parent": null, "bound_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "person": null, "groups": [ { "group_policy": "example", "group": "example", "group_name": "example", "policy": "example" } ], "matter": null, "cleared": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Binding[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Narrow a running sandbox (https://docs.mapier.ai/pod/iam/api/bindings/narrow-sandbox) > Replaces the sandbox's own rules, its policy, or both, with ones that allow no more than now. **POST** `/v1/iam/bindings/{sandbox_id}/narrow` Replaces the sandbox's own rules, its policy, or both, with ones that allow no more than now. A change that would allow anything the sandbox cannot reach now is `invalid`: widening a running sandbox is a policy change, made by a person. A key with the `permissions:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/bindings/example/narrow?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"base_version":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | --------- | -------- | ------------------------------------------------------------------------- | | `base_version` | `integer` | Yes | At least 1. | | `policy` | `string` | No | A policy whose table lists the current one among those it narrows. | | `rules` | `string` | No | The sandbox layer's new rules, which allow no more than the current ones. | ## Answer [#answer] **200.** The binding at its new version. ```json title="200" { "sandbox": "example", "policy": null, "sandbox_rules": "example", "version": 1, "table_hash": null, "applied_version": null, "parent": null, "bound_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "person": null, "groups": [ { "group_policy": "example", "group": "example", "group_name": "example", "policy": "example" } ], "matter": null, "cleared": null } ``` | Field | Type | Always | What it is | | ----------------- | ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sandbox` | `string` | Yes | | | `policy` | `string \| null` | Yes | The policy; null for the project's default, for a sandbox with no policy. | | `sandbox_rules` | `string` | Yes | The sandbox layer's rules, empty when there are none. | | `version` | `integer` | Yes | The binding's version. Only goes up. At least 1. | | `table_hash` | `string \| null` | Yes | The hash of the compiled table the sandbox should run; null until compiled. | | `applied_version` | `integer \| null` | Yes | The binding version the sandbox's server reports applied; null until it reports one. | | `parent` | `string \| null` | Yes | The sandbox it was made from, for a child; null otherwise. | | `bound_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`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `person` | `string \| null` | No | The identity account the sandbox acts for: the person who made it, or a child's parent's person. Null for a sandbox made with a key. | | `groups` | `AppliedGroup[]` | No | The group bindings that add their policy's rules to this sandbox's table now: the person's groups, as the directory holds them, that the project binds to a policy. | | `matter` | `string \| null` | No | The client matter the sandbox was opened for; null for none. Set once. | | `cleared` | `boolean \| null` | No | For a sandbox on a matter, whether its person is cleared for the matter now; while false its table allows nothing. Null for a sandbox on no matter. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Say what a sandbox's table would decide for a request (https://docs.mapier.ai/pod/iam/api/connection-test/test-connection) > The connection test: decides a request against a sandbox's table and its live grants, or against a policy's table, without sending anything. **POST** `/v1/iam/connection-tests` The connection test: decides a request against a sandbox's table and its live grants, or against a policy's table, without sending anything. Name exactly one of `sandbox` and `policy` (`invalid` otherwise). Changes nothing and records nothing. A sandbox's live grants are the newest grant list the publisher signed for it, used once the sandbox's server has applied it, as the server decides. A list that cannot be read, is not applied yet, or answers another table is not used (deny when unsure), and `grants` says so. A key with the `permissions:read` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/connection-tests?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"request":{"action":"read","thing":"example"}}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | ------------- | -------- | ----------------------------------------------------- | | `sandbox` | `string` | No | Decide with this sandbox's table and its live grants. | | `policy` | `string` | No | Decide with this policy's table, with no grants. | | `request` | `TestRequest` | Yes | | ## Answer [#answer] **200.** What the table would decide, and why. ```json title="200" { "verdict": "allow", "rule": null, "reason": "example", "read": false, "log_only": false, "baseline": false, "cut_off": false, "grant": null, "grants": null, "policy": null, "policy_version": null } ``` | Field | Type | Always | What it is | | ---------------- | ---------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `verdict` | `"allow" \| "ask" \| "deny"` | Yes | | | `rule` | `string \| null` | Yes | The rule that decided, in the simple form; null when the baseline, a cut-off or the verdict for everything else decided. | | `reason` | `string` | Yes | Why, in plain words. | | `read` | `boolean` | Yes | Whether the request would be read. | | `log_only` | `boolean` | Yes | Whether log-only mode would let a `net` Deny or Ask through and record it. | | `baseline` | `boolean` | Yes | Whether the fixed baseline decided. It always blocks internal addresses, private networks and outbound mail. | | `cut_off` | `boolean` | Yes | Whether a cut-off decided. | | `grant` | `string \| null` | Yes | The Ask whose answer decided, when a live grant of the sandbox's grant list did; null otherwise. An "allow once" grant is reported as allowing, and `reason` notes that the sandbox's server may already have used it: the server keeps which once grants it used. | | `grants` | `DecisionGrantList` | Yes | Which grant list of the sandbox the answer was decided with; null for a policy's table, which has no grants. Only a list the sandbox's server has applied, bound to the table deciding here, is used; otherwise the request is decided with no grants (deny when unsure). | | `policy` | `string \| null` | Yes | | | `policy_version` | `integer \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Lift a cut-off (https://docs.mapier.ai/pod/iam/api/cut-offs/lift-cut-off) > People only, with a fresh second factor. **DELETE** `/v1/iam/cut-offs/{cut_off_id}` People only, with a fresh second factor. Lifting widens; pulling only narrows. A table another cut-off in force covers stays cut. Lifting does not resume a sandbox the scheduler paused: a person resumes it in Pod. Lifting one already lifted answers 204 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 DELETE "https://api.pod.mapier.ai/v1/iam/cut-offs/example?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `cut_off_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Lifted. ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List the cut-offs in force (https://docs.mapier.ai/pod/iam/api/cut-offs/list-cut-offs) > List the cut-offs in force **GET** `/v1/iam/cut-offs` A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/cut-offs?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 cut-offs, newest first. ```json title="200" { "data": [ { "id": "example", "target": "sandbox", "target_id": "example", "pulled_at": "2026-11-23T12:00:00.000Z", "pulled_by": "example", "state": "waiting", "confirmed_at": null, "escalated_at": null, "paused": ["example"], "not_paused": [ { "sandbox": "example", "reason": "example" } ] } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `CutOff[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Pull the cut-off switch (https://docs.mapier.ai/pod/iam/api/cut-offs/pull-cut-off) > Refuses all network traffic of one sandbox, every sandbox of one policy, or the whole project, at once. **POST** `/v1/iam/cut-offs` Refuses all network traffic of one sandbox, every sandbox of one policy, or the whole project, at once. Only narrows, as stopping a sandbox does, so a project key with `permissions:write` may. A cut-off a server does not confirm in 5 seconds is passed to Pod's scheduler, which pauses the sandbox. Pulling the same target again while it is in force answers the cut-off in force. A sandbox cut off alone runs a table of its own from then on. A key with the `permissions:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/cut-offs?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target":"sandbox","target_id":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 | Optional; when sent it must be the `project` of the query. | | `target` | `"sandbox" \| "policy" \| "project"` | Yes | | | `target_id` | `string` | Yes | | ## Answer [#answer] **201.** The cut-off, in force. ```json title="201" { "id": "example", "target": "sandbox", "target_id": "example", "pulled_at": "2026-11-23T12:00:00.000Z", "pulled_by": "example", "state": "waiting", "confirmed_at": null, "escalated_at": null, "paused": ["example"], "not_paused": [ { "sandbox": "example", "reason": "example" } ] } ``` | Field | Type | Always | What it is | | -------------- | ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `target` | `"sandbox" \| "policy" \| "project"` | Yes | | | `target_id` | `string` | Yes | The sandbox, the policy or the project. | | `pulled_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `pulled_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `state` | `"waiting" \| "confirmed" \| "escalated"` | Yes | `waiting`: servers have not all applied a table carrying the cut-off yet. `confirmed`: every sandbox's server has. `escalated`: some had not within 5 seconds, and those sandboxes were passed to Pod's scheduler to pause. | | `confirmed_at` | `string \| null` | Yes | | | `escalated_at` | `string \| null` | Yes | | | `paused` | `string[]` | Yes | Sandboxes Pod's scheduler paused because their server did not confirm in time. | | `not_paused` | `object[]` | Yes | Sandboxes passed to the scheduler that it did not pause, and why. They are asked again. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Decide one request for another system (OpenID AuthZEN) (https://docs.mapier.ai/pod/iam/api/decision-api/evaluate-access) > The answer is the stored table's, decided with the same lookup Pod's enforcement points run, with the fixed baseline applied to an address as the servers apply it. **POST** `/v1/iam/authzen/access/v1/evaluation` **Not available yet.** Pod's API does not answer this call yet. The answer is the stored table's, decided with the same lookup Pod's enforcement points run, with the fixed baseline applied to an address as the servers apply it. It is the connection test in AuthZEN's shape. `decision` is what Pod's own enforcement point would do: an Allow is `true`; a Deny or an Ask is `false`, except that log-only mode lets a `net` Deny or Ask through (`true`, with `log_only` in the context). The baseline and a cut-off are always `false`. An Ask stays a refusal until a person answers it (AuthZEN's approval draft: a denial is never an opening to act). An Ask answered Allow for a time is then `true`, with `grant` (the Ask) and `grant_id` in the context. An "allow once" grant is named with `verdict: allow`, `grant_once` and a remark that the server may already have used it (the server keeps which it used), but the decision is `false`: a caller that acted on `true` could use it more than once. A list not applied yet, a publisher that does not answer, or a list that answers another sandbox, policy or project is never an allow: the request is decided with no grants and `context.grants` says why. A policy's table has no grants (`context.grants` is null). The subject is `sandbox` or `policy`; the action is a rule's action; the resource is a `host` or an `address` for `net`, a `folder` for `read` and `write`, a `tool` for `use`, and a `policy` or a `topic` for `msg`. Any other property, and any `context`, is refused (`invalid`) rather than ignored. A subject Pod cannot decide for (no binding, an unknown policy, a ceiling, a table not compiled yet) answers `200` with `decision: false` and `context.error`. Changes and records nothing. AuthZEN's `X-Request-ID` is echoed. A project's decision point metadata is public, at `/.well-known/authzen-configuration/v1/iam/authzen/`, outside this description. A key with the `permissions:read` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/authzen/access/v1/evaluation?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"subject":{"type":"sandbox","id":"example"},"action":{"name":"read"},"resource":{"type":"host","id":"example"}}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `X-Request-ID` | header | `string` | No | AuthZEN's request identifier. The answer carries the same value back. | ## Body [#body] | Field | Type | Required | What it is | | ---------- | ----------------- | -------- | --------------------------------------------------------------------------------------------------- | | `subject` | `AuthzenSubject` | Yes | Whose table decides. | | `action` | `AuthzenAction` | Yes | | | `resource` | `AuthzenResource` | Yes | | | `context` | `AuthzenContext` | No | Pod decides at the time of the call with the stored table and reads no context; send none, or `{}`. | ## Answer [#answer] **200.** The decision, with Pod's reasons, or `false` with the error that kept Pod from deciding. ```json title="200" { "decision": false, "context": { "verdict": "allow", "rule": null, "reason_admin": { "en": "example" }, "read": false, "log_only": false, "baseline": false, "cut_off": false, "grant": null, "grant_id": null, "grant_once": false, "grants": null, "policy": null, "policy_version": null } } ``` | Field | Type | Always | What it is | | ---------- | ----------------------------------------------- | ------ | --------------------------------------------------------------------------------- | | `decision` | `boolean` | Yes | What Pod's own enforcement point would do. `false` whenever Pod could not decide. | | `context` | `AuthzenDecisionContext \| AuthzenErrorContext` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Decide many requests in one call (OpenID AuthZEN) (https://docs.mapier.ai/pod/iam/api/decision-api/evaluate-accesses) > AuthZEN's access evaluations: up to 100 evaluations (a limit of ours), answered in order. **POST** `/v1/iam/authzen/access/v1/evaluations` **Not available yet.** Pod's API does not answer this call yet. AuthZEN's access evaluations: up to 100 evaluations (a limit of ours), answered in order. A `subject`, `action`, `resource` or `context` at the top level is the default for every evaluation that leaves it out. `options.evaluations_semantic` is `execute_all` (the default), `deny_on_first_deny` (stop after the first `false`) or `permit_on_first_permit` (stop after the first `true`); a call that stops answers only the evaluations up to and including that one. An evaluation that cannot be read, or whose subject Pod cannot decide for, answers `decision: false` with `context.error`; the others are still decided. A body that is not the shape at all is `invalid`. With no `evaluations`, the call is one evaluation and answers as `evaluateAccess` does. A key with the `permissions:read` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/authzen/access/v1/evaluations?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"subject":{"type":"sandbox","id":"example"}}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | | `X-Request-ID` | header | `string` | No | AuthZEN's request identifier. The answer carries the same value back. | ## Body [#body] | Field | Type | Required | What it is | | ------------- | ------------------------- | -------- | --------------------------------------------------------------------------------------------------- | | `subject` | `AuthzenSubject` | No | Whose table decides. | | `action` | `AuthzenAction` | No | | | `resource` | `AuthzenResource` | No | | | `context` | `AuthzenContext` | No | Pod decides at the time of the call with the stored table and reads no context; send none, or `{}`. | | `evaluations` | `AuthzenEvaluationItem[]` | No | | | `options` | `object` | No | | ## Answer [#answer] **200.** The decisions, in the order asked; or one decision, for a call with no `evaluations`. ```json title="200" { "evaluations": [ { "decision": false, "context": { "verdict": "allow", "rule": null, "reason_admin": { "en": null }, "read": false, "log_only": false, "baseline": false, "cut_off": false, "grant": null, "grant_id": null, "grant_once": false, "grants": null, "policy": null, "policy_version": null } } ] } ``` ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Accept a draft as a named policy (https://docs.mapier.ai/pod/iam/api/drafts/accept-draft) > People only, with a fresh second factor: accepting makes a stored policy. **POST** `/v1/iam/drafts/{draft_id}/accept` People only, with a fresh second factor: accepting makes a stored policy. The person is shown what the draft allows first. The draft becomes a named policy that narrows the one it was drafted under; the person may edit the rules before accepting (`rules`). The compiler refuses one that widens (`invalid`). A draft not `ready` 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/iam/drafts/example/accept?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `draft_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `rules` | `string` | No | The rules as the person edited them; the draft's own when absent. | ## Answer [#answer] **201.** The named policy the draft became. ```json title="201" { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null, "rules": "example", "narrows": ["example"], "reading": { "on": false, "because": ["example"] }, "ask_cap_s": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `layer` | `"organisation" \| "project" \| "named" \| "project_default"` | Yes | The layers a person edits as stored policies. The organization's and the project's are the ceiling. | | `version` | `integer` | Yes | Only goes up. At least 1. | | `mode` | `"enforce" \| "log_only"` | Yes | | | `log_only_until` | `string \| null` | Yes | When log-only mode ends; null when enforcing. | | `rule_count` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes running under the policy, as servers report it. At least 0. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `preset` | `PinnedPreset \| null` | Yes | The preset the policy pins; null for none. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `narrows` | `string[]` | Yes | The policies above this one, which the checker proved it no wider than. | | `reading` | `object` | Yes | Whether Pod reads the traffic of sandboxes under the policy, and the rules that make it. | | `ask_cap_s` | `integer \| null` | Yes | The longest an answer to an Ask lasts under this policy; null for 24 hours. At least 1. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Ask for a draft (https://docs.mapier.ai/pod/iam/api/drafts/create-draft) > Drafts rules that narrow a policy: from watching a log-only run (`watching`), one narrow rule for a refusal (`refusal`), or from a task with a model (`task`, which is metered to the customer at cost plus a margin). **POST** `/v1/iam/drafts` Drafts rules that narrow a policy: from watching a log-only run (`watching`), one narrow rule for a refusal (`refusal`), or from a task with a model (`task`, which is metered to the customer at cost plus a margin). A draft is not a policy until a person accepts it (`acceptDraft`). It cannot switch on log-only mode, connect a tool or widen a tool's traffic. Everything the model reads is treated as hostile input, and its output is read as the simple form and nothing else. The two ways that need no model can ship before the stage that brings the third. A cell with no model route set answers `task` as `invalid` on `way`. What the model is shown is the cell's setting, the task text only by default (open decision 1); a draft from a task names the model and what it was shown in its `problems`. A key with the `permissions:write` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/drafts?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"way":"watching","policy":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------- | ----------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `way` | `"watching" \| "refusal" \| "task"` | Yes | `watching`: rules recommended from a first run in log-only mode. `refusal`: one narrow rule for a refusal. `task`: a policy drafted from the task by a model (metered). | | `policy` | `string` | Yes | The policy the draft narrows. A draft is a layer under it and can never widen it. | | `sandbox` | `string` | No | For `watching`: the sandbox of the log-only run. For `refusal`: the sandbox refused. For `task`: optional, the sandbox the task is for, kept with the draft; nothing of it is shown to the model. | | `refusal` | `string` | No | For `refusal`: the row of the refusal. | | `task` | `string` | No | For `task`: the task text, required and not blank. Read as hostile input. | ## Answer [#answer] **201.** The draft, being drafted or ready. ```json title="201" { "id": "example", "way": "watching", "state": "drafting", "policy": "example", "rules": null, "newly_allows": ["example"], "problems": [ { "line": null, "message": "example" } ], "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example", "accepted_as": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `way` | `"watching" \| "refusal" \| "task"` | Yes | `watching`: rules recommended from a first run in log-only mode. `refusal`: one narrow rule for a refusal. `task`: a policy drafted from the task by a model (metered). | | `state` | `"drafting" \| "ready" \| "failed" \| "accepted" \| "discarded"` | Yes | | | `policy` | `string` | Yes | | | `rules` | `string \| null` | Yes | The drafted rules in the simple form; null until ready. | | `newly_allows` | `string[]` | Yes | What the draft would allow, in plain words, for the person who reviews it. | | `problems` | `Problem[]` | Yes | | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `created_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `accepted_as` | `string \| null` | Yes | The named policy the draft became. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`not_found`](https://docs.mapier.ai/pod/api/errors#not_found), [`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. # Discard a draft (https://docs.mapier.ai/pod/iam/api/drafts/discard-draft) > Discarding takes nothing away from any policy, so it is open to whoever may ask for a draft. **DELETE** `/v1/iam/drafts/{draft_id}` Discarding takes nothing away from any policy, so it is open to whoever may ask for a draft. A key with the `permissions:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/iam/drafts/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `draft_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Discarded. ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get a draft with what it would allow (https://docs.mapier.ai/pod/iam/api/drafts/get-draft) > Get a draft with what it would allow **GET** `/v1/iam/drafts/{draft_id}` A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/drafts/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `draft_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The draft. ```json title="200" { "id": "example", "way": "watching", "state": "drafting", "policy": "example", "rules": null, "newly_allows": ["example"], "problems": [ { "line": null, "message": "example" } ], "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example", "accepted_as": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `way` | `"watching" \| "refusal" \| "task"` | Yes | `watching`: rules recommended from a first run in log-only mode. `refusal`: one narrow rule for a refusal. `task`: a policy drafted from the task by a model (metered). | | `state` | `"drafting" \| "ready" \| "failed" \| "accepted" \| "discarded"` | Yes | | | `policy` | `string` | Yes | | | `rules` | `string \| null` | Yes | The drafted rules in the simple form; null until ready. | | `newly_allows` | `string[]` | Yes | What the draft would allow, in plain words, for the person who reviews it. | | `problems` | `Problem[]` | Yes | | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `created_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `accepted_as` | `string \| null` | Yes | The named policy the draft became. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List the project's drafts (https://docs.mapier.ai/pod/iam/api/drafts/list-drafts) > A draft is read as a policy is, with `permissions:read`. **GET** `/v1/iam/drafts` A draft is read as a policy is, with `permissions:read`. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/drafts?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 drafts, newest first. ```json title="200" { "data": [ { "id": "example", "way": "watching", "state": "drafting", "policy": "example", "rules": null, "newly_allows": ["example"], "problems": [ { "line": null, "message": "example" } ], "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example", "accepted_as": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Draft[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Bind a group of the identity provider to a named policy (https://docs.mapier.ai/pod/iam/api/groups/bind-group-policy) > People only, with a fresh second factor. **POST** `/v1/iam/group-policies` **Not available yet.** Pod's API does not answer this call yet. People only, with a fresh second factor. The rules of the policy are added to the own table of every sandbox in this project made by a person in the group, cut to the ceiling as a sandbox's own rules are; a rule that reaches another policy domain is cut. Every such sandbox is compiled before the answer, and one that would not pass refuses the binding (`invalid`, naming it). Name the group by its id, or, for a directory of sign-in tokens, by the name the identity provider writes in the groups claim (the group is made if no one in it has signed in yet). At most 100 group bindings a project. 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/iam/group-policies?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"policy":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] Name the group by `group` or by `group_name`, exactly one. | Field | Type | Required | What it is | | ------------ | -------- | -------- | ---------------------------------------- | | `group` | `string` | No | A group of the organization's directory. | | `group_name` | `string` | No | | | `policy` | `string` | Yes | | ## Answer [#answer] **201.** The group binding, and how many sandboxes were compiled with it. ```json title="201" { "group_policy": { "id": "example", "group": "example", "group_name": "example", "policy": "example", "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example" }, "sandboxes": 0, "tables": 0 } ``` | Field | Type | Always | What it is | | -------------- | ------------- | ------ | ------------------------------------------------ | | `group_policy` | `GroupPolicy` | Yes | | | `sandboxes` | `integer` | Yes | Sandboxes compiled with the binding. At least 0. | | `tables` | `integer` | Yes | New tables queued for the publisher. At least 0. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Delete the organization's directory (https://docs.mapier.ai/pod/iam/api/groups/delete-directory) > People only, with a fresh second factor. **DELETE** `/v1/iam/directory` **Not available yet.** Pod's API does not answer this call yet. People only, with a fresh second factor. Deletes the directory, its people, groups and links, and every project's group bindings. Every sandbox that took a policy from a group is compiled again without it before the answer. 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/iam/directory?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get the organization's directory (https://docs.mapier.ai/pod/iam/api/groups/get-directory) > The organization's directory: where its groups come from (SCIM, or the groups claim of the identity provider's sign-in tokens), how sign-in tokens are checked (the key set by key id only), and how many people, groups and linked accounts it holds. **GET** `/v1/iam/directory` **Not available yet.** Pod's API does not answer this call yet. The organization's directory: where its groups come from (SCIM, or the groups claim of the identity provider's sign-in tokens), how sign-in tokens are checked (the key set by key id only), and how many people, groups and linked accounts it holds. Never the SCIM token. `not_found` when there is none. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/directory?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The directory. ```json title="200" { "source": "scim", "oidc": null, "subject_claim": "example", "groups_claim": "example", "membership_ttl_s": 300, "scim_token_made_at": null, "people": 0, "groups": 0, "linked_accounts": 0, "version": 1, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example" } ``` | Field | Type | Always | What it is | | -------------------- | ----------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `source` | `"scim" \| "oidc"` | Yes | Where groups come from: pushed by the identity provider over SCIM 2.0 to `/scim/v2`, or the groups claim of its sign-in tokens, each membership lapsing after `membership_ttl_s` without a newer sign-in. | | `oidc` | `DirectoryOidc \| null` | Yes | How the identity provider's sign-in tokens are checked; null when not set. | | `subject_claim` | `string` | Yes | The sign-in token's claim that names the person, as SCIM's `externalId` does. | | `groups_claim` | `string` | Yes | | | `membership_ttl_s` | `integer` | Yes | From 300 to 86400. | | `scim_token_made_at` | `string \| null` | Yes | When the SCIM token in use was made; null for a directory of sign-in tokens. | | `people` | `integer` | Yes | At least 0. | | `groups` | `integer` | Yes | At least 0. | | `linked_accounts` | `integer` | Yes | Identity accounts linked to a person of the directory by a sign-in through it. At least 0. | | `version` | `integer` | Yes | At least 1. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List which groups the project binds to which policies (https://docs.mapier.ai/pod/iam/api/groups/list-group-policies) > List which groups the project binds to which policies **GET** `/v1/iam/group-policies` **Not available yet.** Pod's API does not answer this call yet. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/group-policies?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 group bindings. ```json title="200" { "data": [ { "id": "example", "group": "example", "group_name": "example", "policy": "example", "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `GroupPolicy[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List the directory's groups (https://docs.mapier.ai/pod/iam/api/groups/list-groups) > The organization's groups as the identity provider gives them, by name, each with how many people are in it now and the policies this project binds it to. **GET** `/v1/iam/groups` **Not available yet.** Pod's API does not answer this call yet. The organization's groups as the identity provider gives them, by name, each with how many people are in it now and the policies this project binds it to. People are counted, never listed. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/groups?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 groups, by name. ```json title="200" { "data": [ { "id": "example", "name": "example", "external_id": null, "members": 0, "policies": ["example"] } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Group[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Set up or change the organization's directory (https://docs.mapier.ai/pod/iam/api/groups/set-directory) > People only, with a fresh second factor. **PUT** `/v1/iam/directory` **Not available yet.** Pod's API does not answer this call yet. People only, with a fresh second factor. Sets where the organization's groups come from and how the identity provider's sign-in tokens are checked. A SCIM directory gets a SCIM token when it is made, and a new one when `new_scim_token` is true; the token is in this answer only (`scim_token`), never stored here in the clear, and the old one stops working at once. A repeat of the call with the same Idempotency-Key answers without the token. Changing the source is `conflict`: delete the directory first. `base_version` is 0 to make 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 PUT "https://api.pod.mapier.ai/v1/iam/directory?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"source":"scim","base_version":0}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------------------ | ------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `source` | `"scim" \| "oidc"` | Yes | | | `base_version` | `integer` | Yes | The directory's version the change was made from; 0 to make it. At least 0. | | `oidc` | `DirectoryOidcRequest \| null` | No | The identity provider's issuer, Pod's client id there, and its key set (JWKS) as a document. Needed for `oidc`, and for linking accounts to a SCIM directory's people. This service never fetches it. | | `subject_claim` | `string` | No | Default `"sub"`. | | `groups_claim` | `string` | No | Default `"groups"`. | | `membership_ttl_s` | `integer` | No | Default `43200`. From 300 to 86400. | | `new_scim_token` | `boolean` | No | Default `false`. | ## Answer [#answer] **200.** The directory as set, with a new SCIM token when one was made. ```json title="200" { "source": "scim", "oidc": null, "subject_claim": "example", "groups_claim": "example", "membership_ttl_s": 300, "scim_token_made_at": null, "people": 0, "groups": 0, "linked_accounts": 0, "version": 1, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "scim_token": null } ``` | Field | Type | Always | What it is | | -------------------- | ----------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `source` | `"scim" \| "oidc"` | Yes | Where groups come from: pushed by the identity provider over SCIM 2.0 to `/scim/v2`, or the groups claim of its sign-in tokens, each membership lapsing after `membership_ttl_s` without a newer sign-in. | | `oidc` | `DirectoryOidc \| null` | Yes | How the identity provider's sign-in tokens are checked; null when not set. | | `subject_claim` | `string` | Yes | The sign-in token's claim that names the person, as SCIM's `externalId` does. | | `groups_claim` | `string` | Yes | | | `membership_ttl_s` | `integer` | Yes | From 300 to 86400. | | `scim_token_made_at` | `string \| null` | Yes | When the SCIM token in use was made; null for a directory of sign-in tokens. | | `people` | `integer` | Yes | At least 0. | | `groups` | `integer` | Yes | At least 0. | | `linked_accounts` | `integer` | Yes | Identity accounts linked to a person of the directory by a sign-in through it. At least 0. | | `version` | `integer` | Yes | At least 1. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `scim_token` | `string \| null` | Yes | The new SCIM token, shown this once; null when none was made. Give it to the identity provider as the bearer token of its SCIM app. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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). 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. # Unbind a group from a policy (https://docs.mapier.ai/pod/iam/api/groups/unbind-group-policy) > People only, with a fresh second factor. **DELETE** `/v1/iam/group-policies/{group_policy_id}` **Not available yet.** Pod's API does not answer this call yet. People only, with a fresh second factor. Every sandbox that took the policy from the group is compiled again without it, and its new table queued, before the answer. 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/iam/group-policies/example?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `group_policy_id` | path | `string` | Yes | A project's binding of a group to a policy. | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **204.** Unbound. ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # API reference (https://docs.mapier.ai/pod/iam/api) > Every call of Pod Agent IAM's API, with its fields, its answer and its errors Write policies, connect tools, bind policies to sandboxes, answer asks, read and export the record, and draft policies from a task. Every call goes to Pod's API at `https://api.pod.mapier.ai`, beside Pod's own calls, and is signed the same way: an API key in `Authorization: Bearer`, with the scope each page names, or a signed-in person in the dashboard. [Keys and projects](https://docs.mapier.ai/pod/sandboxes/keys-and-projects) explains keys and scopes. Answers are JSON. A refusal names its error from Pod's one [error list](https://docs.mapier.ai/pod/api/errors). Stored policies, their checks and log-only mode. Mapier's presets, such as "coding" and "model APIs". Connected tools. Which policy each sandbox runs under, and its rules for that one sandbox. Groups Every table the project compiles keeps the walls. What a sandbox's table would decide for a request, without sending it. What a sandbox's or a policy's table decides, for other systems, in OpenID AuthZEN's shape. The switch that refuses all of a sandbox's network traffic at once. Approval requests. One row per decision, written by the server that made it. Policies drafted from a log-only run, a refusal or a task, for a person to review. # Delete the walls between the project's matters (https://docs.mapier.ai/pod/iam/api/matters/delete-matters) > People only, with a fresh second factor. **DELETE** `/v1/iam/matters` **Not available yet.** Pod's API does not answer this call yet. People only, with a fresh second factor. Marks every matter removed and deletes the walls document. Sandboxes opened for a matter allow nothing from then on; policies compile as with no walls. Each matter's log is kept. 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/iam/matters?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Read a matter's log (https://docs.mapier.ai/pod/iam/api/matters/get-matter-log) > The matter's own log, oldest first: the wall set, changed, removed or restored; each sandbox opened for it or refused; each table compiled for a sandbox on it, and each closed because its person is no longer cleared or the matter is gone. **GET** `/v1/iam/matters/{matter_id}/log` **Not available yet.** Pod's API does not answer this call yet. The matter's own log, oldest first: the wall set, changed, removed or restored; each sandbox opened for it or refused; each table compiled for a sandbox on it, and each closed because its person is no longer cleared or the matter is gone. The rows are a hash chain, checked from the first row on every read: `chain` says whether it verifies and, if not, at which row. Read as the record is read. A key with the `permissions:records` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/matters/example/log?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `matter_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 log, oldest first, and the state of the whole chain. ```json title="200" { "matter": "example", "data": [ { "seq": 1, "at": "2026-11-23T12:00:00.000Z", "kind": "set", "sandbox": null, "actor": "example", "detail": {}, "prev_sha256": "example", "sha256": "example" } ], "next_cursor": null, "chain": { "rows": 0, "head_sha256": null, "verified": false, "problem": null } } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `matter` | `string` | No | | | `data` | `MatterLogRow[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | | `chain` | `object` | No | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get the project's walls document (https://docs.mapier.ai/pod/iam/api/matters/get-matter-walls) > Where the project's matters came from, the tools every matter may use, how many matters are live, and the version: the `base_version` of the next `setMatters`. **GET** `/v1/iam/matter-walls` **Not available yet.** Pod's API does not answer this call yet. Where the project's matters came from, the tools every matter may use, how many matters are live, and the version: the `base_version` of the next `setMatters`. `not_found` when the project has no walls. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/matter-walls?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The walls document. ```json title="200" { "source": "example", "firm_tools": ["example"], "matters": 0, "version": 1, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example" } ``` | Field | Type | Always | What it is | | ------------ | ---------- | ------ | ------------------------------------------------------------------------------------------------------- | | `source` | `string` | Yes | The firm's document system, as the admin names it. | | `firm_tools` | `string[]` | Yes | Connected tools every matter's sandboxes may use. A tool of no matter not listed here is cut from them. | | `matters` | `integer` | Yes | Live matters. At least 0. | | `version` | `integer` | Yes | At least 1. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get one matter (https://docs.mapier.ai/pod/iam/api/matters/get-matter) > The matter as stored, and how many sandboxes have been opened for it. **GET** `/v1/iam/matters/{matter_id}` **Not available yet.** Pod's API does not answer this call yet. The matter as stored, and how many sandboxes have been opened for it. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/matters/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `matter_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The matter. ```json title="200" { "id": "example", "external_id": "example", "client_id": null, "wall": "inclusive", "allowed_users_count": 0, "allowed_groups": ["example"], "screened_users_count": 0, "screened_groups": ["example"], "folders": [ { "folder": "example", "access": "read" } ], "hosts": ["example"], "networks": ["example"], "tools": ["example"], "topics": ["example"], "rules": "example", "version": 1, "created_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z", "removed_at": null, "sandboxes": 0 } ``` | Field | Type | Always | What it is | | ---------------------- | ---------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `external_id` | `string` | Yes | | | `client_id` | `string \| null` | Yes | | | `wall` | `"inclusive" \| "exclusive"` | Yes | | | `allowed_users_count` | `integer` | Yes | People listed by name. People are counted, never listed, as the directory's are. At least 0. | | `allowed_groups` | `string[]` | Yes | | | `screened_users_count` | `integer` | Yes | At least 0. | | `screened_groups` | `string[]` | Yes | | | `folders` | `MatterFolder[]` | Yes | | | `hosts` | `string[]` | Yes | | | `networks` | `string[]` | Yes | | | `tools` | `string[]` | Yes | | | `topics` | `string[]` | Yes | | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `version` | `integer` | Yes | At least 1. | | `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`. | | `removed_at` | `string \| null` | Yes | When the document system stopped listing it; null while it is live. | | `sandboxes` | `integer` | No | Sandboxes opened for it (getMatter only). At least 0. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List the project's matters (https://docs.mapier.ai/pod/iam/api/matters/list-matters) > The project's client matters as the firm's document system gives them, by the document system's id, removed ones included (with `removed_at`). **GET** `/v1/iam/matters` **Not available yet.** Pod's API does not answer this call yet. The project's client matters as the firm's document system gives them, by the document system's id, removed ones included (with `removed_at`). The walls document they came from is `getMatterWalls`. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/matters?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 matters, by the document system's id. ```json title="200" { "data": [ { "id": "example", "external_id": "example", "client_id": null, "wall": "inclusive", "allowed_users_count": 0, "allowed_groups": ["example"], "screened_users_count": 0, "screened_groups": ["example"], "folders": [ { "folder": "example", "access": "read" } ], "hosts": ["example"], "networks": ["example"], "tools": ["example"], "topics": ["example"], "rules": "example", "version": 1, "created_at": "2026-11-23T12:00:00.000Z", "updated_at": "2026-11-23T12:00:00.000Z", "removed_at": null, "sandboxes": 0 } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Matter[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Set the walls between the project's matters (https://docs.mapier.ai/pod/iam/api/matters/set-matters) > People only, with a fresh second factor. **PUT** `/v1/iam/matters` **Not available yet.** Pod's API does not answer this call yet. People only, with a fresh second factor. Replaces the project's matters with the ones the firm's document system exports: each matter's id there, an inclusive wall (only the people and groups listed work on it) or an exclusive one (everyone but those screened), and what belongs to it (folders, hosts, address ranges, connected tools, message topics). A matter left out is marked removed, never deleted, and its sandboxes allow nothing. Refused (`invalid`, every problem named) when a folder, tool or topic is in two matters, or two matters' hosts or ranges overlap: no table could keep them apart. Every policy and every sandbox with a table of its own is compiled again before the answer; a policy that would no longer pass refuses the change, and a sandbox that would not is given a table that allows nothing. `base_version` is 0 to make the walls. 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/iam/matters?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"source":"example","base_version":0,"matters":[{"external_id":"example","wall":"inclusive"}]}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | -------------------- | -------- | ----------------------------------------------------------- | | `source` | `string` | Yes | The firm's document system (`imanage`, `netdocuments`,...). | | `base_version` | `integer` | Yes | At least 0. | | `firm_tools` | `string[]` | No | | | `matters` | `MatterDefinition[]` | Yes | | ## Answer [#answer] **200.** The walls as set, and what compiling the project again did. ```json title="200" { "walls": { "source": "example", "firm_tools": ["example"], "matters": 0, "version": 1, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example" }, "added": 0, "changed": 0, "removed": 0, "sandboxes": 0, "tables": 0, "closed": 0 } ``` | Field | Type | Always | What it is | | ----------- | ------------- | ------ | ----------------------------------------------------------------------- | | `walls` | `MatterWalls` | Yes | | | `added` | `integer` | Yes | At least 0. | | `changed` | `integer` | Yes | Matters changed, or listed again after being removed. At least 0. | | `removed` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes with a table of their own compiled again. At least 0. | | `tables` | `integer` | Yes | New tables queued for the publisher. At least 0. | | `closed` | `integer` | Yes | Sandboxes that could not be compiled and now allow nothing. At least 0. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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). 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. # Check a change to a policy without saving it (https://docs.mapier.ai/pod/iam/api/policies/check-policy) > Runs the compiler's checks on the rules as they would be and says, in plain words, what the change newly allows and no longer allows, and whether it switches traffic reading on. **POST** `/v1/iam/policies/{policy_id}/check` Runs the compiler's checks on the rules as they would be and says, in plain words, what the change newly allows and no longer allows, and whether it switches traffic reading on. Changes nothing. A key with the `permissions:read` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/policies/example/check?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"rules":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `policy_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------- | ------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `preset` | `PresetRef \| null` | No | The preset the policy would pin, or null for none; left out keeps the one it pins. | ## Answer [#answer] **200.** What the change would do. ```json title="200" { "valid": false, "problems": [ { "line": null, "message": "example" } ], "newly_allows": ["example"], "no_longer_allows": ["example"], "reading_on": false } ``` | Field | Type | Always | What it is | | ------------------ | ----------- | ------ | --------------------------------------------- | | `valid` | `boolean` | Yes | | | `problems` | `Problem[]` | Yes | | | `newly_allows` | `string[]` | Yes | What the change newly allows, in plain words. | | `no_longer_allows` | `string[]` | Yes | | | `reading_on` | `boolean` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Make a named policy (https://docs.mapier.ai/pod/iam/api/policies/create-policy) > People only, with a fresh second factor. **POST** `/v1/iam/policies` People only, with a fresh second factor. A named policy narrows the project's policy; the check runs first and a policy that does not pass it is refused with its problems (`invalid`). 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/iam/policies?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"example","rules":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `ask_cap_s` | `integer \| null` | No | From 1 to 86400. | ## Answer [#answer] **201.** The policy as made. ```json title="201" { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null, "rules": "example", "narrows": ["example"], "reading": { "on": false, "because": ["example"] }, "ask_cap_s": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `layer` | `"organisation" \| "project" \| "named" \| "project_default"` | Yes | The layers a person edits as stored policies. The organization's and the project's are the ceiling. | | `version` | `integer` | Yes | Only goes up. At least 1. | | `mode` | `"enforce" \| "log_only"` | Yes | | | `log_only_until` | `string \| null` | Yes | When log-only mode ends; null when enforcing. | | `rule_count` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes running under the policy, as servers report it. At least 0. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `preset` | `PinnedPreset \| null` | Yes | The preset the policy pins; null for none. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `narrows` | `string[]` | Yes | The policies above this one, which the checker proved it no wider than. | | `reading` | `object` | Yes | Whether Pod reads the traffic of sandboxes under the policy, and the rules that make it. | | `ask_cap_s` | `integer \| null` | Yes | The longest an answer to an Ask lasts under this policy; null for 24 hours. At least 1. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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). 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. # Delete a named policy (https://docs.mapier.ai/pod/iam/api/policies/delete-policy) > People only, with a fresh second factor. **DELETE** `/v1/iam/policies/{policy_id}` People only, with a fresh second factor. Only a named policy can be deleted, and only while no sandbox runs under it and no other policy narrows it (`conflict` otherwise). 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/iam/policies/example?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `policy_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Switch log-only mode off early (https://docs.mapier.ai/pod/iam/api/policies/end-log-only) > People only, with a fresh second factor, as switching it on is. **DELETE** `/v1/iam/policies/{policy_id}/log-only` People only, with a fresh second factor, as switching it on is. 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/iam/policies/example/log-only?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `policy_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** The policy, enforcing again. ```json title="200" { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null, "rules": "example", "narrows": ["example"], "reading": { "on": false, "because": ["example"] }, "ask_cap_s": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `layer` | `"organisation" \| "project" \| "named" \| "project_default"` | Yes | The layers a person edits as stored policies. The organization's and the project's are the ceiling. | | `version` | `integer` | Yes | Only goes up. At least 1. | | `mode` | `"enforce" \| "log_only"` | Yes | | | `log_only_until` | `string \| null` | Yes | When log-only mode ends; null when enforcing. | | `rule_count` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes running under the policy, as servers report it. At least 0. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `preset` | `PinnedPreset \| null` | Yes | The preset the policy pins; null for none. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `narrows` | `string[]` | Yes | The policies above this one, which the checker proved it no wider than. | | `reading` | `object` | Yes | Whether Pod reads the traffic of sandboxes under the policy, and the rules that make it. | | `ask_cap_s` | `integer \| null` | Yes | The longest an answer to an Ask lasts under this policy; null for 24 hours. At least 1. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get a stored policy with its rules (https://docs.mapier.ai/pod/iam/api/policies/get-policy) > Get a stored policy with its rules **GET** `/v1/iam/policies/{policy_id}` A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/policies/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `policy_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The policy. ```json title="200" { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null, "rules": "example", "narrows": ["example"], "reading": { "on": false, "because": ["example"] }, "ask_cap_s": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `layer` | `"organisation" \| "project" \| "named" \| "project_default"` | Yes | The layers a person edits as stored policies. The organization's and the project's are the ceiling. | | `version` | `integer` | Yes | Only goes up. At least 1. | | `mode` | `"enforce" \| "log_only"` | Yes | | | `log_only_until` | `string \| null` | Yes | When log-only mode ends; null when enforcing. | | `rule_count` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes running under the policy, as servers report it. At least 0. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `preset` | `PinnedPreset \| null` | Yes | The preset the policy pins; null for none. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `narrows` | `string[]` | Yes | The policies above this one, which the checker proved it no wider than. | | `reading` | `object` | Yes | Whether Pod reads the traffic of sandboxes under the policy, and the rules that make it. | | `ask_cap_s` | `integer \| null` | Yes | The longest an answer to an Ask lasts under this policy; null for 24 hours. At least 1. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List the project's stored policies (https://docs.mapier.ai/pod/iam/api/policies/list-policies) > The organization's baseline, the project's policy, its named policies and its default for sandboxes with no policy, top layer first. **GET** `/v1/iam/policies` The organization's baseline, the project's policy, its named policies and its default for sandboxes with no policy, top layer first. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/policies?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 policies. ```json title="200" { "data": [ { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ----------------- | ------ | ---------- | | `data` | `PolicySummary[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Change a stored policy's rules (https://docs.mapier.ai/pod/iam/api/policies/save-policy) > People only, with a fresh second factor. **PUT** `/v1/iam/policies/{policy_id}` People only, with a fresh second factor. The organization's baseline and the project's policy are the ceiling (`change_ceiling`); a named policy and the project's default are `change_policy`. The person is shown what the change newly allows (`checkPolicy`) before they save. A change made from an older version than the stored one is `conflict`. A policy that does not pass the check is `invalid`, with the first problem's line in the message. A child gets at most its parent's policy: a change to a named policy or the project's default that would leave a child of a sandbox running it allowing more than its parent is `conflict`, naming each such child and its parent, and nothing is written or queued; narrow the child first. 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/iam/policies/example?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"rules":"example","base_version":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `policy_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | -------------- | ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `base_version` | `integer` | Yes | The version the change was made from. At least 1. | | `ask_cap_s` | `integer \| null` | No | From 1 to 86400. | ## Answer [#answer] **200.** The policy at its new version. ```json title="200" { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null, "rules": "example", "narrows": ["example"], "reading": { "on": false, "because": ["example"] }, "ask_cap_s": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `layer` | `"organisation" \| "project" \| "named" \| "project_default"` | Yes | The layers a person edits as stored policies. The organization's and the project's are the ceiling. | | `version` | `integer` | Yes | Only goes up. At least 1. | | `mode` | `"enforce" \| "log_only"` | Yes | | | `log_only_until` | `string \| null` | Yes | When log-only mode ends; null when enforcing. | | `rule_count` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes running under the policy, as servers report it. At least 0. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `preset` | `PinnedPreset \| null` | Yes | The preset the policy pins; null for none. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `narrows` | `string[]` | Yes | The policies above this one, which the checker proved it no wider than. | | `reading` | `object` | Yes | Whether Pod reads the traffic of sandboxes under the policy, and the rules that make it. | | `ask_cap_s` | `integer \| null` | Yes | The longest an answer to an Ask lasts under this policy; null for 24 hours. At least 1. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Switch log-only mode on until a time (https://docs.mapier.ai/pod/iam/api/policies/set-log-only) > People only, with a fresh second factor. **PUT** `/v1/iam/policies/{policy_id}/log-only` People only, with a fresh second factor. Log-only mode turns a `net` Deny or Ask into "let through and record what would have happened". It never mounts a folder, never attaches a key and never lifts the baseline. It always has an end time: an hour at least, a week at most. 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/iam/policies/example/log-only?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"until":"2026-11-23T12:00:00.000Z"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `policy_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ------- | -------- | -------- | ------------------------------------------------------------------- | | `until` | `string` | Yes | When log-only mode ends. An hour from now at least, a week at most. | ## Answer [#answer] **200.** The policy in log-only mode. ```json title="200" { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null, "rules": "example", "narrows": ["example"], "reading": { "on": false, "because": ["example"] }, "ask_cap_s": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `layer` | `"organisation" \| "project" \| "named" \| "project_default"` | Yes | The layers a person edits as stored policies. The organization's and the project's are the ceiling. | | `version` | `integer` | Yes | Only goes up. At least 1. | | `mode` | `"enforce" \| "log_only"` | Yes | | | `log_only_until` | `string \| null` | Yes | When log-only mode ends; null when enforcing. | | `rule_count` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes running under the policy, as servers report it. At least 0. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `preset` | `PinnedPreset \| null` | Yes | The preset the policy pins; null for none. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `narrows` | `string[]` | Yes | The policies above this one, which the checker proved it no wider than. | | `reading` | `object` | Yes | Whether Pod reads the traffic of sandboxes under the policy, and the rules that make it. | | `ask_cap_s` | `integer \| null` | Yes | The longest an answer to an Ask lasts under this policy; null for 24 hours. At least 1. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get a preset with every version's rules (https://docs.mapier.ai/pod/iam/api/presets/get-preset) > Get a preset with every version's rules **GET** `/v1/iam/presets/{preset}` **Not available yet.** Pod's API does not answer this call yet. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/presets/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `preset` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The preset. ```json title="200" { "name": "example", "latest_version": 1, "versions": [ { "version": 1, "published": "example", "summary": "example", "rule_count": 0, "newly_allows": ["example"], "no_longer_allows": ["example"], "rules": "example" } ] } ``` | Field | Type | Always | What it is | | ---------------- | ----------------- | ------ | ------------- | | `name` | `string` | Yes | | | `latest_version` | `integer` | Yes | At least 1. | | `versions` | `PresetVersion[]` | Yes | Oldest first. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List Mapier's presets (https://docs.mapier.ai/pod/iam/api/presets/list-presets) > Every preset with its versions, oldest first, and what each version newly allows and no longer allows over the one before it. **GET** `/v1/iam/presets` **Not available yet.** Pod's API does not answer this call yet. Every preset with its versions, oldest first, and what each version newly allows and no longer allows over the one before it. Without the rules; `getPreset` gives them. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/presets?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 presets, by name. ```json title="200" { "data": [ { "name": "example", "latest_version": 1, "versions": [ { "version": 1, "published": "example", "summary": "example", "rule_count": 0, "newly_allows": ["example"], "no_longer_allows": ["example"], "rules": "example" } ] } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Preset[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Pin a preset at a version, or none (https://docs.mapier.ai/pod/iam/api/presets/set-policy-preset) > People only, with a fresh second factor. **PUT** `/v1/iam/policies/{policy_id}/preset` People only, with a fresh second factor. A named policy or the project's default pins one of Mapier's presets at one version. The preset sits beneath the ceiling and above the policy's own rules, which narrow it; a policy with no rules of its own runs the preset. A change that newly allows anything (a newer version that allows more, a first preset on a policy with no rules, or no preset at all) is refused with what it newly allows (`invalid`, field `accept_newly_allows`) until the person sends `accept_newly_allows: true`. `checkPolicy` with `preset` shows the same list first. A pin that would leave a child of a sandbox running the policy allowing more than its parent is `conflict`, naming each such child; narrow the child first. 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/iam/policies/example/preset?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"preset":{"name":"example","version":1},"base_version":1}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `policy_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | --------------------- | ------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `preset` | `PresetRef \| null` | Yes | The preset and version to pin, or null for none. | | `base_version` | `integer` | Yes | The policy's version the change was made from. At least 1. | | `accept_newly_allows` | `boolean` | No | A person has read what the change newly allows and accepts it (a newer version that allows more needs a person's acceptance). Default `false`. | ## Answer [#answer] **200.** The policy at its new version. ```json title="200" { "id": "example", "name": "example", "layer": "organisation", "version": 1, "mode": "enforce", "log_only_until": null, "rule_count": 0, "sandboxes": 0, "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example", "preset": null, "rules": "example", "narrows": ["example"], "reading": { "on": false, "because": ["example"] }, "ask_cap_s": null } ``` | Field | Type | Always | What it is | | ---------------- | ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `layer` | `"organisation" \| "project" \| "named" \| "project_default"` | Yes | The layers a person edits as stored policies. The organization's and the project's are the ceiling. | | `version` | `integer` | Yes | Only goes up. At least 1. | | `mode` | `"enforce" \| "log_only"` | Yes | | | `log_only_until` | `string \| null` | Yes | When log-only mode ends; null when enforcing. | | `rule_count` | `integer` | Yes | At least 0. | | `sandboxes` | `integer` | Yes | Sandboxes running under the policy, as servers report it. At least 0. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `preset` | `PinnedPreset \| null` | Yes | The preset the policy pins; null for none. | | `rules` | `string` | Yes | Rules in the simple form, one a line: a verdict, an action and a thing (`Allow net api.github.com GET /repos/*`). At most 1,000 rules a policy. | | `narrows` | `string[]` | Yes | The policies above this one, which the checker proved it no wider than. | | `reading` | `object` | Yes | Whether Pod reads the traffic of sandboxes under the policy, and the rules that make it. | | `ask_cap_s` | `integer \| null` | Yes | The longest an answer to an Ask lasts under this policy; null for 24 hours. At least 1. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Export the record for a time range (https://docs.mapier.ai/pod/iam/api/record/export-record) > Starts an export of the project's rows in a time range, in a standard security-log format, with the chain head of every sandbox in it so the customer can keep the heads and check the chain themselves. **POST** `/v1/iam/records/exports` Starts an export of the project's rows in a time range, in a standard security-log format, with the chain head of every sandbox in it so the customer can keep the heads and check the chain themselves. Follow it with `getRecordExport`. A project that keeps its record past the 90 days (`getRecordRetention`) exports any range it keeps. Delivery to the project's own store is `setRecordDelivery`. A key with the `permissions:records` scope. ## Request [#request] ```bash curl -X POST "https://api.pod.mapier.ai/v1/iam/records/exports?project=example" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"from":"2026-11-23T12:00:00.000Z","to":"2026-11-23T12:00:00.000Z","format":"ocsf"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `to` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `format` | `"ocsf" \| "otlp"` | Yes | `ocsf`: OCSF events as JSON lines. `otlp`: OpenTelemetry log records as OTLP JSON. | | `sandbox` | `string` | No | Only this sandbox's rows. | ## Answer [#answer] **202.** The export, started. ```json title="202" { "id": "example", "state": "running", "format": "ocsf", "from": "2026-11-23T12:00:00.000Z", "to": "2026-11-23T12:00:00.000Z", "sandbox": null, "rows": null, "chain_heads": [ { "sandbox": "example", "seq": 0, "hash": "example" } ], "download_url": null, "expires_at": null, "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example", "problem": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------- | ------ | --------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `state` | `"running" \| "ready" \| "failed"` | Yes | | | `format` | `"ocsf" \| "otlp"` | Yes | `ocsf`: OCSF events as JSON lines. `otlp`: OpenTelemetry log records as OTLP JSON. | | `from` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `to` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `sandbox` | `string \| null` | Yes | | | `rows` | `integer \| null` | Yes | At least 0. | | `chain_heads` | `ChainHead[]` | Yes | | | `download_url` | `string \| null` | Yes | Once `ready`, where to fetch the file, signed and short-lived. | | `expires_at` | `string \| null` | Yes | | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `created_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `problem` | `string \| null` | Yes | Why it failed. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get where the project's record is delivered, and how far it has got (https://docs.mapier.ai/pod/iam/api/record/get-record-delivery) > Never with the store's secret, which cannot be read back. **GET** `/v1/iam/records/delivery` Never with the store's secret, which cannot be read back. A key with the `permissions:records` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/records/delivery?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The delivery. ```json title="200" { "store": { "kind": "s3", "endpoint": "https://app.example.com", "region": "example", "bucket": "example", "prefix": "example", "path_style": false, "access_key_id": "example" }, "format": "ocsf", "lock_days": null, "series": "example", "from": "2026-11-23T12:00:00.000Z", "delivered_through": "2026-11-23T12:00:00.000Z", "files": 0, "last_manifest": null, "state": "delivering", "failures": 0, "last_error": null, "next_try_at": null, "window_seconds": 1, "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example", "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example" } ``` | Field | Type | Always | What it is | | ------------------- | --------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `store` | `RecordStore` | Yes | A bucket of the customer's, reached over the S3 API: AWS S3, Google Cloud Storage's XML API with HMAC keys, or any store that speaks it. Reached over HTTPS only, and only at public addresses. | | `format` | `"ocsf" \| "otlp"` | Yes | `ocsf`: OCSF events as JSON lines. `otlp`: OpenTelemetry log records as OTLP JSON. | | `lock_days` | `integer \| null` | Yes | | | `series` | `string` | Yes | The folder of the bucket this series of files goes under. | | `from` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `delivered_through` | `string` | Yes | The end of the last window delivered. | | `files` | `integer` | Yes | Manifests delivered in this series. At least 0. | | `last_manifest` | `string \| null` | Yes | | | `state` | `"delivering" \| "failing"` | Yes | | | `failures` | `integer` | Yes | At least 0. | | `last_error` | `string \| null` | Yes | | | `next_try_at` | `string \| null` | Yes | | | `window_seconds` | `integer` | Yes | At least 1. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `created_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Get an export and, once ready, where to fetch it (https://docs.mapier.ai/pod/iam/api/record/get-record-export) > Get an export and, once ready, where to fetch it **GET** `/v1/iam/records/exports/{export_id}` A key with the `permissions:records` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/records/exports/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `export_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The export. ```json title="200" { "id": "example", "state": "running", "format": "ocsf", "from": "2026-11-23T12:00:00.000Z", "to": "2026-11-23T12:00:00.000Z", "sandbox": null, "rows": null, "chain_heads": [ { "sandbox": "example", "seq": 0, "hash": "example" } ], "download_url": null, "expires_at": null, "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example", "problem": null } ``` | Field | Type | Always | What it is | | -------------- | ---------------------------------- | ------ | --------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `state` | `"running" \| "ready" \| "failed"` | Yes | | | `format` | `"ocsf" \| "otlp"` | Yes | `ocsf`: OCSF events as JSON lines. `otlp`: OpenTelemetry log records as OTLP JSON. | | `from` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `to` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `sandbox` | `string \| null` | Yes | | | `rows` | `integer \| null` | Yes | At least 0. | | `chain_heads` | `ChainHead[]` | Yes | | | `download_url` | `string \| null` | Yes | Once `ready`, where to fetch the file, signed and short-lived. | | `expires_at` | `string \| null` | Yes | | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `created_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `problem` | `string \| null` | Yes | Why it failed. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # How long the project's record is kept (https://docs.mapier.ai/pod/iam/api/record/get-record-retention) > Every plan keeps the record 90 days. **GET** `/v1/iam/records/retention` Every plan keeps the record 90 days. A project can keep it longer, set by Pod's account service for what was bought. Queries answer the last 90 days; exports reach as far back as the project keeps, read from Pod's archive past the 90 days. A key with the `permissions:records` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/records/retention?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** How long the record is kept, and how far the archive has got. ```json title="200" { "keep_days": 90, "kept_from": "2026-11-23T12:00:00.000Z", "query_days": 1, "archived_through": null, "archive_state": "none", "archive_error": null } ``` | Field | Type | Always | What it is | | ------------------ | ------------------------------------ | ------ | ---------------------------------------------------------------------------------- | | `keep_days` | `integer` | Yes | How many days the record is kept. 90 on every plan; more is sold. From 90 to 3653. | | `kept_from` | `string` | Yes | The oldest time an export reaches. | | `query_days` | `integer` | Yes | Queries answer this many days; older rows are exported. | | `archived_through` | `string \| null` | Yes | How far Pod's archive has got, for a project that keeps more than 90 days. | | `archive_state` | `"none" \| "archiving" \| "failing"` | Yes | | | `archive_error` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Query the record (https://docs.mapier.ai/pod/iam/api/record/query-record) > Rows of the record, newest first, written by the servers that made each decision. **GET** `/v1/iam/records` Rows of the record, newest first, written by the servers that made each decision. Rows are visible within 10 seconds of the decision and kept 90 days. Query strings are stored with their values removed, and bodies are not recorded. A key with the `permissions:records` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/records?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | ---------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `sandbox` | query | `string` | No | | | `verdict` | query | `"allow" \| "ask" \| "deny"` | No | | | `action` | query | `"read" \| "write" \| "net" \| "use" \| "msg"` | No | | | `policy` | query | `string` | No | | | `from` | query | `string` | No | Rows at or after this time. | | `to` | query | `string` | No | Rows before this time. | | `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 rows, newest first. ```json title="200" { "data": [ { "id": "example", "at": "2026-11-23T12:00:00.000Z", "sandbox": "example", "action": "read", "thing": "example", "verdict": "allow", "log_only": false, "rule": null, "policy": null, "policy_version": null, "ask": null, "approver": null, "claimed_agent": null, "enforcement_point": "egress", "reason": "example", "end_user": null, "destination": { "address": "example", "port": 0, "protocol": "tcp" }, "bytes_out": 0, "bytes_in": 0, "duration_ms": 0, "name_looked_up": "example", "site": "example", "method": "example", "path": "example", "status": 1, "tool": "example", "read": false, "taken_over": false, "folder": "example", "mode": "read", "sender_domain": "example", "receiver_domain": "example", "claimed_site": "example", "claimed_session": "example", "claimed_tool_call": "example", "claimed_reason": "example", "claimed_program": "example", "seq": 0, "prev_hash": "example", "hash": "example" } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `RecordRow[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Deliver the project's record to its own store (https://docs.mapier.ai/pod/iam/api/record/set-record-delivery) > People only, with the admin role and a fresh second factor: it sends customer data out of Pod. **PUT** `/v1/iam/records/delivery` People only, with the admin role and a fresh second factor: it sends customer data out of Pod. Every closed window of the record (an hour, a few hours after it closes) is written to the bucket in the chosen format, with a manifest naming the manifest before it by its SHA-256 and carrying the chain heads, so the customer keeps the heads and can check the chain themselves. The store is written to once before this answers; a store that refuses is `invalid`. The secret is stored encrypted at once and never read back. Changing only the keys, format or lock goes on where delivery is; another bucket or prefix, or `from`, starts a new series. 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/iam/records/delivery?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"store":{"kind":"s3","endpoint":"https://app.example.com","region":"example","bucket":"example","secret_access_key":"example"},"format":"ocsf"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] | Field | Type | Required | What it is | | ----------- | -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `store` | `RecordStoreRequest` | Yes | | | `format` | `"ocsf" \| "otlp"` | Yes | `ocsf`: OCSF events as JSON lines. `otlp`: OpenTelemetry log records as OTLP JSON. | | `lock_days` | `integer` | No | Write every object under S3 Object Lock in compliance mode for this many days. The bucket must have Object Lock switched on. From 1 to 3653. | | `from` | `string` | No | Deliver from this time, as far back as the project keeps. Without it, delivery starts with the current window, or goes on where it is. | ## Answer [#answer] **200.** The delivery, without its secret. ```json title="200" { "store": { "kind": "s3", "endpoint": "https://app.example.com", "region": "example", "bucket": "example", "prefix": "example", "path_style": false, "access_key_id": "example" }, "format": "ocsf", "lock_days": null, "series": "example", "from": "2026-11-23T12:00:00.000Z", "delivered_through": "2026-11-23T12:00:00.000Z", "files": 0, "last_manifest": null, "state": "delivering", "failures": 0, "last_error": null, "next_try_at": null, "window_seconds": 1, "created_at": "2026-11-23T12:00:00.000Z", "created_by": "example", "updated_at": "2026-11-23T12:00:00.000Z", "updated_by": "example" } ``` | Field | Type | Always | What it is | | ------------------- | --------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `store` | `RecordStore` | Yes | A bucket of the customer's, reached over the S3 API: AWS S3, Google Cloud Storage's XML API with HMAC keys, or any store that speaks it. Reached over HTTPS only, and only at public addresses. | | `format` | `"ocsf" \| "otlp"` | Yes | `ocsf`: OCSF events as JSON lines. `otlp`: OpenTelemetry log records as OTLP JSON. | | `lock_days` | `integer \| null` | Yes | | | `series` | `string` | Yes | The folder of the bucket this series of files goes under. | | `from` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `delivered_through` | `string` | Yes | The end of the last window delivered. | | `files` | `integer` | Yes | Manifests delivered in this series. At least 0. | | `last_manifest` | `string \| null` | Yes | | | `state` | `"delivering" \| "failing"` | Yes | | | `failures` | `integer` | Yes | At least 0. | | `last_error` | `string \| null` | Yes | | | `next_try_at` | `string \| null` | Yes | | | `window_seconds` | `integer` | Yes | At least 1. | | `created_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `created_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `updated_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `updated_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`person_required`](https://docs.mapier.ai/pod/api/errors#person_required), [`forbidden`](https://docs.mapier.ai/pod/api/errors#forbidden), [`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. # Stop delivering the project's record to its own store (https://docs.mapier.ai/pod/iam/api/record/stop-record-delivery) > People only, as setting it is. **DELETE** `/v1/iam/records/delivery` People only, as setting it is. What was delivered stays the customer's. 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/iam/records/delivery?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Answer [#answer] **200.** Stopped. ```json title="200" { "stopped": true, "at": "2026-11-23T12:00:00.000Z" } ``` | Field | Type | Always | What it is | | --------- | -------- | ------ | -------------------------------------------------------------------------- | | `stopped` | `true` | Yes | | | `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: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Change a tool's host, traffic, attachment, call style or key (https://docs.mapier.ai/pod/iam/api/tools/change-tool) > People only, with a fresh second factor. **PATCH** `/v1/iam/tools/{tool_id}` People only, with a fresh second factor. A new key replaces the old one, which is destroyed. Every table that grants the tool is published again. A new `host` is taken only with a new `key` in the same call (`invalid` otherwise): the stored key was written once for its host and can never be read back, so it is never re-pointed at another host, where whoever holds that host would receive it. A new `key` keeps the tool's kind unless `kind` is sent with it. `kind` without `key` is `invalid`: an encrypted key is never relabelled as another kind. 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/iam/tools/example?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"host":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `tool_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `Idempotency-Key` | header | `string` | No | Makes a repeat of this call safe for 24 hours. | ## Body [#body] A new `host` needs a new `key` with it: the encrypted key is never sent to a host it was not given for. | Field | Type | Required | What it is | | --------- | -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `host` | `string` | No | | | `traffic` | `string[]` | No | | | `attach` | `string` | No | | | `calls` | `"mcp" \| "json-rpc" \| null` | No | Left out keeps it; null clears it, which is refused while a `call` rule names the tool. | | `key` | `string` | No | The tool's key. Written once, stored encrypted at once under the customer's key in Pod's form, never readable back and never in an answer or an error message. Pod's limit: 1 to 8192 characters of visible ASCII (no space, control character or line break). It must read as its `kind`. | | `kind` | `"header" \| "aws_sigv4" \| "oauth_refresh"` | No | What the new `key` is; only with `key` (`invalid` on `kind` otherwise), since an encrypted key is never relabelled as another kind. Left out with a key, the tool's kind so far. | ## Answer [#answer] **200.** The tool as changed, without its key. ```json title="200" { "id": "example", "name": "example", "host": "example", "traffic": ["example"], "attach": "example", "calls": null, "kind": "header", "connected_at": "2026-11-23T12:00:00.000Z", "connected_by": "example", "used_by": 0, "warnings": ["example"] } ``` | Field | Type | Always | What it is | | -------------- | -------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `host` | `string` | Yes | | | `traffic` | `string[]` | Yes | Methods and path prefixes the key may be attached to, such as `POST /v1/refunds*`. | | `attach` | `string` | Yes | How the key is attached, with `` where it goes, such as `Authorization: Bearer `. | | `calls` | `"mcp" \| "json-rpc" \| null` | No | A `call` rule may name the tool only when this is set. Null or left out: no `call` rule may name it. | | `kind` | `"header" \| "aws_sigv4" \| "oauth_refresh"` | No | What the tool's encrypted key is, read from its encrypted form; never the key. Always sent by this version; a tool connected before kinds existed is `header`. | | `connected_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `connected_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `used_by` | `integer` | Yes | Policies that grant the tool. At least 0. | | `warnings` | `string[]` | No | For example, that the host is known to echo requests back. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Connect a tool (https://docs.mapier.ai/pod/iam/api/tools/connect-tool) > People only, with a fresh second factor. **POST** `/v1/iam/tools` People only, with a fresh second factor. The key is stored encrypted at once under the customer's key and can never be read back. A policy grants the tool with `Allow use ` or `Ask use `, which switches traffic reading on for the sandboxes under it. A host known to echo requests gets a warning in `warnings`. The key must read as its kind (`invalid`, field `key`, otherwise; the message never holds the key), and the kind is bound into the encrypted key. 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/iam/tools?project=example" \ -H "Authorization: Bearer $POD_PERSON_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"example","host":"example","traffic":["example"],"attach":"example","key":"example"}' ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 | Optional; when sent it must be the `project` of the query. | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `host` | `string` | Yes | | | `traffic` | `string[]` | Yes | | | `attach` | `string` | Yes | | | `calls` | `"mcp" \| "json-rpc" \| null` | No | A `call` rule may name the tool only when this is set. Null or left out: no `call` rule may name it. | | `key` | `string` | Yes | The tool's key. Written once, stored encrypted at once under the customer's key in Pod's form, never readable back and never in an answer or an error message. Pod's limit: 1 to 8192 characters of visible ASCII (no space, control character or line break). It must read as its `kind`. | | `kind` | `"header" \| "aws_sigv4" \| "oauth_refresh"` | No | What `key` is. Left out, `header`. | ## Answer [#answer] **201.** The tool, without its key. ```json title="201" { "id": "example", "name": "example", "host": "example", "traffic": ["example"], "attach": "example", "calls": null, "kind": "header", "connected_at": "2026-11-23T12:00:00.000Z", "connected_by": "example", "used_by": 0, "warnings": ["example"] } ``` | Field | Type | Always | What it is | | -------------- | -------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `host` | `string` | Yes | | | `traffic` | `string[]` | Yes | Methods and path prefixes the key may be attached to, such as `POST /v1/refunds*`. | | `attach` | `string` | Yes | How the key is attached, with `` where it goes, such as `Authorization: Bearer `. | | `calls` | `"mcp" \| "json-rpc" \| null` | No | A `call` rule may name the tool only when this is set. Null or left out: no `call` rule may name it. | | `kind` | `"header" \| "aws_sigv4" \| "oauth_refresh"` | No | What the tool's encrypted key is, read from its encrypted form; never the key. Always sent by this version; a tool connected before kinds existed is `header`. | | `connected_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `connected_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `used_by` | `integer` | Yes | Policies that grant the tool. At least 0. | | `warnings` | `string[]` | No | For example, that the host is known to echo requests back. | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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). 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. # Get a connected tool (https://docs.mapier.ai/pod/iam/api/tools/get-tool) > Get a connected tool **GET** `/v1/iam/tools/{tool_id}` A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/tools/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `tool_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | ## Answer [#answer] **200.** The tool, without its key. ```json title="200" { "id": "example", "name": "example", "host": "example", "traffic": ["example"], "attach": "example", "calls": null, "kind": "header", "connected_at": "2026-11-23T12:00:00.000Z", "connected_by": "example", "used_by": 0, "warnings": ["example"] } ``` | Field | Type | Always | What it is | | -------------- | -------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | Yes | | | `name` | `string` | Yes | A named policy may not be called `organisation`, `project` or `default`, the layers the service makes itself, or `self`, which a rule's `policy:self` reads as the policy's own domain. | | `host` | `string` | Yes | | | `traffic` | `string[]` | Yes | Methods and path prefixes the key may be attached to, such as `POST /v1/refunds*`. | | `attach` | `string` | Yes | How the key is attached, with `` where it goes, such as `Authorization: Bearer `. | | `calls` | `"mcp" \| "json-rpc" \| null` | No | A `call` rule may name the tool only when this is set. Null or left out: no `call` rule may name it. | | `kind` | `"header" \| "aws_sigv4" \| "oauth_refresh"` | No | What the tool's encrypted key is, read from its encrypted form; never the key. Always sent by this version; a tool connected before kinds existed is `header`. | | `connected_at` | `string` | Yes | RFC 3339 in UTC with milliseconds, for example `2026-11-23T17:04:05.123Z`. | | `connected_by` | `string` | Yes | Who made a change. An identity account id for a person, or a key id (`key_…`) for an API key. | | `used_by` | `integer` | Yes | Policies that grant the tool. At least 0. | | `warnings` | `string[]` | No | For example, that the host is known to echo requests back. | ## Errors [#errors] The refusals this call is known for: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # List the project's connected tools (https://docs.mapier.ai/pod/iam/api/tools/list-tools) > Never with a key. **GET** `/v1/iam/tools` Never with a key. A tool's key is never read back through any route. A key with the `permissions:read` scope. ## Request [#request] ```bash curl "https://api.pod.mapier.ai/v1/iam/tools?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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 tools. ```json title="200" { "data": [ { "id": "example", "name": "example", "host": "example", "traffic": ["example"], "attach": "example", "calls": null, "kind": "header", "connected_at": "2026-11-23T12:00:00.000Z", "connected_by": "example", "used_by": 0, "warnings": ["example"] } ], "next_cursor": null } ``` | Field | Type | Always | What it is | | ------------- | ---------------- | ------ | ---------- | | `data` | `Tool[]` | Yes | | | `next_cursor` | `string \| null` | Yes | | ## Errors [#errors] The refusals this call is known for: [`invalid`](https://docs.mapier.ai/pod/api/errors#invalid), [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Revoke a tool (https://docs.mapier.ai/pod/iam/api/tools/revoke-tool) > Only narrows, so a project key with `permissions:write` may. **DELETE** `/v1/iam/tools/{tool_id}` Only narrows, so a project key with `permissions:write` may. Destroys the encrypted key, tells every server to drop it, and publishes again every table that granted the tool (Pod aims for 1 second). A key with the `permissions:write` scope. ## Request [#request] ```bash curl -X DELETE "https://api.pod.mapier.ai/v1/iam/tools/example?project=example" \ -H "Authorization: Bearer $POD_API_KEY" ``` ## Parameters [#parameters] | Name | In | Type | Required | What it is | | ------------------ | ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `tool_id` | path | `string` | Yes | | | `project` | query | `string` | Yes | The project the call is about. Every route is scoped to one. | | `Pod-Organisation` | header | `string` | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is `forbidden`. | | `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: [`unauthorized`](https://docs.mapier.ai/pod/api/errors#unauthorized), [`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. # Approvals (https://docs.mapier.ai/pod/iam/guides/approvals) > Ask rules stop a request for a person to answer, with a fresh second factor each time **Not available yet.** Ask rules decide Deny until approvals are switched on with enforcement. An Ask rule puts a person in front of an action that matters: a payment, a write to production, a host you have not seen before. ```text Ask use payment-keys Ask net api.github.com DELETE /repos/* ``` ## What happens [#what-happens] 1. **The request is refused at once.** Pod never holds the connection open. A web request gets a `403` whose body names the rule, a reference that starts `ask_`, and when to retry. The agent can carry on with other work. 2. **The request is stored.** The Ask outlives the connection and the sandbox's sleep. An Ask nobody answers ends as Deny after 24 hours. 3. **An approver sees it.** Approvers see the Ask under **Permissions**, then **Approvals**. 4. **A person answers.** The approver reads the decoded request and answers with a fresh second factor. 5. **The retry goes through.** The answer takes effect on the sandbox with no restart, and the agent's retry is decided again: let through if allowed, recorded with the approver's name. ## What the approver sees [#what-the-approver-sees] A host name alone is never the whole question. The approver sees the method, the full address with its path, the size and type of what is sent, which tool's key would be attached, which sandbox asks and whom it works for, the rule that asked, and exactly what each answer would allow. Anything the agent says about why it wants this is shown apart, marked as the agent's claim. When many sandboxes under one policy ask the same question, it is shown once, with the sandboxes listed. An answer covers the sandboxes listed and never sandboxes made later. ## Answers [#answers] | Answer | Covers | How long | | -------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | **Allow once** | This sandbox and this exact request | One use, within 10 minutes | | **Allow for a time** | This sandbox, and the rule and thing as shown | 1 hour unless the approver picks another time, up to the policy's cap (24 hours unless the policy sets less) | | **Deny** | The same as Allow for a time | The same time, so retries do not ask again | There is no "always". A lasting change is a change to the policy, with what it newly allows shown first and a second factor of its own. A fork inherits no answers: each one names a single sandbox. ## Who may answer [#who-may-answer] | Who | May answer? | | ------------------------------------------------------------------------------------ | ----------- | | A person named as an approver for the project, signed in, with a fresh second factor | Yes | | The same person without a fresh second factor, or in a session an agent is driving | No | | Any API key, or any automated system | No | | Anything inside a sandbox | Never | | A webhook | No | | Mapier staff | Never | A fresh second factor means an authenticator app or a passkey, confirmed after the Ask was opened, good for this one answer. A phone code is never accepted. Set the approvers under **Permissions**, then **Approvals**, then **Who may answer**, or with [`setApprovers`](https://docs.mapier.ai/pod/iam/api/asks/set-approvers). A project has at most 100 approvers. Changing the list takes the admin role and a fresh second factor. ## Limits that keep Asks rare [#limits-that-keep-asks-rare] People approve almost everything when they are asked too often, so Pod limits how many Asks reach them. When a limit is reached, further Ask rules decide Deny, with the reason `limit`. | Limit | Default | | ----------------------------------- | ------------------------------------------- | | Open Asks for one sandbox | 3 | | New Asks for one sandbox in an hour | 10 | | Open Asks for one project | 50, with one notice to the project's admins | | Asks shown to one approver at once | 10; the rest wait, oldest first | | Answers by one approver in an hour | 30; new Asks go to another approver or wait | If one rule asks often, change the policy instead: allow what is always fine, deny what never is, and keep Ask for the rest. ## From code and the command line [#from-code-and-the-command-line] Read Asks with [`listAsks`](https://docs.mapier.ai/pod/iam/api/asks/list-asks) and [`getAsk`](https://docs.mapier.ai/pod/iam/api/asks/get-ask), with an API key that has `permissions:read`. Answers come only from an approver: in the dashboard, or with [`answerAsk`](https://docs.mapier.ai/pod/iam/api/asks/answer-ask), which no API key can call. `mpod iam asks` reads the same requests from your terminal, and an approver signed in with `mpod login` answers one with `answer`, confirming a fresh second factor for each answer: ```sh mpod iam asks list --project prj_… --kind spend mpod iam asks get --project prj_… ask_… mpod iam asks answer --project prj_… ask_… @answer.json ``` `list` shows waiting requests by default; `--state answered` shows answered and expired ones. `answer` sends the body [`answerAsk`](https://docs.mapier.ai/pod/iam/api/asks/answer-ask) takes, as JSON, from a file with `@FILE`, or from standard input with `-`. # Concepts (https://docs.mapier.ai/pod/iam/guides/concepts) > Policies, verdicts, actions, layers, bindings, and what a sandbox reaches with and without a policy ## Policies and rules [#policies-and-rules] A **policy** is a list of rules. A **rule** is a verdict, an action and a thing: ```text Allow net api.github.com ``` You write a policy in the simple form above, or in JSON through the API. Both forms hold the same rules and refuse the same mistakes. An unknown word is an error, never a guess, and every error names its line. [Policy syntax](https://docs.mapier.ai/pod/iam/reference/policy-syntax) has every form. A stored policy has a name, such as `build`, and a version number that goes up with every change. A policy holds at most 1,000 rules. ## Verdicts [#verdicts] | Verdict | What happens | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Allow** | The action goes through and is recorded. | | **Deny** | The action is refused at once and recorded. The program gets a clear refusal, never a connection that hangs. | | **Ask** | The action is refused at once, and a request goes to a person you named. Once they allow it, the agent's retry goes through. See [Approvals](https://docs.mapier.ai/pod/iam/guides/approvals). | ## Actions [#actions] | Action | What it covers | | --------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `read`, `write` | A folder of Pod's shared drive, granted by name. `write` includes `read`. | | `net` | A host name, an address or range, or `everything else`, with an optional port. Where traffic is read, also methods and paths. | | `use` | A [connected tool](https://docs.mapier.ai/pod/iam/guides/connected-tools): its key and the traffic the key may be attached to. | | `msg` | Messages between the sandboxes of a swarm, to or from another policy. | | `call` | One tool call through a connected tool, such as an MCP `tools/call`, with tests on its arguments. | **Not available yet.** Rules on message topics and on tool calls are checked and compiled, and decide Deny until the sandboxes read them. [Actions](https://docs.mapier.ai/pod/iam/reference/actions) lists what each action takes. ## Which rule wins [#which-rule-wins] - **Inside one policy,** the most specific thing wins: an exact name over a wildcard, a wildcard over `everything else`, a longer path over a shorter one. At equal weight, Deny beats Ask and Ask beats Allow. The order of lines does not matter. - **Across layers,** every layer must allow an action, and the strictest verdict wins. - **A policy that says nothing about an action allows nothing for it.** No folder, no tool and no host. A policy that wants the open internet says `Allow net everything else` in so many words. ## Layers and the ceiling [#layers-and-the-ceiling] Rules come from several layers. Each one can only narrow the layers above it. | Layer | Who sets it | | ------------------------------------------------------------------------- | -------------------------------------------- | | Organization | A person with the admin role | | Project, its named policies, and its default for sandboxes with no policy | A person with the admin role | | A preset, such as `coding` or `model-apis` | Mapier writes it; your policy pins a version | | A draft | Proposed by Pod, accepted by a person | | A spec file | Whoever commits the file | | One sandbox | A create call, a mount, or the dashboard | The organization's and the project's policies are the **ceiling**. People with a fresh second factor change the ceiling. API keys work beneath it: a key can pick a policy for a sandbox and add rules for that one sandbox, and anything above the ceiling is cut, with the cut rules listed in the sandbox's binding. A key issued inside a sandbox can never widen its own access. A sandbox it creates gets its parent's policy or a narrower one. ## Bindings [#bindings] A **binding** says which policy a sandbox runs under, plus any rules for that sandbox alone. You bind a policy when you create the sandbox, by naming it in the create call ([`createSandbox`](https://docs.mapier.ai/pod/api/sandboxes/create-sandbox), fields `policy` and `rules`); Pod's front door then binds it through [`bindSandbox`](https://docs.mapier.ai/pod/iam/api/bindings/bind-sandbox). Sandboxes that share one compiled policy can message each other and share folders, within what that policy grants. Sandboxes under different policies are fenced from each other unless both policies allow it. ## With and without a policy [#with-and-without-a-policy] | The sandbox has | It reaches | | ----------------------------- | ----------------------------------------- | | No policy | The public internet. | | A policy, or rules of its own | Only what the policy and its rules grant. | Either way, Pod's fixed baseline always blocks cloud metadata addresses, link-local and private networks, loopback, the servers' own networks and outbound mail. No policy can open them, and log-only mode does not lift them. Mounting a folder or connecting a tool on a sandbox with no policy does not close its network. Only attaching a policy does. An Enterprise project can switch its default for sandboxes with no policy to deny. ## When traffic is read [#when-traffic-is-read] A rule that names a site, such as `Allow net api.github.com GET /repos/*`, needs Pod to read the sandbox's encrypted web traffic, check the request, and send it on. So does a connected tool, since Pod attaches its key. Pod switches reading on for a sandbox only when its policy has such a rule, and the dashboard shows it on the sandbox's page with the rules that caused it. When reading is on, Pod places a certificate of that sandbox's own in its trust store. A program that trusts only its own certificate list may need pointing at the system's, and a program started before the certificate was placed may need a restart. Without reading, a rule can name addresses, ranges and ports, but not methods or paths, and no key can be attached. A name rule on a protocol Pod does not read, such as SSH or a database, is enforced by address and port only, and the dashboard marks it as the weaker kind. ## End users [#end-users] If you give sandboxes to your own users through Pod, each end user is a trust domain of their own. A process of Pod's that reads one end user's traffic never serves another's, and the record names the end user each sandbox works for. **Not available yet.** Policies are stored, checked and compiled, but sandboxes do not enforce them until Pod's per-sandbox firewall ships. # Connected tools (https://docs.mapier.ai/pod/iam/guides/connected-tools) > Give agents a service's key without putting the key in the sandbox **Not available yet.** Tools can be connected, but keys are attached to a sandbox's traffic only once enforcement ships. A connected tool is a service's key together with the traffic that key may be attached to. Pod keeps the key outside every sandbox. A sandbox whose policy grants the tool holds only a placeholder, and Pod puts the real key on the request on its way out. The agent never sees the key, so it cannot leak it, paste it elsewhere or use it on traffic the tool does not allow. ## Connect a tool [#connect-a-tool] In the Pod dashboard, open **Permissions**, then **Connected tools**. A tool has: ```text title="A tool" tool payment-keys host payments.example.com traffic POST /v1/refunds* GET /v1/charges/* attach Authorization: Bearer ``` | Field | What it says | | --------- | ---------------------------------------------------------------------------------------------------------------- | | Name | How a policy refers to the tool, such as `payment-keys`. | | `host` | The one host the key is sent to. | | `traffic` | Methods, each followed by the path prefixes they apply to. Up to 100 entries. A tool with no traffic is refused. | | `attach` | Where the key goes, with `` in its place, usually a header. | | Key | The secret itself, written once and stored encrypted under your organization's key. No call ever reads it back. | Connecting a tool is an action for a person with the admin role and a fresh second factor. No API key can connect one or change its key. [`connectTool`](https://docs.mapier.ai/pod/iam/api/tools/connect-tool) is the call behind the dashboard. Changing a tool's host needs a new key with it: a key is never sent to a host it was not given for. ## Grant it [#grant-it] A policy grants a tool with `use`: ```text Allow use payment-keys ``` or asks a person first: ```text Ask use payment-keys ``` Granting a tool switches traffic reading on for the sandboxes under that policy, since Pod has to read a request to attach a key to it. Connecting once serves every sandbox the rule names. ## What the sandbox sees [#what-the-sandbox-sees] When a sandbox under the policy starts, Pod gives it a random placeholder for the tool, tied to that sandbox. Point the program at the placeholder the way it expects a key, for example in an environment variable. When a request through Pod carries the placeholder, Pod checks three things before it swaps in the real key: 1. The placeholder belongs to the sandbox the request came from. 2. The request matches the tool's host, method and path. 3. The policy's verdict is Allow, or a person allowed it. A request that carries a placeholder and fails a check is refused and recorded. It is never sent on without the key. Where Pod sees the real key in a response, it removes it. A fork or a copy made from a snapshot never reuses its parent's placeholder. If the copy is granted the tool, it gets a new one. ## Revoke it [#revoke-it] Revoking a tool destroys its stored key, tells every server to drop it, and publishes again every policy that granted it, so no sandbox can use it. An API key with `permissions:write` can revoke a tool ([`revokeTool`](https://docs.mapier.ai/pod/iam/api/tools/revoke-tool)), since revoking only narrows. ## Key kinds [#key-kinds] | Kind | What the key is | | --------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `header` | Goes into the `attach` line as it is. The default. | | `aws_sigv4` | An access key pair Pod uses to sign each request again, written `:`. | | `oauth_refresh` | A sign-in that renews: a token address and a refresh token, written as form fields. Pod renews the access token and attaches it. | **Not available yet.** Keys of the `aws_sigv4` and `oauth_refresh` kinds are stored, and are attached once Pod's servers take those kinds. ## Rules on tool calls [#rules-on-tool-calls] A tool that speaks MCP or JSON-RPC can carry rules on each call, with tests on its arguments: ```text Allow call payment-keys refunds.create where amount <= 5000 and currency in usd,eur ``` The tool must say how its requests carry calls, with a `calls mcp` or `calls json-rpc` line. [Tool rules](https://docs.mapier.ai/pod/iam/reference/tool-rules) has the full form. **Not available yet.** Rules on message topics and on tool calls are checked and compiled, and decide Deny until the sandboxes read them. ## Keys you type into a sandbox [#keys-you-type-into-a-sandbox] A key a person or an agent types into a sandbox is not a connected tool. It lands on the sandbox's disk, where every process can read it, and may show in a screen recording. Connect a tool instead. # Controls (https://docs.mapier.ai/pod/iam/guides/controls) > The cut-off switch, connection tests, log-only mode, presets and drafts Beside the rules, five controls help you write a policy, check it, and stop a sandbox fast. ## The cut-off switch [#the-cut-off-switch] Pulling the cut-off switch is published at once to one sandbox, every sandbox under one policy, or a whole project, and refuses all their network traffic once sandboxes enforce policies. The sandboxes keep running; they reach nothing until the cut-off is lifted. **Not available yet.** Policies are stored, checked and compiled, but sandboxes do not enforce them until Pod's per-sandbox firewall ships. Pulling it only narrows, so any member whose role may write permissions, or an API key with `permissions:write`, can pull it ([`pullCutOff`](https://docs.mapier.ai/pod/iam/api/cut-offs/pull-cut-off)). Lifting it takes a person with the admin role and a fresh second factor ([`liftCutOff`](https://docs.mapier.ai/pod/iam/api/cut-offs/lift-cut-off)). ```sh curl -X POST "https://api.pod.mapier.ai/v1/iam/cut-offs?project=$POD_PROJECT" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{"target": "sandbox", "target_id": "sbx_…"}' ``` `target` is `sandbox`, `policy` or `project`. ## Connection tests [#connection-tests] A connection test says what a sandbox's policy would decide for a request, without sending it: the verdict, the rule that decided, why, whether the request would be read, and whether the baseline, a cut-off, log-only mode or an answered Ask decided. Test against a running sandbox, with its answered Asks, or against a policy alone ([`testConnection`](https://docs.mapier.ai/pod/iam/api/connection-test/test-connection)). Use it before you attach a policy, and when an agent reports a refusal you do not expect. ## Log-only mode [#log-only-mode] Log-only mode is for a first run. It lets a `net` request that would be denied or asked through, and records what would have happened. You run the agent on its task, read the record, and write the policy from what it reached. **Not available yet.** Policies are stored, checked and compiled, but sandboxes do not enforce them until Pod's per-sandbox firewall ships. It never mounts a folder, never attaches a key, and never lifts the fixed baseline. Switching it on takes a person with the admin role and a fresh second factor, and an end time, at least 1 hour and at most 7 days away ([`setLogOnly`](https://docs.mapier.ai/pod/iam/api/policies/set-log-only)). Switching it off early takes the same. No API key and no spec file can do either. ## Presets [#presets] Mapier writes presets for common work, and keeps them versioned: | Preset | What it allows | | ------------ | --------------------------------------------------------- | | `coding` | The common code hosts and package registries, over HTTPS | | `model-apis` | The public APIs of the common model providers, over HTTPS | A policy pins a preset at a version, as a layer above its own rules. A published version never changes. When Mapier publishes a newer one that allows more, your policy stays on its version until a person reads what the newer one newly allows and accepts it. List presets and every version's rules with [`listPresets`](https://docs.mapier.ai/pod/iam/api/presets/list-presets) and [`getPreset`](https://docs.mapier.ai/pod/iam/api/presets/get-preset). ## Drafts [#drafts] Pod can draft a policy for you. A draft is a layer under one of your policies: it can only narrow that policy, never widen it, and it takes effect only when a person accepts it. | Draft from | How | | -------------- | ---------------------------------------------------------------------------------------------------------------------- | | Watching a run | A sandbox runs its task in log-only mode, and Pod recommends a policy from the connections, folders and tools it used. | | A refusal | Pod proposes one narrow rule for the thing just refused, with what it would newly allow. | | The task | A model reads the task and proposes rules, before the run. | **Not available yet.** Drafts from watching a run or from a refusal arrive with enforcement; drafts written from a task arrive later. A run under attack teaches the wrong lesson, so a learned rule is never applied alone: every draft shows what it would allow, and a person reviews it. Ask for a draft with [`createDraft`](https://docs.mapier.ai/pod/iam/api/drafts/create-draft); accepting one is a person's action with a fresh second factor ([`acceptDraft`](https://docs.mapier.ai/pod/iam/api/drafts/accept-draft)). Model calls for drafts from a task are billed to you as usage. # What each plan includes (https://docs.mapier.ai/pod/iam/guides/plans) > The permissions every Pod sandbox gets, and the ones sold on top **Not available yet.** Policies are stored, checked and compiled, but sandboxes do not enforce them until Pod's per-sandbox firewall ships. Every Pod sandbox, on every plan, gets the protections in the first column once enforcement ships. The second column is sold on top. Prices for it are not published; [contact Mapier](https://mapier.ai/pod/iam) to add it to your plan. | On every plan | Sold on top | | ------------------------------------------------------- | ----------------------------------------------------------- | | The fixed network baseline | Ask, with approvals routed to the people you name | | A firewall per sandbox, with Allow and Deny rules | Policies drafted from the task | | Presets | The record kept longer than 90 days, exported and delivered | | Connected tools, with keys attached outside the sandbox | Policy by group from your identity provider | | The record, kept 90 days | Walls between client matters | | The cut-off switch | Deny by default for a whole project | The firewall rules, the keys attached outside the sandbox, the record and the cut-off switch take effect once enforcement ships. Ask, drafting from the task, longer records and exports, policy by group and walls between client matters each arrive as their own pages say: [approvals](https://docs.mapier.ai/pod/iam/guides/approvals), [controls](https://docs.mapier.ai/pod/iam/guides/controls), [the record](https://docs.mapier.ai/pod/iam/guides/the-record) and [teams](https://docs.mapier.ai/pod/iam/guides/teams). The fixed baseline holds for every sandbox, with or without a policy: cloud metadata addresses, link-local and private networks, loopback, the servers' own networks and outbound mail are always blocked. # Quickstart (https://docs.mapier.ai/pod/iam/guides/quickstart) > Write a policy, check what it allows, test a request, and run a sandbox under it **Not available yet.** Policies are stored, checked and compiled, but sandboxes do not enforce them until Pod's per-sandbox firewall ships. You need a Pod project, the admin role in it with a second factor set up (an authenticator app or a passkey), and an API key with the `permissions:read` and `permissions:write` scopes for the calls in steps 3 and 4. ### Write the policy [#write-the-policy] In the Pod dashboard, open **Permissions**, then **Policies**, and choose **New policy**. Name it `build` and paste these rules: ```text title="build" Allow net github.com Allow net api.github.com GET POST /repos/acme/app/* Allow net registry.npmjs.org GET Deny net everything else ``` Saving a policy is a change to what agents may reach, so the dashboard asks for your second factor first. API keys cannot save policies. ### Read what it allows [#read-what-it-allows] Before it saves, the dashboard runs the check and shows, in plain words, what the policy newly allows, any rule that can never match, and any address the fixed baseline blocks anyway. It also shows whether the policy switches traffic reading on: these rules name sites and paths, so it does. You can run the same check from code with [`checkPolicy`](https://docs.mapier.ai/pod/iam/api/policies/check-policy). It saves nothing. ### Test a request [#test-a-request] Ask what the policy would decide for a request, without sending it, with [`testConnection`](https://docs.mapier.ai/pod/iam/api/connection-test/test-connection): ```sh curl -X POST "https://api.pod.mapier.ai/v1/iam/connection-tests?project=$POD_PROJECT" \ -H "Authorization: Bearer $POD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"policy": "'"$POLICY_ID"'", "request": {"action": "net", "thing": "api.github.com", "port": 443, "method": "DELETE", "path": "/repos/acme/app"}}' ``` The answer names the verdict, the rule that decided and why. Here it is Deny: the policy allows only `GET` and `POST` on that path. ### Run a sandbox under it [#run-a-sandbox-under-it] Name the policy in the body of [`createSandbox`](https://docs.mapier.ai/pod/api/sandboxes/create-sandbox), beside its other fields. Pod binds it before the sandbox runs anything. To add rules for this one sandbox, send them in `rules`, in the simple form, one a line: ```json title="Part of a create call" { "policy": "pol_…", "rules": "Allow net pypi.org GET" } ``` Rules above the project's ceiling are cut, and the sandbox's binding lists what was cut. Pod's front door binds the policy for you while it creates the sandbox, through [`bindSandbox`](https://docs.mapier.ai/pod/iam/api/bindings/bind-sandbox); a call to it you send yourself is refused. To tighten a sandbox that already runs, use [`narrowSandbox`](https://docs.mapier.ai/pod/iam/api/bindings/narrow-sandbox). ### Read the record [#read-the-record] Every connection the sandbox makes, or is refused, is a row on the record, naming the rule that decided. Open the sandbox in **Permissions**, then **Record**, or call [`queryRecord`](https://docs.mapier.ai/pod/iam/api/record/query-record). **Not available yet.** The record fills once enforcement ships; exports and delivery to your own bucket follow it. ## Next [#next] - Give the sandbox a service's key without putting it inside: [Connected tools](https://docs.mapier.ai/pod/iam/guides/connected-tools). - Stop risky requests for a person to answer: [Approvals](https://docs.mapier.ai/pod/iam/guides/approvals). - Start from Mapier's presets for coding and model APIs: [Controls](https://docs.mapier.ai/pod/iam/guides/controls). # Spend requests (https://docs.mapier.ai/pod/iam/guides/spend-requests) > An agent can ask to spend; a person answers, and one Allow pays once **Not available yet.** Spend requests arrive with Pod's spend caps. An agent can ask to spend money, for example to buy a service it needs for its task. It never pays by itself. Its request becomes an Ask of kind `spend`, in the same list as every other Ask, answered by the same approvers in the same way. ## What the approver sees [#what-the-approver-sees] The amount, the currency, the payee, and the sandbox or sandboxes that asked. The approver answers with a fresh second factor, as for any [Ask](https://docs.mapier.ai/pod/iam/guides/approvals). | Answer | What it does | | -------------- | -------------------------------------------------------------------------------- | | **Allow once** | Allows one payment, for the amount, currency and payee shown, within 10 minutes. | | **Deny** | Refuses it. | There is no Allow for a time on a spend request. ## One approval, one payment [#one-approval-one-payment] An Allow covers one payment in total, even when the request was grouped from many sandboxes. The first payment that matches what the approver was shown uses it. Any other payment is refused and pays nothing, and every further payment needs its own approval. A retry of the same payment within the 10 minutes gets the same answer, so it never pays twice. ## Spend caps still apply [#spend-caps-still-apply] Your account's spend cap is checked before a request is stored and again at payment. A request beyond the cap is refused with [`spend_cap_reached`](https://docs.mapier.ai/pod/api/errors#spend_cap_reached) and never reaches an approver. An Allow never lifts a cap: raising one is a change to your account, made by a person. ## One trail [#one-trail] Each spend request, its answer, the approver and the time are kept with every other Ask, so you read who allowed a payment beside who allowed access, in one place. An unanswered spend request ends as Deny after 24 hours, like any Ask. List spend requests with `mpod iam asks list --project prj_… --kind spend`, or [`listAsks`](https://docs.mapier.ai/pod/iam/api/asks/list-asks). # Teams and companies (https://docs.mapier.ai/pod/iam/guides/teams) > Policy by group from your identity provider, walls between client matters, and a decision API for other systems These features tie Pod Agent IAM to how your company already decides who may do what. ## Policy by group [#policy-by-group] Your company's identity provider decides who is in which group. A project binds a group to one of its named policies, and every sandbox a person in that group makes takes that policy's rules, cut to the ceiling like any sandbox's own rules. **Not available yet.** Policy by group needs single sign-on through your company's identity provider. **Taking a person out of a group takes the rules out of every sandbox of theirs in the same call.** Each of their sandboxes gets a newer, narrower version of its policy at once. An organization takes its groups from one source: | Source | How it works | | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | SCIM 2.0 | Your identity provider pushes people and groups to Pod. A change takes effect in the call that makes it. | | Sign-in tokens (OpenID Connect) | The groups claim of each sign-in sets the person's groups. A membership lapses after 12 hours by default unless a newer sign-in says it again. | A Mapier account is linked to a person in your directory only by a sign-in through your company's single sign-on, never by email address. Setting up the directory, and binding or unbinding a group, takes the admin role and a fresh second factor ([`setDirectory`](https://docs.mapier.ai/pod/iam/api/groups/set-directory), [`bindGroupPolicy`](https://docs.mapier.ai/pod/iam/api/groups/bind-group-policy)). A sandbox made with an API key acts for nobody, so no group's rules apply to it. ## Walls between client matters [#walls-between-client-matters] For firms that keep client matters apart, such as law firms: a project takes the matters from your document system, each with an inclusive wall (only the people and groups listed) or an exclusive one (everyone but those screened), and what belongs to it: folders, hosts, address ranges, connected tools and message topics. **Not available yet.** Walls between client matters need single sign-on through your company's identity provider. - **A sandbox is opened for one matter,** for a person cleared for it. A child sandbox stays on its parent's matter. - **Every policy keeps the walls.** Pod compiles each sandbox's policy for its matter, cuts whatever would reach another matter's things, and refuses the policy if any request to a walled thing would get through. - **It fails closed.** The moment the person is no longer cleared, or the matter is gone, the sandbox's policy allows nothing. - **A log per matter,** chained by hash: the walls set and changed, each sandbox opened or refused, and each closed ([`getMatterLog`](https://docs.mapier.ai/pod/iam/api/matters/get-matter-log)). The walls keep matters apart inside Pod. What a policy allows on the open internet is the policy's to decide. ## A decision API for other systems [#a-decision-api-for-other-systems] Your own systems can ask Pod Agent IAM what a sandbox's policy decides for a request, in the OpenID AuthZEN shape ([`evaluateAccess`](https://docs.mapier.ai/pod/iam/api/decision-api/evaluate-access), and [`evaluateAccesses`](https://docs.mapier.ai/pod/iam/api/decision-api/evaluate-accesses) for many at once). **Not available yet.** The decision API for other systems is not open through Pod's API address. # The record (https://docs.mapier.ai/pod/iam/guides/the-record) > Every connection a sandbox makes or is refused, written by Pod, chained by hash, and exportable The record has one row for every decision about a sandbox: each connection it makes or is refused, each folder mount, each message between policies. Pod's software on the server writes it, at the point where it made the decision. The agent does not report it and cannot change it. **Not available yet.** The record fills once enforcement ships; exports and delivery to your own bucket follow it. ## What a row holds [#what-a-row-holds] | Field | From | | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | | Time, sandbox, project, organization, and the person or end user the sandbox works for | Pod | | Action, verdict and reason; the policy, its version and the rule that decided; the answered Ask and approver, if any | Pod | | Destination address, port and protocol, bytes each way, duration, and the name the sandbox looked up | Pod | | Site name, method, path and status, and the tool whose key was attached (never the key) | Pod, where traffic was read | | Whether the request was read, and whether a person had taken over the sandbox at the time | Pod | | The site name in an unread encrypted connection, and what the agent says about itself: its name, session, tool call, reason and program | The sandbox, marked as a claim | Fields that come from inside the sandbox start `claimed_`. They are kept for you to read, and nothing Pod decides uses them. Request and message contents are never stored unless you switch that on for a project. Query strings are stored with their values removed. ## Tamper-evident [#tamper-evident] Rows are chained by hash, sandbox by sandbox: each row holds the hash of the one before. Pod keeps the latest hash of each chain, its head, apart from the rows, so a missing or changed row shows. Mapier runs both stores, so keep the heads yourself to check the record against Mapier too: every export carries them. ## How long it is kept [#how-long-it-is-kept] 90 days, on every plan. A project can keep its record longer, up to 10 years; see [Plans](https://docs.mapier.ai/pod/iam/guides/plans). Read the project's setting with [`getRecordRetention`](https://docs.mapier.ai/pod/iam/api/record/get-record-retention). When an organization is deleted, its rows are made unreadable at once, inside the 90 days, by destroying the key they are stored under. Exports you already took stay yours. ## Read and export it [#read-and-export-it] Query rows in the dashboard under **Permissions**, then **Record**, or with [`queryRecord`](https://docs.mapier.ai/pod/iam/api/record/query-record) and an API key with `permissions:records`. Export a time range, for the project or one sandbox, with [`exportRecord`](https://docs.mapier.ai/pod/iam/api/record/export-record), in one of two formats: | Format | What you get | | ------ | --------------------------------------- | | `ocsf` | OCSF security events, as JSON lines | | `otlp` | OpenTelemetry log records, as OTLP JSON | The export carries the chain heads of every sandbox in it. Once it is ready, [`getRecordExport`](https://docs.mapier.ai/pod/iam/api/record/get-record-export) gives a short-lived address to fetch it from. ## Delivered to your own bucket [#delivered-to-your-own-bucket] A project that keeps its record longer can have it delivered to a storage bucket you own, over the S3 API. Each window arrives as a file with a numbered manifest that names the one before it by its SHA-256 and carries the chain heads, so you can check a delivered series from the files alone, with nothing of Pod's. Setting up delivery is a person's action, with the admin role and a fresh second factor ([`setRecordDelivery`](https://docs.mapier.ai/pod/iam/api/record/set-record-delivery)). ## When a sandbox cannot be recorded [#when-a-sandbox-cannot-be-recorded] Each server keeps the record on its own disk until it is shipped, and each sandbox has its own share of that space. If a sandbox's share fills, its new connections are refused, so "every connection is on the record" stays true for it. A project can choose instead to keep running, with rows summed per destination per minute and a row that marks the gap. Other customers on the server are never affected. ## Staff access [#staff-access] No one at Mapier reads your record or your policies without a hardware key and a second team member's approval. Every such read is written to your organization's audit log, where you see it. # Overview (https://docs.mapier.ai/pod/iam) > Permissions for AI agents in Pod sandboxes, enforced by the system, not by the prompt **Not available yet.** Pod Agent IAM opens with Pod, to invited organizations first. **Not available yet.** Policies are stored, checked and compiled, but sandboxes do not enforce them until Pod's per-sandbox firewall ships. Pod Agent IAM decides what an agent in a Pod sandbox may reach: which folders, which network hosts and which connected tools. You write the rules once, as a policy, and Pod checks them on the server that runs the sandbox, outside it. Nothing inside the sandbox, a prompt included, can read or change them. ```text title="A policy" Allow read repo/checkout Allow net api.github.com GET POST /repos/acme/app/* Ask use payment-keys Deny net everything else ``` Each line is a verdict, an action and a thing. **Allow** lets it through, **Deny** refuses it, and **Ask** refuses it at once and asks a person you named, who answers with a fresh second factor. Every connection a sandbox makes, or is refused, goes on a record that Pod writes, not the agent. ## What you get [#what-you-get] - **Rules outside the sandbox.** Pod's software on the server checks every connection, folder mount and tool key. The agent cannot turn the rules off, however it is prompted. - **Keys the agent never sees.** A connected tool's key stays with Pod. The sandbox holds a placeholder, and Pod swaps in the real key on the way out, only for the traffic the tool allows. - **A person for the risky steps.** An Ask rule stops the request and waits for an approver. No API key and no automated system can answer one. - **A record you can check.** Rows are chained by hash, sandbox by sandbox, so a missing or changed row shows. You can export it with its chain heads. ## Open until you attach a policy [#open-until-you-attach-a-policy] A sandbox with no policy reaches the public internet. Internal addresses, private networks and outbound mail are always blocked, for every sandbox, by Pod's fixed baseline. Pod stores and checks policies now and does not yet enforce them: until it does, a sandbox with a policy also reaches the public internet. Once enforcement ships, a sandbox with a policy reaches only what the policy grants. [Concepts](https://docs.mapier.ai/pod/iam/guides/concepts) has the details. ## Where to start [#where-to-start] Verdicts, actions, layers and which rule wins. Write a policy, test it, and run a sandbox under it. Every form of a rule, in the simple form and in JSON. Policies, tools, bindings, approvals, the record and drafts. ## Guides [#guides] Give agents a service's key without putting it in the sandbox. Ask rules, approvers and what each answer covers. What each row holds, how long it is kept, and exports. The cut-off switch, connection tests, log-only mode, presets and drafts. Pod Agent IAM works on every Pod sandbox, through the same API key and the same API address as the rest of Pod. In the Pod dashboard, its pages are under **Permissions**. # Actions (https://docs.mapier.ai/pod/iam/reference/actions) > What each action of a rule names, what it can carry, and where Pod checks it | Action | The thing it names | What it can carry | Checked | | ------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------------- | | `read` | A granted folder of Pod's shared drive, by name, with an optional path beneath it | `at `; `to policy:` or `from policy:` to share across policies | When the folder is mounted | | `write` | The same; `write` includes `read` | The same | The same | | `net` | A host name, exact or `*.`; an address or range; or `everything else`, with optional ports | Protocol; methods and path prefixes where traffic is read; `address-only` | On every lookup and connection | | `use` | A connected tool | Nothing: the tool carries its own traffic rule | On every request that carries the tool's placeholder | | `msg` | `to policy:` or `from policy:`, or a topic | Topic, role, kind and size conditions | On every message between a swarm's sandboxes | | `call` | A connected tool that says how it carries calls | An operation and `where` tests on its arguments | On every call through the tool | **Not available yet.** Rules on message topics and on tool calls are checked and compiled, and decide Deny until the sandboxes read them. ## The verdict for each [#the-verdict-for-each] | Verdict | `net` | `use` | | --------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------ | | **Allow** | The connection goes through, recorded | The key is attached, recorded | | **Deny** | Refused at once and recorded; a web request gets a `403` naming the rule | Refused and recorded, never sent without the key | | **Ask** | Refused at once with an `ask_` reference; the retry goes through once a person allows it | The same | A rule that names nothing for an action allows nothing for it: a policy with no `read` rule mounts no folder, and one with no `net` rules reaches no host. ## What no rule can open [#what-no-rule-can-open] Pod's fixed baseline blocks these for every sandbox, whatever its policy says: | Always blocked | Ranges | | --------------------------------- | --------------------------------------------------------------------------------------------------------- | | Cloud metadata addresses | `169.254.169.254`, `fd00:ec2::254` | | Link-local | `169.254.0.0/16`, `fe80::/10` | | Private networks | `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10` | | Unique-local | `fc00::/7` | | Loopback and "this network" | `127.0.0.0/8`, `0.0.0.0/8`, `::1`, `::` | | IPv4 written as IPv6 | `::ffff:0:0/96`, `64:ff9b::/96`, `2002::/16`, `2001::/32`: checked as the IPv4 address inside, or dropped | | Multicast, reserved and broadcast | `224.0.0.0/4`, `240.0.0.0/4`, `ff00::/8` | | Pod's own servers | Every address of the servers, their networks, and other sandboxes | | Outbound mail | TCP ports `25`, `465` and `587`, to any address | A name that resolves to a blocked address is refused too. A sandbox's peers in the same swarm are the one exception to "other sandboxes", under the swarm's rules. # Limits (https://docs.mapier.ai/pod/iam/reference/limits) > The sizes, counts and times Pod Agent IAM holds policies, approvals and the record to ## Policies [#policies] | Limit | Value | | --------------------------- | --------------------------------------------------------------- | | Rules in one policy | 1,000 | | Size of a policy's rules | 256 KiB | | Port ranges in one rule | Not published yet | | A policy's name | 1 to 63 lowercase letters, digits and `-` | | Group bindings in a project | 100 | | Log-only mode | Ends at least 1 hour and at most 7 days after it is switched on | ## Connected tools [#connected-tools] | Limit | Value | | ------------------------ | ------------------------------------------------------------------ | | Hosts per tool | 1 | | Traffic entries per tool | 100 | | A key | 1 to 8,192 visible ASCII characters, with no spaces or line breaks | ## Approvals [#approvals] | Limit | Value | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------- | | Open Asks for one sandbox | 3 | | New Asks for one sandbox in an hour | 10 | | Open Asks for one project | 50 | | Asks shown to one approver at once | 10 | | Answers by one approver in an hour | 30 | | Approvers in a project | 100 | | An unanswered Ask | Ends as Deny after 24 hours | | **Allow once** | One use, within 10 minutes | | **Allow for a time** and **Deny** | 1 hour unless the approver picks another time; at most the policy's cap, 24 hours unless the policy sets less | | A second-factor proof | Good for one answer, for at most 5 minutes | When an Ask limit is reached, further Ask rules decide Deny, with the reason `limit`. ## The record [#the-record] | Limit | Value | | ---------------------------- | -------------------------------------------------------------------- | | How long it is kept | 90 days on every plan; up to 10 years when a project keeps it longer | | Export formats | `ocsf` and `otlp` | | Request and message contents | Not stored, unless you switch that on for a project | ## Groups [#groups] | Limit | Value | | --------------------------------------- | -------------------------------------------------------- | | A membership from sign-in tokens | Lapses after 12 hours by default without a newer sign-in | | Groups in one sign-in token | 1,000 | | Members in a group, or in one SCIM call | 20,000 | **Not available yet.** Policy by group needs single sign-on through your company's identity provider. # Policy syntax (https://docs.mapier.ai/pod/iam/reference/policy-syntax) > How to write a policy, rule by rule A policy is written in the simple form: in the dashboard, in a sandbox spec file, and in the `rules` field of every API call that takes rules. Each check refuses the same mistakes wherever the rules come from. A sandbox spec file takes every action except `call`; write `call` rules in the dashboard or the API. ## The simple form [#the-simple-form] One rule a line: a verdict, an action, a thing, and what the action takes after it. Words are separated by spaces; extra spaces line rules up and mean nothing. ```text title="build" Allow read repo/checkout Allow write scratch Allow net api.github.com GET POST /repos/acme/app/* Allow net registry.npmjs.org GET Allow net 203.0.113.0/24:5432 Ask use payment-keys Allow msg to policy:build-peers Deny net everything else ``` - **Verdicts:** `Allow`, `Ask`, `Deny`. - **Actions:** `read`, `write`, `net`, `use`, `msg` and `call`. [Actions](https://docs.mapier.ai/pod/iam/reference/actions) lists what each one takes. - **Order does not matter.** The most specific rule wins, and at equal weight Deny beats Ask and Ask beats Allow. - **An unknown word is an error.** Every error names its line and column, and one check reports every bad line. ## Net rules [#net-rules] ```text Allow net api.github.com GET POST /repos/acme/app/* Allow net *.example.com:443 Allow net 203.0.113.0/24:5432 Allow net [2001:db8::/32] ports 443,8000-8100 Allow net db.example.com:5432 address-only Deny net everything else ``` | Part | Written as | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | A host name | Exact, such as `api.github.com`, or `*.` for every name beneath one, such as `*.example.com`. A wildcard over a public suffix, such as `*.com`, is refused. | | An address or range | `203.0.113.7`, `203.0.113.0/24`, or IPv6 in brackets, `[2001:db8::/32]`, with ports after the closing bracket. | | `everything else` | Every host no other rule names. | | Ports | After a colon, `:443`, or as `ports 443,8000-8100`. The most ranges one rule takes: Not published yet. | | Protocol | `tcp` or `udp`. | | Methods | `GET`, `POST` and the other HTTP methods, before the paths they apply to. | | Paths | Prefixes, each ending in `*`: `/v1/refunds*` matches `/v1/refunds` and `/v1/refunds/42`. A path without `*` is refused. | | `address-only` | Enforce the name by its address and port only, without reading the traffic. | Methods and paths need Pod to read the traffic, so a rule with them switches reading on for the sandbox. QUIC is dropped when a policy has name rules that read, and programs fall back to TCP. ## Folder rules [#folder-rules] ```text Allow read datasets Allow write scratch at /mnt/scratch Allow write results to policy:review ``` A folder of Pod's shared drive, by name, with an optional path beneath it. `at` sets the mount point, an absolute path. `to policy:` and `from policy:` share a folder between sandboxes under different policies; both sides must say so. ## Tool and message rules [#tool-and-message-rules] ```text Allow use payment-keys Allow msg to policy:review Allow msg from policy:build ``` `use` names a [connected tool](https://docs.mapier.ai/pod/iam/guides/connected-tools). `msg` names another policy as `policy:`, or `policy:self` for the policy's own sandboxes. A message between two policies is delivered only when the sender's policy allows `to` and the receiver's allows `from`. [Tool rules](https://docs.mapier.ai/pod/iam/reference/tool-rules) has the forms that go further. ## Names [#names] A named policy is 1 to 63 characters of lowercase letters, digits and `-`, starting with a letter or digit. It cannot be called `organisation`, `project`, `default` or `self`. # Tool rules (https://docs.mapier.ai/pod/iam/reference/tool-rules) > How to define a connected tool, and the finer rules on tool calls and swarm messages ## Defining a tool [#defining-a-tool] A tool is defined once per project and referred to by name from any policy. ```text tool payment-keys host payments.example.com traffic POST /v1/refunds* GET /v1/charges/* attach Authorization: Bearer calls mcp ``` | Line | What it holds | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tool ` | The tool's name, as policies write it after `use`. | | `host` | The one host its key goes to. | | `traffic` | Groups of methods, each followed by its path prefixes. Paths end in `*`. A path before any method, or methods with nothing after them on a line that has paths, is refused rather than widened. A tool with no `traffic` line is refused. | | `attach` | Where the key goes, with `` in its place. | | `calls` | Optional: `mcp` or `json-rpc`, how its requests carry tool calls. A `call` rule can name the tool only when this is set. | `Allow use ` grants the tool's key and its traffic, with the rule's verdict, and switches traffic reading on. ## Rules on tool calls [#rules-on-tool-calls] **Not available yet.** Rules on message topics and on tool calls are checked and compiled, and decide Deny until the sandboxes read them. ```text Allow use pay-mcp Allow call pay-mcp refunds.create where amount <= 5000 and currency in usd,eur Deny call pay-mcp refunds.* where currency = eur and amount >= 4000 ``` - **The operation** is the MCP tool name of a `tools/call`, or the JSON-RPC method. Write it exactly, or as a start ending in `*`. - **A test** names an argument, with nested fields joined by `.`, and is `=`, `in`, `<=` or `>=`. It compares a whole number up to 2^53, or a string. Numbers compare exactly: `5000.0` and `5e3` are `5000`. Tests are joined with `and`. - **A missing argument** passes no test. - **How a call is decided.** With no `use` rule, or `Deny use`, every call is refused. With `use` and no call rules, `use` decides every call. Otherwise a call no rule matches is refused, and a matching one gets the stricter of the strictest call rule and the `use` rule. - **What is read.** One JSON-RPC 2.0 object of at most 1 MiB. A batch, a body that is not JSON, a key written twice, or a call with a missing or misshapen name or arguments is refused. An MCP request other than `tools/call` is not a call, and the tool's `use` rule decides it. A `call` rule without a `use` rule for its tool, or for a tool with no `calls` line, is refused. ## Rules on swarm messages [#rules-on-swarm-messages] **Not available yet.** Rules on message topics and on tool calls are checked and compiled, and decide Deny until the sandboxes read them. A message rule can carry conditions after its peer. Every condition must hold for the rule to match. ```text Allow msg to policy:review topic:results.* publish request max 64KiB Deny msg to policy:self Allow msg to policy:self role:worker as role:lead send request Allow msg from policy:self role:lead ``` | Condition | Matches | | ------------------------------------- | -------------------------------------------------------------------------------------------------- | | `topic:`, `topic:*` | The topic of a publish or a request. A message to one sandbox has no topic. | | `role:` | The other end's role in the swarm: up to 32 lowercase letters, digits and inner `-`. | | `as role:` | This sandbox's own role. | | `send`, `publish`, `request`, `reply` | The kind of message. | | `max ` | A body of at most this size, written such as `512B`, `64KiB` or `1MiB`. The size is at most 1 MiB. | `policy:self` means the policy's own sandboxes. For each direction and peer, the strictest matching condition decides; when none matches, the plain rule for that peer does, or the default: Deny between policies, Allow inside one. Conditions only narrow; one condition can never undo another. Pod sets the sender of every message from the sandbox it came from. Any sender the sandbox writes in the message itself is overwritten.