Accept a draft as a named policy

People only, with a fresh second factor: accepting makes a stored policy.

POST/v1/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

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

NameInTypeRequiredWhat it is
draft_idpathstringYes
projectquerystringYesThe project the call is about. Every route is scoped to one.
Pod-OrganisationheaderstringNoThe organization, for a person who belongs to several. An API key's organization is its own, and a different one here is forbidden.
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
namestringYesA 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.
rulesstringNoThe rules as the person edited them; the draft's own when absent.

Answer

201. The named policy the draft became.

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
}
FieldTypeAlwaysWhat it is
idstringYes
namestringYesA 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"YesThe layers a person edits as stored policies. The organization's and the project's are the ceiling.
versionintegerYesOnly goes up. At least 1.
mode"enforce" | "log_only"Yes
log_only_untilstring | nullYesWhen log-only mode ends; null when enforcing.
rule_countintegerYesAt least 0.
sandboxesintegerYesSandboxes running under the policy, as servers report it. At least 0.
updated_atstringYesRFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z.
updated_bystringYesWho made a change. An identity account id for a person, or a key id (key_…) for an API key.
presetPinnedPreset | nullYesThe preset the policy pins; null for none.
rulesstringYesRules 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.
narrowsstring[]YesThe policies above this one, which the checker proved it no wider than.
readingobjectYesWhether Pod reads the traffic of sandboxes under the policy, and the rules that make it.
ask_cap_sinteger | nullYesThe 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.