# Runs

An orchestrator agent and its subagents, halted with one call, and the guard that watches them.

Related guide: [Halt a run](https://provenanceauth.com/docs/mandate/guides/halt-a-run.md)

## Endpoints

- `POST /v1/mandate/runs`: [Start a run](#post-v1-mandate-runs)
- `POST /v1/mandate/runs/{id}/record`: [Add spans to a run's record](#post-v1-mandate-runs-id-record)
- `GET /v1/mandate/runs/{id}`: [Get a run](#get-v1-mandate-runs-id)
- `GET /v1/mandate/runs/{id}/record`: [Read a run's record](#get-v1-mandate-runs-id-record)
- `GET /v1/mandate/settings/run_guard`: [Get the run guard](#get-v1-mandate-settings-run-guard)
- `PUT /v1/mandate/settings/run_guard`: [Set the run guard](#put-v1-mandate-settings-run-guard)
- `GET /v1/mandate/runs`: [List runs](#get-v1-mandate-runs)
- `POST /v1/mandate/runs/{id}/pause`: [Pause a run](#post-v1-mandate-runs-id-pause)
- `POST /v1/mandate/runs/{id}/resume`: [Resume a halted run](#post-v1-mandate-runs-id-resume)
- `POST /v1/mandate/runs/{id}/end`: [End a run](#post-v1-mandate-runs-id-end)
- `GET /v1/mandate/runs/{id}/record/verify`: [Verify a run's record](#get-v1-mandate-runs-id-record-verify)

## The run detail object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | Unique identifier for the object. |
| `object` | enum | no | The type of object. One of `run`. |
| `name` | string \| null | no | Your name for the run. |
| `status` | enum | no | `halted` until a person resumes it; an `ended` run takes no new members. One of `active`, `halted`, `ended`. |
| `root_grant_id` | string \| null | no | The person's mandate the run works under (its budget feeds the guard's budget pressure). |
| `created_at` | timestamp | no | When it was created. |
| `halted_at` | timestamp \| null | no | When it was halted. |
| `halt_reason` | string \| null | no | Why it was halted. |
| `halted_by` | string \| null | no | Who halted it: `user:<id>`, `api_key:<prefix>` or `guard:<rule>`. |
| `resumed_at` | timestamp \| null | no | When a person last resumed it. |
| `ended_at` | timestamp \| null | no | When it ended. |
| `members_count` | integer | no | Sessions in the run. |
| `title` | string \| null | no | The run's heading: its `name`, else the root grant's purpose; null when it has neither (show the ID). Derived, never stored. On the list and the run page. |
| `outside_proposals` | integer | no | Outside agents' proposals (counter-offers) on this run, in any status except `withdrawn`. On the list and the run page. |
| `outside_briefs` | integer | no | Briefs this run sent to an outside agent. On the list and the run page. |
| `latest_outside_proposal` | object \| null | no | The proposal a list row stands for: the one waiting on a person, else the accepted one, else the newest. Null when the run has none. |
| `latest_outside_proposal.counter_offer_id` | string | no | The counter-offer. |
| `latest_outside_proposal.counterparty_name` | string \| null | no | The outside agent's name (its origin when it gave none). |
| `latest_outside_proposal.offer_line` | string \| null | no | The offer in one short line: the items of the option the row stands for (the accepted one, else the one waiting on a person, else the first), at most 80 characters. As the outside agent named them. |
| `latest_outside_proposal.status` | enum | no | The counter-offer's status. One of `open`, `asking`, `accepted`, `declined`, `expired`, `stopped`, `not_chosen`. |
| `waiting_on` | string \| null | no | Who a running run waits on while one of its approvals is open (an escalation or a delegation proposal): the approver's name you sent with the newest open approval that has one (`Maya Chen`), else `a person`. Null when nothing is open or the run isn't `active`. |
| `depth` | integer | no | The deepest member's level below the person's mandate. |
| `members` | array of objects | no | The team, orchestrator first. |
| `members.agent_session_id` | string | no | The member's session. |
| `members.agent` | object \| null | no | The registered agent, or null. |
| `members.depth` | integer | no | Its level below the person's mandate. |
| `members.joined_at` | timestamp | no | When it joined. |
| `members.integration` | string \| null | no | The framework integration its client declared when it joined (`claude_agent_sdk`, `openai_agents`, …), or null. |
| `members.mandate` | object \| null | no | The mandate it works under: id, parent, status, purpose and constraints, and its spend: `spent` in the current window (its subagents' purchases included), `share` (its own budget, or null) and `available` (what its chain lets it spend now, with other children's reservations held, or null when nothing caps it). A child adds `budget` (`allocation`, `at_limit`, `ask_up_to`) and `reserved` (its reserved amount, or null). |
| `escalations` | array of objects | no | The approvals opened because a member's purchase went over its grant's limit, newest first (at most 50): a cart approval a store opened (`surface: checkout`, by the member's grant, in any store's account) and a step-up approval opened at verify (`surface: verify`, by the member's session). Each carries how the person decided. |
| `escalations.surface` | enum | yes | Where the purchase was asked about. One of `checkout`, `verify`. |
| `escalations.approval_id` | string | yes | The cart approval (`coap_`) or the step-up approval it opened. |
| `escalations.agent_session_id` | string \| null | yes | The member's session. |
| `escalations.grant_id` | string \| null | yes | The member's grant. |
| `escalations.lock` | string \| null | yes | The lock the purchase went past (`amount`, `budget`, `counterparty`, …). |
| `escalations.limit` | number \| null | yes | The lock's limit (null for a lock that isn't an amount). |
| `escalations.amount` | number \| null | yes | The purchase's amount. |
| `escalations.currency` | string \| null | yes | The amount's currency. |
| `escalations.decision` | enum | yes | Where it stands: `blocked` is a yes the chain couldn't take by then (nothing was spent). One of `pending`, `in_review`, `approved`, `declined`, `blocked`, `expired`, `changes_requested`. |
| `escalations.approver_link` | enum | yes | Who decided: `same_person` when it was the passkey of the person whose grant is at the top of the chain; null while undecided. One of `same_person`, `unlinked`. |
| `escalations.approver_name` | string | no | The approver's name you sent: `approver.name` on the check, or the cart approval's own `contact.name` when the store is your account. Absent when none was sent. |
| `escalations.created_at` | timestamp | yes | When it was opened. |
| `escalations.decided_at` | timestamp \| null | yes | When it was decided. |
| `escalations.approval_context` | object \| any \| null | yes | How the person decided: the object the approval's own read returns. Null while pending and after a server's decision. A cart approval in another account (the store's) leaves out the IP and the billing address. |
| `escalations.approval_context.object` | enum | no | The type of object. One of `approval_context`. |
| `escalations.approval_context.id` | string | no | Unique identifier for the object (`apc_…`). |
| `escalations.approval_context.subject` | object | no | What the person decided. |
| `escalations.approval_context.subject.type` | enum | yes | The decided object's type: a cart approval, a step-up approval, a grant, an intent token the person approved with the device's passkey when it was minted, a delegation proposal or a captured item. One of `checkout_approval`, `mandate_approval`, `mandate_grant`, `intent_token`, `delegation_proposal`, `capture_item`. |
| `escalations.approval_context.subject.id` | string | yes | Its id (an intent token is its `jti`; a captured item is `capr_…:<index>`). |
| `escalations.approval_context.decision` | enum | no | The person's own answer; `captured` for a capture. One of `approved`, `declined`, `captured`. |
| `escalations.approval_context.decided_at` | timestamp | no | When the person decided. |
| `escalations.approval_context.method` | object | no | How the person decided. |
| `escalations.approval_context.method.kind` | enum | yes | A passkey, the Provenance app's device key, the keypad on a confirmation call, a confirmation given outside Provenance, a signed-in console member, or a browser page with no passkey (a decline, a capture page). One of `passkey`, `device_key`, `voice_keypad`, `external`, `console_session`, `browser_session`. |
| `escalations.approval_context.method.authenticator` | enum | yes | With a passkey: where it lives, as the browser reported when it was created; null otherwise or when unknown. One of `platform_passkey`, `cross_device_passkey`, `security_key`. |
| `escalations.approval_context.method.user_verified` | boolean | yes | True when the assertion's user-verification flag was set (face, fingerprint or the screen lock). |
| `escalations.approval_context.method.step_up` | object \| null | yes | What confirmed the customer contact for a new passkey under `step_up_contact`, when it applied. |
| `escalations.approval_context.method.step_up.method` | enum | no | `contact_code`: a 6-digit code sent to the customer contact matched. `link_contact`: the person opened the link from the email or text sent to that same contact, so no code was sent. One of `contact_code`, `link_contact`. |
| `escalations.approval_context.method.step_up.channel` | enum | no | Where the code went, or which message carried the link. One of `sms`, `email`. |
| `escalations.approval_context.method.step_up.verified_at` | timestamp | no | When the code matched, or when the passkey approved through that link. |
| `escalations.approval_context.passkey` | object \| null | no | The passkey that decided; null for any other method. |
| `escalations.approval_context.passkey.status` | enum | no | `new` when it was younger than the store's minimum age or set up during the approval. One of `new`, `existing`. |
| `escalations.approval_context.passkey.age` | object | no | Its age at the decision: whole days, and the minutes past them. |
| `escalations.approval_context.passkey.age.days` | integer | no | Whole days. |
| `escalations.approval_context.passkey.age.minutes` | integer | no | Minutes past the whole days. |
| `escalations.approval_context.passkey.created_during_approval` | boolean | no | Set up on this approval's page. |
| `escalations.approval_context.passkey.synced` | boolean \| null | no | A synced (backed-up) passkey; null when the authenticator didn't say. |
| `escalations.approval_context.passkey.provider` | string \| null | no | The provider its AAGUID names (the authenticator's own claim); null when unknown. |
| `escalations.approval_context.passkey.provider_attested` | enum | no | Always false: the provider is the authenticator's own claim. One of `false`. |
| `escalations.approval_context.device` | object \| null | no | The device the person decided on, as it reported itself (or, with the app's device key, as it enrolled). |
| `escalations.approval_context.device.os` | string \| null | no | `ios`, `ipados`, `android`, `macos`, `windows`, `linux` or `other`. |
| `escalations.approval_context.device.os_version` | string \| null | no | The OS version, for phones (desktop browsers freeze theirs). |
| `escalations.approval_context.device.browser` | string \| null | no | `safari`, `chrome`, `edge`, `firefox`, `samsung` or `other`; null in an app. |
| `escalations.approval_context.device.source` | enum | no | Where the device facts came from. One of `user_agent`, `app_attestation`. |
| `escalations.approval_context.device.verified` | boolean | no | True only when the server verified the device's attestation. |
| `escalations.approval_context.device.time_zone` | object \| null | no | The device's time zone, as reported (never verified). |
| `escalations.approval_context.device.time_zone.name` | string | no | IANA name (`America/Los_Angeles`). |
| `escalations.approval_context.device.time_zone.utc_offset_minutes` | integer | no | Its offset at the decision. |
| `escalations.approval_context.device.time_zone.source` | enum | no | Who reported it. One of `browser`, `app`. |
| `escalations.approval_context.device.time_zone.verified` | enum | no | Always false. One of `false`. |
| `escalations.approval_context.device.locale` | string \| null | no | The language tag (`en-US`). |
| `escalations.approval_context.network` | object \| null | no | The connection the decision came from: a provider's estimate of its place, and its flags. |
| `escalations.approval_context.network.country` | string \| null | no | ISO 3166-1 alpha-2. |
| `escalations.approval_context.network.region` | string \| null | no | ISO 3166-2 (`US-OR`). |
| `escalations.approval_context.network.city` | string \| null | no | The city, only while the network city switch is on. |
| `escalations.approval_context.network.city_status` | enum | no | Whether the city switch is on. One of `enabled`, `not_enabled`. |
| `escalations.approval_context.network.flags` | object | no | What the published lists and the IP lookup say about the network. |
| `escalations.approval_context.network.flags.vpn` | boolean | no | A VPN service. |
| `escalations.approval_context.network.flags.proxy` | boolean | no | A proxy. |
| `escalations.approval_context.network.flags.hosting_provider` | boolean | no | A cloud or hosting provider's range. |
| `escalations.approval_context.network.flags.tor` | boolean | no | A Tor exit. |
| `escalations.approval_context.network.flags.private_relay` | boolean | no | iCloud Private Relay (a privacy feature, never counted as a VPN). |
| `escalations.approval_context.network.asn` | integer \| null | no | The network's AS number, from the IP lookup provider; null without one. |
| `escalations.approval_context.network.source` | enum | no | Where the place and flags came from. One of `published_lists`, `ip_intel`. |
| `escalations.approval_context.network.ip` | string \| null | no | The address, only while your IP sharing switch is on and the sealed copy is kept; null otherwise. |
| `escalations.approval_context.location_match` | enum | no | A cart approval's only: whether where the person approved from matches the billing address the store sent. The same value the `approval.location` rule fact reads: `matches_billing` needs the network region (or city) to agree with nothing contradicting it, a time-zone match alone is never a match; `differs` when a known comparison differs; `unavailable` with its reason in `unavailable.location_match` (no IP lookup, no time zone); `no_billing` when the store sent no address. The distance and the per-field comparisons stay rule facts and are never returned. Absent on other approvals. One of `matches_billing`, `differs`, `unavailable`, `no_billing`. |
| `escalations.approval_context.location_match_basis` | array of enums | no | With `location_match`: the inputs that agreed (`matches_billing`) or disagreed (`differs`); empty otherwise. `time_zone_network`: the device's time zone is in another country than the network. |
| `escalations.approval_context.browser_details` | object | no | The 3-D Secure browser fields the approval page or embed reported, with the request's User-Agent and Accept headers; null for a decision outside a browser page (the app, a keypad, a console member) or recorded before they were collected. |
| `escalations.approval_context.browser_details.screen_width` | integer \| null | yes | The screen's width in CSS pixels (`screen.width`). |
| `escalations.approval_context.browser_details.screen_height` | integer \| null | yes | The screen's height in CSS pixels (`screen.height`). |
| `escalations.approval_context.browser_details.color_depth` | enum | yes | Bits per pixel (`screen.colorDepth`). One of `1`, `4`, `8`, `15`, `16`, `24`, `30`, `32`, `48`. |
| `escalations.approval_context.browser_details.language` | string \| null | yes | The browser's language (`navigator.language`). |
| `escalations.approval_context.browser_details.java_enabled` | boolean \| null | yes | Whether Java is enabled (`navigator.javaEnabled()`). |
| `escalations.approval_context.browser_details.javascript_enabled` | boolean \| null | yes | Whether JavaScript ran (true when the page sent the block). |
| `escalations.approval_context.browser_details.utc_offset_minutes` | integer \| null | yes | Local time minus UTC, in minutes. |
| `escalations.approval_context.browser_details.user_agent` | string \| null | yes | The request's `User-Agent` header (at most 2,048 characters). |
| `escalations.approval_context.browser_details.accept_header` | string \| null | yes | The request's `Accept` header (at most 2,048 characters). |
| `escalations.approval_context.browser_details.source` | enum | yes | Where the fields came from. One of `browser`. |
| `escalations.approval_context.browser_details.verified` | enum | yes | Always false: as the browser reported them. One of `false`. |
| `escalations.approval_context.billing` | object | no | A cart approval's context only: the full billing address you sent, to your own key and console (never on a webhook); null otherwise. |
| `escalations.approval_context.billing.line1` | string \| null | yes | The street line. |
| `escalations.approval_context.billing.line2` | string \| null | yes | The second line. |
| `escalations.approval_context.billing.city` | string \| null | yes | The city. |
| `escalations.approval_context.billing.region` | string \| null | yes | ISO 3166-2 (`US-OR`) where the region table maps it (US, Canada, Australia); else as you sent it. |
| `escalations.approval_context.billing.postal_code` | string \| null | yes | The postal code as you sent it. |
| `escalations.approval_context.billing.country` | string | yes | ISO 3166-1 alpha-2. |
| `escalations.approval_context.billing.source` | enum | yes | Always `merchant`: your store attested it. One of `merchant`. |
| `escalations.approval_context.person` | object | no | Who decided, as far as Provenance can say without identifying them. |
| `escalations.approval_context.person.pseudonym` | string \| null | no | A per-store pseudonym for the passkey, on cart approvals. |
| `escalations.approval_context.person.link` | enum | no | Over a grant's limit: whether the passkey is the grant's own person's. One of `same_person`, `unlinked`, `not_applicable`. |
| `escalations.approval_context.external` | object \| null | no | With `method.kind: external`: the confirmation given outside Provenance. |
| `escalations.approval_context.external.kind` | enum | no | The kind of outside confirmation. One of `ap2_user_mandate`, `spc`, `platform`. |
| `escalations.approval_context.external.issuer` | string \| null | no | Who issued it. |
| `escalations.approval_context.external.evidence_hash` | string \| null | no | The hash of the evidence verified. |
| `escalations.approval_context.unavailable` | object | no | Each fact that is null and why (`not_collected`, `no_ip`, `ip_intel_not_configured`, `ip_intel_failed`, `network_relayed`, `network_vpn`, `network_hosting`, `network_tor`), keyed by field (`device.time_zone`, `network.country`). |
| `delegation_proposals` | array of objects | no | The structures a member proposed under its grant or the run's root grant, newest first (at most 50), each with how the person decided. |
| `delegation_proposals.id` | string | yes | The proposal's ID (`dgp_`). |
| `delegation_proposals.status` | enum | yes | Where it stands. One of `pending`, `approved`, `declined`, `expired`, `stale`, `superseded`. |
| `delegation_proposals.parent_grant_id` | string | yes | The grant it proposes under. |
| `delegation_proposals.agent_id` | string \| null | yes | The agent that proposed it. |
| `delegation_proposals.proposed_by` | string | yes | How it was proposed (`holder`, `account_key` or `console`). |
| `delegation_proposals.children` | integer | yes | How many children it proposed. |
| `delegation_proposals.edited` | boolean | yes | Whether the person changed anything. |
| `delegation_proposals.decided_via` | enum | yes | Where the person decided. One of `link`, `console`. |
| `delegation_proposals.approver_name` | string | no | The approver's name you sent with the proposal (`approver.name`); absent when none. |
| `delegation_proposals.created_at` | timestamp | yes | When it was proposed. |
| `delegation_proposals.decided_at` | timestamp \| null | yes | When it was decided. |
| `delegation_proposals.approval_context` | object \| any \| null | yes | How the person decided (subject `delegation_proposal`); null while pending and when nobody decided it. |
| `delegation_proposals.approval_context.object` | enum | no | The type of object. One of `approval_context`. |
| `delegation_proposals.approval_context.id` | string | no | Unique identifier for the object (`apc_…`). |
| `delegation_proposals.approval_context.subject` | object | no | What the person decided. |
| `delegation_proposals.approval_context.subject.type` | enum | yes | The decided object's type: a cart approval, a step-up approval, a grant, an intent token the person approved with the device's passkey when it was minted, a delegation proposal or a captured item. One of `checkout_approval`, `mandate_approval`, `mandate_grant`, `intent_token`, `delegation_proposal`, `capture_item`. |
| `delegation_proposals.approval_context.subject.id` | string | yes | Its id (an intent token is its `jti`; a captured item is `capr_…:<index>`). |
| `delegation_proposals.approval_context.decision` | enum | no | The person's own answer; `captured` for a capture. One of `approved`, `declined`, `captured`. |
| `delegation_proposals.approval_context.decided_at` | timestamp | no | When the person decided. |
| `delegation_proposals.approval_context.method` | object | no | How the person decided. |
| `delegation_proposals.approval_context.method.kind` | enum | yes | A passkey, the Provenance app's device key, the keypad on a confirmation call, a confirmation given outside Provenance, a signed-in console member, or a browser page with no passkey (a decline, a capture page). One of `passkey`, `device_key`, `voice_keypad`, `external`, `console_session`, `browser_session`. |
| `delegation_proposals.approval_context.method.authenticator` | enum | yes | With a passkey: where it lives, as the browser reported when it was created; null otherwise or when unknown. One of `platform_passkey`, `cross_device_passkey`, `security_key`. |
| `delegation_proposals.approval_context.method.user_verified` | boolean | yes | True when the assertion's user-verification flag was set (face, fingerprint or the screen lock). |
| `delegation_proposals.approval_context.method.step_up` | object \| null | yes | What confirmed the customer contact for a new passkey under `step_up_contact`, when it applied. |
| `delegation_proposals.approval_context.method.step_up.method` | enum | no | `contact_code`: a 6-digit code sent to the customer contact matched. `link_contact`: the person opened the link from the email or text sent to that same contact, so no code was sent. One of `contact_code`, `link_contact`. |
| `delegation_proposals.approval_context.method.step_up.channel` | enum | no | Where the code went, or which message carried the link. One of `sms`, `email`. |
| `delegation_proposals.approval_context.method.step_up.verified_at` | timestamp | no | When the code matched, or when the passkey approved through that link. |
| `delegation_proposals.approval_context.passkey` | object \| null | no | The passkey that decided; null for any other method. |
| `delegation_proposals.approval_context.passkey.status` | enum | no | `new` when it was younger than the store's minimum age or set up during the approval. One of `new`, `existing`. |
| `delegation_proposals.approval_context.passkey.age` | object | no | Its age at the decision: whole days, and the minutes past them. |
| `delegation_proposals.approval_context.passkey.age.days` | integer | no | Whole days. |
| `delegation_proposals.approval_context.passkey.age.minutes` | integer | no | Minutes past the whole days. |
| `delegation_proposals.approval_context.passkey.created_during_approval` | boolean | no | Set up on this approval's page. |
| `delegation_proposals.approval_context.passkey.synced` | boolean \| null | no | A synced (backed-up) passkey; null when the authenticator didn't say. |
| `delegation_proposals.approval_context.passkey.provider` | string \| null | no | The provider its AAGUID names (the authenticator's own claim); null when unknown. |
| `delegation_proposals.approval_context.passkey.provider_attested` | enum | no | Always false: the provider is the authenticator's own claim. One of `false`. |
| `delegation_proposals.approval_context.device` | object \| null | no | The device the person decided on, as it reported itself (or, with the app's device key, as it enrolled). |
| `delegation_proposals.approval_context.device.os` | string \| null | no | `ios`, `ipados`, `android`, `macos`, `windows`, `linux` or `other`. |
| `delegation_proposals.approval_context.device.os_version` | string \| null | no | The OS version, for phones (desktop browsers freeze theirs). |
| `delegation_proposals.approval_context.device.browser` | string \| null | no | `safari`, `chrome`, `edge`, `firefox`, `samsung` or `other`; null in an app. |
| `delegation_proposals.approval_context.device.source` | enum | no | Where the device facts came from. One of `user_agent`, `app_attestation`. |
| `delegation_proposals.approval_context.device.verified` | boolean | no | True only when the server verified the device's attestation. |
| `delegation_proposals.approval_context.device.time_zone` | object \| null | no | The device's time zone, as reported (never verified). |
| `delegation_proposals.approval_context.device.time_zone.name` | string | no | IANA name (`America/Los_Angeles`). |
| `delegation_proposals.approval_context.device.time_zone.utc_offset_minutes` | integer | no | Its offset at the decision. |
| `delegation_proposals.approval_context.device.time_zone.source` | enum | no | Who reported it. One of `browser`, `app`. |
| `delegation_proposals.approval_context.device.time_zone.verified` | enum | no | Always false. One of `false`. |
| `delegation_proposals.approval_context.device.locale` | string \| null | no | The language tag (`en-US`). |
| `delegation_proposals.approval_context.network` | object \| null | no | The connection the decision came from: a provider's estimate of its place, and its flags. |
| `delegation_proposals.approval_context.network.country` | string \| null | no | ISO 3166-1 alpha-2. |
| `delegation_proposals.approval_context.network.region` | string \| null | no | ISO 3166-2 (`US-OR`). |
| `delegation_proposals.approval_context.network.city` | string \| null | no | The city, only while the network city switch is on. |
| `delegation_proposals.approval_context.network.city_status` | enum | no | Whether the city switch is on. One of `enabled`, `not_enabled`. |
| `delegation_proposals.approval_context.network.flags` | object | no | What the published lists and the IP lookup say about the network. |
| `delegation_proposals.approval_context.network.flags.vpn` | boolean | no | A VPN service. |
| `delegation_proposals.approval_context.network.flags.proxy` | boolean | no | A proxy. |
| `delegation_proposals.approval_context.network.flags.hosting_provider` | boolean | no | A cloud or hosting provider's range. |
| `delegation_proposals.approval_context.network.flags.tor` | boolean | no | A Tor exit. |
| `delegation_proposals.approval_context.network.flags.private_relay` | boolean | no | iCloud Private Relay (a privacy feature, never counted as a VPN). |
| `delegation_proposals.approval_context.network.asn` | integer \| null | no | The network's AS number, from the IP lookup provider; null without one. |
| `delegation_proposals.approval_context.network.source` | enum | no | Where the place and flags came from. One of `published_lists`, `ip_intel`. |
| `delegation_proposals.approval_context.network.ip` | string \| null | no | The address, only while your IP sharing switch is on and the sealed copy is kept; null otherwise. |
| `delegation_proposals.approval_context.location_match` | enum | no | A cart approval's only: whether where the person approved from matches the billing address the store sent. The same value the `approval.location` rule fact reads: `matches_billing` needs the network region (or city) to agree with nothing contradicting it, a time-zone match alone is never a match; `differs` when a known comparison differs; `unavailable` with its reason in `unavailable.location_match` (no IP lookup, no time zone); `no_billing` when the store sent no address. The distance and the per-field comparisons stay rule facts and are never returned. Absent on other approvals. One of `matches_billing`, `differs`, `unavailable`, `no_billing`. |
| `delegation_proposals.approval_context.location_match_basis` | array of enums | no | With `location_match`: the inputs that agreed (`matches_billing`) or disagreed (`differs`); empty otherwise. `time_zone_network`: the device's time zone is in another country than the network. |
| `delegation_proposals.approval_context.browser_details` | object | no | The 3-D Secure browser fields the approval page or embed reported, with the request's User-Agent and Accept headers; null for a decision outside a browser page (the app, a keypad, a console member) or recorded before they were collected. |
| `delegation_proposals.approval_context.browser_details.screen_width` | integer \| null | yes | The screen's width in CSS pixels (`screen.width`). |
| `delegation_proposals.approval_context.browser_details.screen_height` | integer \| null | yes | The screen's height in CSS pixels (`screen.height`). |
| `delegation_proposals.approval_context.browser_details.color_depth` | enum | yes | Bits per pixel (`screen.colorDepth`). One of `1`, `4`, `8`, `15`, `16`, `24`, `30`, `32`, `48`. |
| `delegation_proposals.approval_context.browser_details.language` | string \| null | yes | The browser's language (`navigator.language`). |
| `delegation_proposals.approval_context.browser_details.java_enabled` | boolean \| null | yes | Whether Java is enabled (`navigator.javaEnabled()`). |
| `delegation_proposals.approval_context.browser_details.javascript_enabled` | boolean \| null | yes | Whether JavaScript ran (true when the page sent the block). |
| `delegation_proposals.approval_context.browser_details.utc_offset_minutes` | integer \| null | yes | Local time minus UTC, in minutes. |
| `delegation_proposals.approval_context.browser_details.user_agent` | string \| null | yes | The request's `User-Agent` header (at most 2,048 characters). |
| `delegation_proposals.approval_context.browser_details.accept_header` | string \| null | yes | The request's `Accept` header (at most 2,048 characters). |
| `delegation_proposals.approval_context.browser_details.source` | enum | yes | Where the fields came from. One of `browser`. |
| `delegation_proposals.approval_context.browser_details.verified` | enum | yes | Always false: as the browser reported them. One of `false`. |
| `delegation_proposals.approval_context.billing` | object | no | A cart approval's context only: the full billing address you sent, to your own key and console (never on a webhook); null otherwise. |
| `delegation_proposals.approval_context.billing.line1` | string \| null | yes | The street line. |
| `delegation_proposals.approval_context.billing.line2` | string \| null | yes | The second line. |
| `delegation_proposals.approval_context.billing.city` | string \| null | yes | The city. |
| `delegation_proposals.approval_context.billing.region` | string \| null | yes | ISO 3166-2 (`US-OR`) where the region table maps it (US, Canada, Australia); else as you sent it. |
| `delegation_proposals.approval_context.billing.postal_code` | string \| null | yes | The postal code as you sent it. |
| `delegation_proposals.approval_context.billing.country` | string | yes | ISO 3166-1 alpha-2. |
| `delegation_proposals.approval_context.billing.source` | enum | yes | Always `merchant`: your store attested it. One of `merchant`. |
| `delegation_proposals.approval_context.person` | object | no | Who decided, as far as Provenance can say without identifying them. |
| `delegation_proposals.approval_context.person.pseudonym` | string \| null | no | A per-store pseudonym for the passkey, on cart approvals. |
| `delegation_proposals.approval_context.person.link` | enum | no | Over a grant's limit: whether the passkey is the grant's own person's. One of `same_person`, `unlinked`, `not_applicable`. |
| `delegation_proposals.approval_context.external` | object \| null | no | With `method.kind: external`: the confirmation given outside Provenance. |
| `delegation_proposals.approval_context.external.kind` | enum | no | The kind of outside confirmation. One of `ap2_user_mandate`, `spc`, `platform`. |
| `delegation_proposals.approval_context.external.issuer` | string \| null | no | Who issued it. |
| `delegation_proposals.approval_context.external.evidence_hash` | string \| null | no | The hash of the evidence verified. |
| `delegation_proposals.approval_context.unavailable` | object | no | Each fact that is null and why (`not_collected`, `no_ip`, `ip_intel_not_configured`, `ip_intel_failed`, `network_relayed`, `network_vpn`, `network_hosting`, `network_tor`), keyed by field (`device.time_zone`, `network.country`). |
| `guard` | object | no | The run guard's counters in the current window, its trips and the shadow copy's would-have-tripped counts. |
| `guard.window_minutes` | integer | no | The counting window. |
| `guard.counters` | object | no | Counts by rule. |
| `guard.trips` | array of objects | no | Each trip: rule, mode (`flag` or `halt`), count, time. |
| `guard.shadow_trips` | object | no | The shadow copy's crossings by rule. It never acts. |
| `guard.counters_shared` | boolean | no | Whether every server counts the same windows. |
| `record` | object \| null | no | The run's record: `valid`, `batches`, `signed`, `checkpoints`, `first_break` when broken, and the last 50 batches as `timeline`. Null when this deployment keeps no records. |
| `grants_revoked` | integer | no | On a halt: mandates it revoked. |
| `sessions_locked` | integer | no | On a halt: sessions it locked. |

### Example

```json
{
  "id": "run_01M8H7BG244N4TF2A7EDS0PQFD",
  "object": "run",
  "name": "Restock printer paper",
  "title": "Restock printer paper",
  "outside_proposals": 0,
  "outside_briefs": 0,
  "latest_outside_proposal": null,
  "status": "active",
  "root_grant_id": null,
  "created_at": "2026-11-28T14:01:12.004Z",
  "halted_at": null,
  "halt_reason": null,
  "halted_by": null,
  "resumed_at": null,
  "ended_at": null,
  "members_count": 0,
  "waiting_on": null,
  "record": {
    "valid": true,
    "batches": 0,
    "signed": 0,
    "checkpoints": 0,
    "timeline": []
  },
  "members": [],
  "depth": 0,
  "escalations": [],
  "delegation_proposals": [],
  "guard": {
    "window_minutes": 10,
    "counters": {
      "denials": 0,
      "out_of_scope": 0,
      "fan_out": 0,
      "off_task": 0
    },
    "trips": [],
    "shadow_trips": {},
    "counters_shared": true
  }
}
```

## Events

Sent to your [webhook endpoints](https://provenanceauth.com/docs/integrate/webhooks.md) when they subscribe:

- `mandate.run.halted`
- `mandate.run.resumed`
- `mandate.run.flagged`

## Start a run

`POST /v1/mandate/runs`

Starts a run for an orchestrator and its subagents. Sessions join by passing `run_id` to authorize and to delegate; a child mandate inherits its parent's run. Free.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |
| `name` | body | string | no | A name for the run. |
| `root_grant_id` | body | string | no | The person's mandate the team works under. |

### Returns

The run.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
      "max_amount": 80,
      "budget_amount": 200,
      "budget_window": "month",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"name\": \"Restock printer paper\", \"root_grant_id\": \"$MANDATE_ID\" }"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
      "max_amount": 80,
      "budget_amount": 200,
      "budget_window": "month",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper", "root_grant_id": mandateId }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
        "max_amount": 80,
        "budget_amount": 200,
        "budget_window": "month",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Restock printer paper",
    "root_grant_id": mandate_id
}).json()
```

### Response 201

```json
{
  "id": "run_01M8H7BG1Y3R5FQTWA024X4BA3",
  "object": "run",
  "name": "Restock printer paper",
  "status": "active",
  "root_grant_id": "grt_01M8H7BG1MRVJ80JPS9JF9R1KW",
  "created_at": "2026-11-28T14:01:11.998Z",
  "halted_at": null,
  "halt_reason": null,
  "halted_by": null,
  "resumed_at": null,
  "ended_at": null,
  "members_count": 0
}
```

## Add spans to a run's record

`POST /v1/mandate/runs/{id}/record`

Accepts OTLP/HTTP JSON (`resourceSpans`) or SDK batches (`spans`), optionally signed by the agent's key, and appends them to the run's hash-chained record. At most 1,000 spans and 1 MB. Pro and up; storage is included.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The run's ID. |
| `resourceSpans` | body | array of objects | no | OTLP/HTTP JSON, as an OpenTelemetry collector's `otlphttp` exporter sends it. |
| `spans` | body | array of objects | no | Or spans in the record's form (what `RecordExporter` sends). |
| `spans.name` | body | string | no | The span's name. |
| `spans.kind` | body | string | no | `internal`, `server`, `client`, `producer`, `consumer` or `unspecified`. |
| `spans.start_time` | body | timestamp | no | When it started. |
| `spans.end_time` | body | timestamp \| null | no | When it ended. |
| `spans.status` | body | object | no | `{ code, message? }`; code is `unset`, `ok` or `error`. |
| `spans.trace_id` | body | string \| null | no | The trace. |
| `spans.span_id` | body | string \| null | no | The span. |
| `spans.parent_span_id` | body | string \| null | no | The parent span. |
| `spans.attributes` | body | object | no | At most 64 scalar attributes. |
| `agent_id` | body | string | no | For a signed batch: the registered agent whose key signed it. |
| `signature` | body | object | no | For a signed batch: Ed25519 over the canonical JSON of `{ run_id, spans }`. |
| `signature.kid` | body | string | no | The agent signing key's ID. |
| `signature.sig` | body | string | no | The signature, base64url. |

### Returns

The batch's place in the chain.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`plan_required`](https://provenanceauth.com/docs/platform/errors.md#plan_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`record_signature_invalid`](https://provenanceauth.com/docs/platform/errors.md#record_signature_invalid)
- [`record_batch_too_large`](https://provenanceauth.com/docs/platform/errors.md#record_batch_too_large)
- [`run_record_not_configured`](https://provenanceauth.com/docs/platform/errors.md#run_record_not_configured)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Restock printer paper" }' > step.json
export RUN_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/runs/$RUN_ID/record" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "resourceSpans": [
      {
        "resource": {
          "attributes": [
            {
              "key": "service.name",
              "value": {
                "stringValue": "paperfinder"
              }
            }
          ]
        },
        "scopeSpans": [
          {
            "scope": {
              "name": "paperfinder.tools",
              "version": "1.0.0"
            },
            "spans": [
              {
                "traceId": "5b8efff798038103d269b633813fc60c",
                "spanId": "eee19b7ec3c1b174",
                "name": "search_prices",
                "kind": 3,
                "startTimeUnixNano": "1798761600000000000",
                "endTimeUnixNano": "1798761601000000000",
                "attributes": [
                  {
                    "key": "tool.name",
                    "value": {
                      "stringValue": "search_prices"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }'
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper" }),
})).json();
const runId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/record`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "resourceSpans": [
      {
        "resource": {
          "attributes": [
            {
              "key": "service.name",
              "value": {
                "stringValue": "paperfinder"
              }
            }
          ]
        },
        "scopeSpans": [
          {
            "scope": {
              "name": "paperfinder.tools",
              "version": "1.0.0"
            },
            "spans": [
              {
                "traceId": "5b8efff798038103d269b633813fc60c",
                "spanId": "eee19b7ec3c1b174",
                "name": "search_prices",
                "kind": 3,
                "startTimeUnixNano": "1798761600000000000",
                "endTimeUnixNano": "1798761601000000000",
                "attributes": [
                  {
                    "key": "tool.name",
                    "value": {
                      "stringValue": "search_prices"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Restock printer paper"
}).json()
run_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/runs/{run_id}/record", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "resourceSpans": [
        {
            "resource": {
                "attributes": [
                    {
                        "key": "service.name",
                        "value": {
                            "stringValue": "paperfinder"
                        }
                    }
                ]
            },
            "scopeSpans": [
                {
                    "scope": {
                        "name": "paperfinder.tools",
                        "version": "1.0.0"
                    },
                    "spans": [
                        {
                            "traceId": "5b8efff798038103d269b633813fc60c",
                            "spanId": "eee19b7ec3c1b174",
                            "name": "search_prices",
                            "kind": 3,
                            "startTimeUnixNano": "1798761600000000000",
                            "endTimeUnixNano": "1798761601000000000",
                            "attributes": [
                                {
                                    "key": "tool.name",
                                    "value": {
                                        "stringValue": "search_prices"
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}).json()
```

### Response 201

```json
{
  "object": "run_record_batch",
  "run_id": "run_01M6VQBCRKEHXG9XB2DHP6SBGK",
  "seq": 1,
  "spans": 1,
  "prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
  "batch_hash": "02b7aea416c7e8e31568906622e403fcc5907210f5b235f22c2af8f6a1f2b019",
  "signed_by": null,
  "created_at": "2026-11-07T19:21:46.517Z"
}
```

## Get a run

`GET /v1/mandate/runs/{id}`

Returns the run with its team (each member's mandate, purpose and limits), the run guard's counters and trips, and its escalations and delegation proposals, each with how the person decided (`approval_context`).

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The run's ID. |

### Returns

The run. See [the run detail object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Restock printer paper" }' > step.json
export RUN_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/runs/$RUN_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper" }),
})).json();
const runId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Restock printer paper"
}).json()
run_id = step1["id"]
data = httpx.get(f"{api}/v1/mandate/runs/{run_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "run_01M8H7BG244N4TF2A7EDS0PQFD",
  "object": "run",
  "name": "Restock printer paper",
  "title": "Restock printer paper",
  "outside_proposals": 0,
  "outside_briefs": 0,
  "latest_outside_proposal": null,
  "status": "active",
  "root_grant_id": null,
  "created_at": "2026-11-28T14:01:12.004Z",
  "halted_at": null,
  "halt_reason": null,
  "halted_by": null,
  "resumed_at": null,
  "ended_at": null,
  "members_count": 0,
  "waiting_on": null,
  "record": {
    "valid": true,
    "batches": 0,
    "signed": 0,
    "checkpoints": 0,
    "timeline": []
  },
  "members": [],
  "depth": 0,
  "escalations": [],
  "delegation_proposals": [],
  "guard": {
    "window_minutes": 10,
    "counters": {
      "denials": 0,
      "out_of_scope": 0,
      "fan_out": 0,
      "off_task": 0
    },
    "trips": [],
    "shadow_trips": {},
    "counters_shared": true
  }
}
```

## Read a run's record

`GET /v1/mandate/runs/{id}/record`

Returns the batches with their spans, hashes and signatures. `?format=jsonl` exports them one per line for `verifyRunRecord` in `@provenance/core`.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The run's ID. |
| `format` | query | enum | no | `jsonl` for the offline export. One of `jsonl`. |

### Returns

The batches, oldest first.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`run_record_not_configured`](https://provenanceauth.com/docs/platform/errors.md#run_record_not_configured)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Restock printer paper" }' > step.json
export RUN_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs/$RUN_ID/record" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "spans": [
      {
        "name": "search_prices",
        "kind": "client",
        "start_time": "2027-01-01T00:00:00.000Z",
        "end_time": "2027-01-01T00:00:01.000Z",
        "status": {
          "code": "ok"
        },
        "trace_id": null,
        "span_id": null,
        "parent_span_id": null,
        "attributes": {
          "tool.name": "search_prices"
        }
      }
    ]
  }' > /dev/null
curl "$PROVENANCE_API/v1/mandate/runs/$RUN_ID/record" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper" }),
})).json();
const runId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/record`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "spans": [
      {
        "name": "search_prices",
        "kind": "client",
        "start_time": "2027-01-01T00:00:00.000Z",
        "end_time": "2027-01-01T00:00:01.000Z",
        "status": {
          "code": "ok"
        },
        "trace_id": null,
        "span_id": null,
        "parent_span_id": null,
        "attributes": {
          "tool.name": "search_prices"
        }
      }
    ]
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/record`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Restock printer paper"
}).json()
run_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/runs/{run_id}/record", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "spans": [
        {
            "name": "search_prices",
            "kind": "client",
            "start_time": "2027-01-01T00:00:00.000Z",
            "end_time": "2027-01-01T00:00:01.000Z",
            "status": {
                "code": "ok"
            },
            "trace_id": None,
            "span_id": None,
            "parent_span_id": None,
            "attributes": {
                "tool.name": "search_prices"
            }
        }
    ]
}).json()
data = httpx.get(f"{api}/v1/mandate/runs/{run_id}/record", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "object": "run_record_batch",
      "run_id": "run_01M6VQBCRNZMPMR5WNR24V27W8",
      "seq": 1,
      "prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
      "created_at": "2026-11-07T19:21:46.517Z",
      "source": "agent",
      "signed_by": null,
      "signature": null,
      "spans_hash": "a61c75507ac4e838fabf4b76a9d3c1f7e6ac1c540aee22658c4724105aa065cf",
      "batch_hash": "f29f1a021cc813959017fc7c3ce9894ef99a48f8a2b905b18cc0151909c10423",
      "spans": [
        {
          "name": "search_prices",
          "kind": "client",
          "start_time": "2027-01-01T00:00:00.000Z",
          "end_time": "2027-01-01T00:00:01.000Z",
          "status": {
            "code": "ok"
          },
          "trace_id": null,
          "span_id": null,
          "parent_span_id": null,
          "attributes": {
            "tool.name": "search_prices"
          }
        }
      ]
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## Get the run guard

`GET /v1/mandate/settings/run_guard`

Returns the account's run guard rules, the shadow copy and whether counters are shared across servers.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The run guard.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/settings/run_guard" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/run_guard`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/mandate/settings/run_guard", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "run_guard",
  "window_minutes": 10,
  "rules": {
    "denials": {
      "mode": "flag",
      "threshold": 5
    },
    "out_of_scope": {
      "mode": "halt",
      "threshold": 3
    },
    "budget_pressure": {
      "mode": "flag",
      "threshold": 80
    },
    "fan_out": {
      "mode": "flag",
      "threshold": 20
    },
    "canary": {
      "mode": "flag",
      "threshold": 1
    },
    "off_task": {
      "mode": "halt",
      "threshold": 2
    }
  },
  "shadow": null,
  "counters_shared": true
}
```

## Set the run guard

`PUT /v1/mandate/settings/run_guard`

Changes rules, the window or the shadow copy. Needs an admin key or an owner or admin session.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `window_minutes` | body | integer | no | The counting window. |
| `rules` | body | object | no | Per rule: `mode` (`off`, `flag`, `halt`) and `threshold`. |
| `shadow` | body | object \| null | no | `{ rules: { <rule>: { threshold } } }`, evaluated and never enforced; null removes it. |

### Returns

The run guard.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/mandate/settings/run_guard" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "rules": { "out_of_scope": { "mode": "halt", "threshold": 3 } } }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/run_guard`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "rules": { "out_of_scope": { "mode": "halt", "threshold": 3 } } }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/mandate/settings/run_guard", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "rules": {
        "out_of_scope": {
            "mode": "halt",
            "threshold": 3
        }
    }
}).json()
```

### Response 200

```json
{
  "object": "run_guard",
  "window_minutes": 10,
  "rules": {
    "denials": {
      "mode": "flag",
      "threshold": 5
    },
    "out_of_scope": {
      "mode": "halt",
      "threshold": 3
    },
    "budget_pressure": {
      "mode": "flag",
      "threshold": 80
    },
    "fan_out": {
      "mode": "flag",
      "threshold": 20
    },
    "canary": {
      "mode": "flag",
      "threshold": 1
    },
    "off_task": {
      "mode": "halt",
      "threshold": 2
    }
  },
  "shadow": null,
  "counters_shared": true
}
```

## List runs

`GET /v1/mandate/runs`

Lists your account's runs, newest first. Filter with the status, a search on the name or ID, the created range and whether an outside agent took part; sort by when it started or what it spent; page with `cursor`. Each run carries its `title` and its outside agent's counts; if those can't be read the list answers 503 rather than zeros.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sort` | query | enum | no | The order of the list: `created`, or `spent` (what the run's root grant spent this budget window), with `-` in front for descending. Newest first when omitted. Another order sorts the newest 1,000 runs that match the filters, and a run with no root grant or no budget sorts last. A `next_cursor` carries its order; pass it back with the same `sort`. One of `created`, `-created`, `spent`, `-spent`. |
| `limit` | query | integer | no | Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid. |
| `cursor` | query | string | no | Opaque; pass a response's `next_cursor` back to get the next page. |
| `status` | query | array of enums | no | Only runs in these statuses. One value, or several separated by commas. |
| `q` | query | string | no | Search text. Matches when the run's ID or name contains it, ignoring case. At most 200 characters. |
| `created_gte` | query | timestamp | no | Only runs started at or after this time. |
| `created_lte` | query | timestamp | no | Only runs started at or before this time. |
| `outside_agent` | query | enum | no | Only runs where an outside agent made a proposal (`proposed`), took part at all (`took_part`: a proposal or a brief the run sent it), or neither (`none`). Combines with the other filters and pages with the same cursor. One of `proposed`, `took_part`, `none`. |

### Returns

The runs.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`run_outside_counts_unavailable`](https://provenanceauth.com/docs/platform/errors.md#run_outside_counts_unavailable)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
      "max_amount": 80,
      "budget_amount": 200,
      "budget_window": "month",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"root_grant_id\": \"$MANDATE_ID\" }" > /dev/null
curl "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
      "max_amount": 80,
      "budget_amount": 200,
      "budget_window": "month",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "root_grant_id": mandateId }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
        "max_amount": 80,
        "budget_amount": 200,
        "budget_window": "month",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "root_grant_id": mandate_id
}).json()
data = httpx.get(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "run_01M8H7BG21Y821YA94W4FSE1A2",
      "object": "run",
      "name": null,
      "title": "Restock printer paper for the office",
      "outside_proposals": 0,
      "outside_briefs": 0,
      "latest_outside_proposal": null,
      "status": "active",
      "root_grant_id": "grt_01M8H7BG201VFBY2NWJK6BHYWH",
      "created_at": "2026-11-28T14:01:12.001Z",
      "halted_at": null,
      "halt_reason": null,
      "halted_by": null,
      "resumed_at": null,
      "ended_at": null,
      "members_count": 0,
      "waiting_on": null
    },
    {
      "id": "run_01M8H7BG1Y3R5FQTWA024X4BA3",
      "object": "run",
      "name": "Restock printer paper",
      "title": "Restock printer paper",
      "outside_proposals": 0,
      "outside_briefs": 0,
      "latest_outside_proposal": null,
      "status": "active",
      "root_grant_id": "grt_01M8H7BG1MRVJ80JPS9JF9R1KW",
      "created_at": "2026-11-28T14:01:11.998Z",
      "halted_at": null,
      "halt_reason": null,
      "halted_by": null,
      "resumed_at": null,
      "ended_at": null,
      "members_count": 0,
      "waiting_on": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## Pause a run

`POST /v1/mandate/runs/{id}/pause`

Halts the run: one run revocation, every mandate in it (and below) revoked, every member session locked. Every member's next verify is `run_halted`. Only a person resumes it. Free.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |
| `id` | path | string | yes | The run's ID. |
| `reason` | body | string | yes | Why you're halting it (on the ledger and the `mandate.run.halted` event). |

### Returns

The halted run, with how many mandates and sessions the halt stopped. See [the run detail object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`run_state_invalid`](https://provenanceauth.com/docs/platform/errors.md#run_state_invalid)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Restock printer paper" }' > step.json
export RUN_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/runs/$RUN_ID/pause" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "The paper subagent kept trying a store it wasn'\''t allowed to use"
  }'
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper" }),
})).json();
const runId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/pause`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "reason": "The paper subagent kept trying a store it wasn't allowed to use"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Restock printer paper"
}).json()
run_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/runs/{run_id}/pause", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "reason": "The paper subagent kept trying a store it wasn't allowed to use"
}).json()
```

### Response 200

```json
{
  "id": "run_01M6VQBCRFSNZJ52YP1ZVEDMVE",
  "object": "run",
  "name": "Restock printer paper",
  "status": "halted",
  "root_grant_id": null,
  "created_at": "2026-11-07T19:21:46.511Z",
  "halted_at": "2026-11-07T19:21:46.512Z",
  "halt_reason": "The paper subagent kept trying a store it wasn't allowed to use",
  "halted_by": "api_key:prv_test",
  "resumed_at": null,
  "ended_at": null,
  "members_count": 0,
  "waiting_on": null,
  "record": {
    "valid": true,
    "batches": 1,
    "signed": 0,
    "checkpoints": 1,
    "timeline": [
      {
        "seq": 1,
        "source": "server",
        "signed_by": null,
        "created_at": "2026-11-07T19:21:46.512Z",
        "spans": 1,
        "name": "provenance.run.halted"
      }
    ]
  },
  "members": [],
  "depth": 0,
  "escalations": [],
  "delegation_proposals": [],
  "guard": {
    "window_minutes": 10,
    "counters": {
      "denials": 0,
      "out_of_scope": 0,
      "fan_out": 0,
      "off_task": 0
    },
    "trips": [],
    "shadow_trips": {},
    "counters_shared": true
  },
  "grants_revoked": 0,
  "sessions_locked": 0
}
```

## Resume a halted run

`POST /v1/mandate/runs/{id}/resume`

Unlocks the run's sessions. Revoked mandates stay revoked. An owner or admin in the console only, never an API key; ledgered.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The run's ID. |

### Returns

The run, active again. See [the run detail object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`dashboard_session_required`](https://provenanceauth.com/docs/platform/errors.md#dashboard_session_required)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`run_state_invalid`](https://provenanceauth.com/docs/platform/errors.md#run_state_invalid)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/mandate/runs/run_01M69T2GJ4N8V5X7Y3Z6A1B2C3/resume" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/run_01M69T2GJ4N8V5X7Y3Z6A1B2C3/resume`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/runs/run_01M69T2GJ4N8V5X7Y3Z6A1B2C3/resume", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "run_01M69T2GJ4N8V5X7Y3Z6A1B2C3",
  "object": "run",
  "name": "Restock printer paper",
  "status": "active",
  "root_grant_id": null,
  "created_at": "2026-10-31T20:00:00.000Z",
  "halted_at": "2026-10-31T20:05:00.000Z",
  "halt_reason": "The paper subagent kept trying a store it wasn't allowed to use",
  "halted_by": "user:usr_01M69T2GJ4N8V5X7Y3Z6A1B2C4",
  "resumed_at": "2026-10-31T20:20:00.000Z",
  "ended_at": null,
  "members_count": 0,
  "waiting_on": null,
  "members": [],
  "depth": 0,
  "escalations": [],
  "delegation_proposals": [],
  "guard": {
    "window_minutes": 10,
    "counters": {
      "denials": 0,
      "out_of_scope": 0,
      "fan_out": 0,
      "off_task": 0
    },
    "trips": [],
    "shadow_trips": {},
    "counters_shared": true
  }
}
```

## End a run

`POST /v1/mandate/runs/{id}/end`

Ends the run so it takes no new members. Its mandates keep working until they expire or are revoked.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The run's ID. |

### Returns

The ended run. See [the run detail object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Restock printer paper" }' > step.json
export RUN_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/runs/$RUN_ID/end" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper" }),
})).json();
const runId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/end`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Restock printer paper"
}).json()
run_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/runs/{run_id}/end", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "run_01M6VQBCRJEWSZEX3F4679FQ89",
  "object": "run",
  "name": "Restock printer paper",
  "status": "ended",
  "root_grant_id": null,
  "created_at": "2026-11-07T19:21:46.514Z",
  "halted_at": null,
  "halt_reason": null,
  "halted_by": null,
  "resumed_at": null,
  "ended_at": "2026-11-07T19:21:46.514Z",
  "members_count": 0,
  "waiting_on": null,
  "record": {
    "valid": true,
    "batches": 0,
    "signed": 0,
    "checkpoints": 0,
    "timeline": []
  },
  "members": [],
  "depth": 0,
  "escalations": [],
  "delegation_proposals": [],
  "guard": {
    "window_minutes": 10,
    "counters": {
      "denials": 0,
      "out_of_scope": 0,
      "fan_out": 0,
      "off_task": 0
    },
    "trips": [],
    "shadow_trips": {},
    "counters_shared": true
  }
}
```

## Verify a run's record

`GET /v1/mandate/runs/{id}/record/verify`

Recomputes the record's chain, each signed batch's signature against the agent's registered key, and the checkpoints in the decision ledger. Free.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The run's ID. |

### Returns

The verification.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`run_record_not_configured`](https://provenanceauth.com/docs/platform/errors.md#run_record_not_configured)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Restock printer paper" }' > step.json
export RUN_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/runs/$RUN_ID/record" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "spans": [
      {
        "name": "search_prices",
        "kind": "client",
        "start_time": "2027-01-01T00:00:00.000Z",
        "end_time": "2027-01-01T00:00:01.000Z",
        "status": {
          "code": "ok"
        },
        "trace_id": null,
        "span_id": null,
        "parent_span_id": null,
        "attributes": {
          "tool.name": "search_prices"
        }
      }
    ]
  }' > /dev/null
curl "$PROVENANCE_API/v1/mandate/runs/$RUN_ID/record/verify" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper" }),
})).json();
const runId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/record`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "spans": [
      {
        "name": "search_prices",
        "kind": "client",
        "start_time": "2027-01-01T00:00:00.000Z",
        "end_time": "2027-01-01T00:00:01.000Z",
        "status": {
          "code": "ok"
        },
        "trace_id": null,
        "span_id": null,
        "parent_span_id": null,
        "attributes": {
          "tool.name": "search_prices"
        }
      }
    ]
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/record/verify`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Restock printer paper"
}).json()
run_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/runs/{run_id}/record", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "spans": [
        {
            "name": "search_prices",
            "kind": "client",
            "start_time": "2027-01-01T00:00:00.000Z",
            "end_time": "2027-01-01T00:00:01.000Z",
            "status": {
                "code": "ok"
            },
            "trace_id": None,
            "span_id": None,
            "parent_span_id": None,
            "attributes": {
                "tool.name": "search_prices"
            }
        }
    ]
}).json()
data = httpx.get(f"{api}/v1/mandate/runs/{run_id}/record/verify", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "run_record_verification",
  "run_id": "run_01M6VQBCRPNXMD1RNFS7NW64AB",
  "valid": true,
  "batches": 1,
  "signed": 0,
  "checkpoints": 0
}
```
