Ask for a 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).
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
curl -X POST "https://api.pod.mapier.ai/v1/drafts?project=example" \
-H "Authorization: Bearer $POD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"way":"watching","policy":"example"}'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
| 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
201. The draft, being drafted or ready.
{
"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
The refusals this call is known for: invalid, unauthorized, forbidden, not_found, rate_limited. 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.