Accept a draft as a named policy
People only, with a fresh second factor: accepting makes a stored policy.
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
curl -X POST "https://api.pod.mapier.ai/v1/drafts/example/accept?project=example" \
-H "Authorization: Bearer $POD_PERSON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"example"}'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
| 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
201. The named policy the draft became.
{
"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
The refusals this call is known for: invalid, unauthorized, person_required, forbidden, not_found, conflict. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.