# Grants

Standing, bounded authority a person grants an agent.

Related guide: [Grants](https://provenanceauth.com/docs/mandate/concepts/grants.md)

## Endpoints

- `POST /v1/mandate/grants`: [Grant a mandate](#post-v1-mandate-grants)
- `POST /v1/mandate/grant_drafts`: [Create a mandate draft](#post-v1-mandate-grant-drafts)
- `POST /v1/mandate/trusted_agents`: [Add a trusted outside agent](#post-v1-mandate-trusted-agents)
- `POST /v1/mandate/device_enrollments`: [Create a device enrolment link](#post-v1-mandate-device-enrollments)
- `GET /v1/mandate/grants/{id}`: [Retrieve a mandate](#get-v1-mandate-grants-id)
- `GET /v1/mandate/grant_drafts/{id}`: [Get a mandate draft](#get-v1-mandate-grant-drafts-id)
- `GET /v1/mandate/delegation_proposals/{id}`: [Retrieve a delegation proposal](#get-v1-mandate-delegation-proposals-id)
- `GET /v1/mandate/external_handoffs/{id}`: [Retrieve an external hand-off](#get-v1-mandate-external-handoffs-id)
- `GET /v1/mandate/incoming_grants/{id}`: [Retrieve an incoming grant](#get-v1-mandate-incoming-grants-id)
- `GET /v1/mandate/device_enrollments/{id}`: [Get a device enrolment](#get-v1-mandate-device-enrollments-id)
- `GET /v1/mandate/grants/{id}/usual_spend`: [Get a person's usual spend](#get-v1-mandate-grants-id-usual-spend)
- `GET /v1/mandate/grants/{id}/heartbeat/challenge`: [Get the heartbeat challenge](#get-v1-mandate-grants-id-heartbeat-challenge)
- `GET /v1/mandate/settings/purpose_check`: [Get the purpose-check settings](#get-v1-mandate-settings-purpose-check)
- `GET /v1/mandate/settings/delegation`: [Get the over-limit settings](#get-v1-mandate-settings-delegation)
- `GET /v1/mandate/spend_summary`: [Get the spend summary](#get-v1-mandate-spend-summary)
- `GET /v1/mandate/settings/limits`: [Get the mandate limits](#get-v1-mandate-settings-limits)
- `GET /v1/mandate/settings/limits/versions/{version}`: [Get a mandate limits version](#get-v1-mandate-settings-limits-versions-version)
- `PUT /v1/mandate/holder_bindings/{agent_id}`: [Set an agent's holder binding](#put-v1-mandate-holder-bindings-agent-id)
- `PUT /v1/mandate/settings/purpose_check`: [Set the purpose-check settings](#put-v1-mandate-settings-purpose-check)
- `PUT /v1/mandate/settings/delegation`: [Set the over-limit settings](#put-v1-mandate-settings-delegation)
- `GET /v1/mandate/grants`: [List mandates](#get-v1-mandate-grants)
- `GET /v1/mandate/delegation_proposals`: [List delegation proposals](#get-v1-mandate-delegation-proposals)
- `GET /v1/mandate/incoming_grants`: [List incoming grants](#get-v1-mandate-incoming-grants)
- `GET /v1/mandate/trusted_agents`: [List the trusted outside agents](#get-v1-mandate-trusted-agents)
- `GET /v1/mandate/holder_bindings`: [List the holder-binding settings](#get-v1-mandate-holder-bindings)
- `GET /v1/mandate/device_enrollments`: [List device enrolments](#get-v1-mandate-device-enrollments)
- `GET /v1/mandate/grants/{id}/spend`: [List a mandate's spend](#get-v1-mandate-grants-id-spend)
- `GET /v1/mandate/settings/limits/versions`: [List the mandate limits' versions](#get-v1-mandate-settings-limits-versions)
- `DELETE /v1/mandate/trusted_agents/{id}`: [Remove a trusted outside agent](#delete-v1-mandate-trusted-agents-id)
- `POST /v1/mandate/grants/{id}/delegate`: [Delegate a mandate to a subagent](#post-v1-mandate-grants-id-delegate)
- `POST /v1/mandate/grants/{id}/ap2_open_mandates`: [Issue a grant as open AP2 mandates](#post-v1-mandate-grants-id-ap2-open-mandates)
- `POST /v1/mandate/grants/{id}/delegation_proposals`: [Propose a delegation structure](#post-v1-mandate-grants-id-delegation-proposals)
- `POST /v1/mandate/delegation_proposals/{id}/check`: [Check a delegation proposal](#post-v1-mandate-delegation-proposals-id-check)
- `POST /v1/mandate/delegation_proposals/{id}/approve`: [Approve a delegation proposal](#post-v1-mandate-delegation-proposals-id-approve)
- `POST /v1/mandate/delegation_proposals/{id}/decline`: [Decline a delegation proposal](#post-v1-mandate-delegation-proposals-id-decline)
- `DELETE /v1/mandate/holder_bindings/{agent_id}`: [Clear an agent's holder binding](#delete-v1-mandate-holder-bindings-agent-id)
- `POST /v1/mandate/device_enrollments/{id}/revoke`: [Revoke a device enrolment](#post-v1-mandate-device-enrollments-id-revoke)
- `POST /v1/mandate/grants/{id}/revoke`: [Revoke a mandate](#post-v1-mandate-grants-id-revoke)
- `POST /v1/mandate/grants/{id}/heartbeat`: [Check in a mandate heartbeat](#post-v1-mandate-grants-id-heartbeat)
- `GET /v1/public/grants/{id}/status`: [Check a mandate's status without a key](#get-v1-public-grants-id-status)
- `PUT /v1/mandate/settings/limits`: [Save the mandate limits](#put-v1-mandate-settings-limits)
- `POST /v1/mandate/settings/limits/versions/{version}/publish`: [Publish a mandate limits draft](#post-v1-mandate-settings-limits-versions-version-publish)

## The policy version object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | enum | yes | The type of object. One of `policy_version`. |
| `policy_id` | string | no | The policy's ID (`pol_…`), the same on every version of it. |
| `domain` | string | yes | The policy domain. |
| `version` | integer | yes | The version number. |
| `active` | boolean | yes | Whether this version is the active policy. |
| `note` | string \| null | no | A note for the record. |
| `created_at` | string | no | When it was created. |
| `created_by` | string \| null | no | Who saved the version. |
| `document` | object | no | The policy document as saved, with Provenance's rule IDs. |
| `shadow` | boolean | no | The shadow settings. |
| `draft` | boolean | no | Present and true on a draft saved with POST .../versions that has not gone live. |
| `trial_ends_at` | timestamp | no | Present while the version is on a trial run, with when the trial run ends. |
| `restored_from` | integer | no | On a restore, the version it copies. |
| `promoted_from_trial` | boolean | no | Present and true when the version went live from its trial run. |
| `source` | enum | no | Where the version was written: the console, the API, or a rules embed session (`<provenance-rules>`). Present on versions written since 2026-11-17. One of `console`, `api`, `embed`. |
| `embed_session` | string | no | On a version saved by a rules embed session, that session's id (the embed token's `id`, never the token). `created_by` names the API key or console member that minted the session. |
| `draft_group` | string | no | Sandbox. The draft group a rules embed session saved this draft in (`rules.draft_group`). It stays once the draft is published. Listed only with `?draft_group=` naming the group while the draft waits. |
| `key_last4` | string | no | In the version list, on a version written through the API or a rules embed session, the last four characters of the account's API key that wrote it (or minted the session). Absent when `created_by` is a console member. |
| `warnings` | array of objects | no | Checkout rules only, present when a rule never runs (`shadowed_by`). The version is saved either way. |
| `warnings.type` | enum | yes | Always `shadowed_by`. One of `shadowed_by`. |
| `warnings.rule_id` | string | yes | The rule that never runs. |
| `warnings.shadowed_by` | string | yes | The rule above it that always decides first. |
| `warnings.message` | string | yes | The warning in words ("This rule never runs: 'No mandate or approval' decides first"). |

### Example

```json
{
  "object": "policy_version",
  "policy_id": "pol_01M7PS9D7T0DB5ZT9JAA5FQT87",
  "domain": "mandate_limits",
  "version": 1,
  "active": true,
  "note": null,
  "created_by": "k-9b7ea63bc5b2",
  "created_at": "2026-11-18T13:20:00.000Z",
  "source": "api",
  "document": {
    "cap": {
      "enabled": true,
      "amount": 2400,
      "currency": "USD"
    },
    "budget": {
      "allocation": "shared",
      "at_limit": "ask"
    },
    "allowed_mcc": {
      "enabled": true,
      "action": "refuse",
      "mcc": [
        {
          "from": "3501",
          "to": "3999",
          "name": "Lodging",
          "group": "lodging"
        },
        {
          "from": "7011",
          "to": "7011",
          "name": "Lodging",
          "group": "lodging"
        }
      ]
    },
    "named_merchants": {
      "enabled": false,
      "action": "refuse",
      "merchants": []
    },
    "blocked_mcc": {
      "enabled": false,
      "mcc": []
    },
    "blocked_merchants": {
      "enabled": false,
      "merchants": []
    },
    "refuse_over_cap": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    },
    "ask_over_cap": {
      "enabled": true
    },
    "refuse_over_share": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    }
  }
}
```

## Events

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

- `mandate.grant.heartbeat_lapsed`
- `mandate.grant.revoked`
- `mandate.grant.over_limit_approved`
- `mandate.grant.mcc_mismatched`
- `mandate.delegation_proposal.decided`
- `mandate.incoming_grant.received`
- `mandate.incoming_grant.revoked`

## Grant a mandate

`POST /v1/mandate/grants`

Grants an agent standing, bounded authority: a per-action limit, a budget per window, allowed action types and counterparties, and an expiry. Returns the signed mandate_token the agent passes to authorize.

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). |
| `device_id` | body | string | yes | The capture or approving device's ID. |
| `agent_session_id` | body | string | no | The agent session the token was minted for. |
| `constraints` | body | object | yes | Bounded standing-authority constraints, validated at grant. |
| `constraints.max_amount` | body | number \| null | no | Per-action cap. |
| `constraints.budget_amount` | body | number \| null | no | Cumulative cap per window. |
| `constraints.budget_window` | body | enum | no | The budget's window: `day`, `week` or `month`, in UTC. One of `day`, `week`, `month`. |
| `constraints.allowed_action_types` | body | array of strings | no | Empty ⇒ any action type. Matched against context.action_type at verify. |
| `constraints.allowed_counterparties` | body | array of strings \| null | no | null ⇒ any counterparty. Matched against context.counterparty at verify. |
| `constraints.schedule` | body | object \| null | no | A standing schedule. The human authorizes a recurrence once; the agent executes ONE action per cycle inside a grace window. We authorize, we NEVER move money. Verify denials: schedule_counterparty_mismatch, schedule_amount_exceeded, schedule_window_missed, schedule_already_executed, schedule_occurrences_exhausted. UTC only (caller maps local time). |
| `constraints.schedule.cadence` | body | enum | yes | How often the scheduled payment runs: `weekly`, `monthly` or `quarterly`. One of `weekly`, `monthly`, `quarterly`. |
| `constraints.schedule.day` | body | integer | no | day-of-month (monthly/quarterly) or ISO weekday 1-7 (weekly). |
| `constraints.schedule.amount_fixed` | body | number \| null | no | Exact required amount (XOR amount_max). |
| `constraints.schedule.amount_max` | body | number \| null | no | Max allowed amount (XOR amount_fixed). |
| `constraints.schedule.counterparty` | body | string | yes | The required counterparty. |
| `constraints.schedule.occurrences` | body | integer \| null | no | Total executions allowed (null ⇒ until expiry). |
| `constraints.schedule.grace_window_hours` | body | integer | no | Hours after the scheduled instant an execution is valid (default 48). |
| `constraints.heartbeat` | body | object | no | The check-in: the grant stays valid only while its person checks in with their passkey each period; a missed check-in pauses it. Present only when set. |
| `constraints.heartbeat.interval` | body | enum | yes | How often the person checks in: `weekly`, `biweekly` or `monthly` (UTC periods). One of `weekly`, `biweekly`, `monthly`. |
| `constraints.heartbeat.grace_hours` | body | integer | no | Hours into a period before a missing check-in pauses the grant (default 72). |
| `constraints.currency` | body | string | no | The ISO 4217 code the grant's amounts are in (stored upper-case). Present only when set. An amount in another currency isn't covered (`grant_currency_mismatch`): verify needs `context.currency` to match, a store's cart must be in it. A child inherits it and can't change it. Not carried in the mandate token. |
| `constraints.max_uses` | body | integer | no | Purchases allowed over the grant's whole life (1 = single use). Each verify pass and each cart the grant covers at a store is one. A spent grant refuses (`grant_uses_exhausted`). Counts for every grant below it. Present only when set; not carried in the token. |
| `constraints.max_purchases` | body | integer | no | Purchases allowed per `purchase_window` (`grant_purchase_limit_reached` past it). Needs `purchase_window`. Present only when set; not carried in the token. |
| `constraints.purchase_window` | body | enum | no | The window `max_purchases` is counted over: `day`, `week` or `month` in UTC, or `lifetime` (the whole grant). Independent of the budget window. One of `day`, `week`, `month`, `lifetime`. |
| `constraints.over_limit` | body | object | no | What each lock does when a purchase at a store goes past it (ask a person or refuse; the amount and budget locks ask up to a margin, a percentage of the limit). A lock left out follows the grant above it, then the account's settings, then the defaults. On a delegation each lock given can only be stricter than the parent's. Present only when set; not carried in the token. |
| `constraints.over_limit.amount` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.amount.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.amount.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.amount.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.amount.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.budget` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.budget.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.budget.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.budget.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.budget.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.dates` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.dates.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.dates.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.dates.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.dates.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.category` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.category.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.category.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.category.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.category.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.counterparty` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.counterparty.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.counterparty.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.counterparty.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.counterparty.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.currency` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.currency.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.currency.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.currency.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.currency.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.block` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.block.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.block.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.block.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.block.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.uses` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.uses.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.uses.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.uses.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.uses.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.purchases` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.purchases.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.purchases.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.purchases.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.purchases.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.country` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.country.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.country.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.country.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.country.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.allowed_mcc` | body | array of objects | no | Kinds of merchant allowed, by merchant category code (MCC): each entry a group by name (`{ "group": "lodging" }`) or a range (`{ "from": "3000", "to": "3299" }`, `to` left out for one code). A group is stored as its ranges with its name. Checked against the MCC the merchant declares with the cart (`merchant.mcc`) or in verify's `context.mcc`; a cart with no MCC isn't covered. A miss follows the `category` lock (ask by default). Groups: `airlines`, `lodging`, `car_rental`, `rail`, `grocery`, `office_supplies`, `software`, `gambling`, `cash_like`, `money_transfer`. On a delegation each range sits inside the parent's. Present only when set; not carried in the token. |
| `constraints.allowed_mcc.group` | body | string | no | A group by name when sending (`lodging`); stored on each of its ranges. |
| `constraints.allowed_mcc.from` | body | string | no | The first MCC in the range. |
| `constraints.allowed_mcc.to` | body | string | no | The last MCC in the range (the same as `from` for one code). |
| `constraints.allowed_mcc.name` | body | string | no | The plain name ("Lodging"). |
| `constraints.blocked_mcc` | body | array of objects | no | MCC ranges refused, in the same form as `allowed_mcc`. A block wins over every allow list. A hit follows the `block` lock (refuse by default); a cart with no MCC follows the `category` lock. A child's list is its parent's with its own additions. Present only when set; not carried in the token. |
| `constraints.blocked_mcc.group` | body | string | no | A group by name when sending (`lodging`); stored on each of its ranges. |
| `constraints.blocked_mcc.from` | body | string | no | The first MCC in the range. |
| `constraints.blocked_mcc.to` | body | string | no | The last MCC in the range (the same as `from` for one code). |
| `constraints.blocked_mcc.name` | body | string | no | The plain name ("Lodging"). |
| `constraints.blocked_counterparties` | body | array of strings | no | Merchants refused, matched as `allowed_counterparties` is (a cart's `merchant_id` or `origin`, verify's `context.counterparty`). A hit follows the `block` lock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token. |
| `constraints.allowed_countries` | body | array of string \| objects | no | Merchant countries allowed, given as alpha-2 (`"PT"`) or ISO 3166-1 numeric (`"620"`) codes and stored as `{ code, alpha2 }`. Checked against the country the merchant declares (`merchant.country`, verify's `context.merchant_country`); a cart with no country isn't covered. A miss follows the `country` lock (ask by default). On a delegation each country is one of the parent's. Present only when set; not carried in the token. |
| `constraints.allowed_countries.code` | body | string | no | The ISO 3166-1 numeric code (`620`). |
| `constraints.allowed_countries.alpha2` | body | string | no | The alpha-2 code (`PT`), for display. |
| `constraints.blocked_countries` | body | array of string \| objects | no | Merchant countries refused, in the same form as `allowed_countries`. A hit follows the `block` lock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token. |
| `constraints.blocked_countries.code` | body | string | no | The ISO 3166-1 numeric code (`620`). |
| `constraints.blocked_countries.alpha2` | body | string | no | The alpha-2 code (`PT`), for display. |
| `constraints.service_window` | body | object | no | The dates of what is bought, separate from `expires_at` (when the agent may act). Two calendar dates, both included; for lodging `to` is the check-out date. Every cart line's `service_period` (verify's `context.service_start` and `context.service_end`) must sit inside it, compared as calendar dates in their own offset; a cart with no dates isn't covered. A miss follows the `dates` lock (ask by default). On a delegation it sits inside the parent's. Present only when set; not carried in the token. |
| `constraints.service_window.from` | body | string | yes | The first date (`2027-03-12`). |
| `constraints.service_window.to` | body | string | yes | The last date, on or after `from` (`2027-03-16`). |
| `constraints.expires_at` | body | timestamp | yes | The grant's hard expiry. |
| `biometric_challenge` | body | string | no | The challenge from `POST /v1/mandate/biometric_challenges` the assertion signs. |
| `biometric_assertion` | body | object | no | The passkey assertion over the challenge. |
| `purpose` | body | string | no | What the mandate is for, in plain text ("Restock printer paper for the office"). The person sees it with the limits, and every subagent's approval names it. Optional here for older clients; the console requires it. |
| `agent_id` | body | string | no | The registered agent that holds the mandate. Its name appears in the chain subagents carry. |
| `max_depth` | body | integer | no | How many levels below this mandate subagents may delegate (default 4; 0 = no delegation). |
| `holder_key` | body | object | no | Bind the grant to its holder: the holder's P-256 public key as a JWK (`kty` `EC`, `crv` `P-256`, `x`, `y`; never `d`). Only its RFC 7638 thumbprint is kept (`holder_jkt`), and the token carries it as `cnf.jkt`. Every use then needs a DPoP proof from that key (the `DPoP` header). Leave it out for a bearer grant. Free on every plan. |
| `holder_key.kty` | body | enum | yes | The key type. One of `EC`. |
| `holder_key.crv` | body | enum | yes | The curve. One of `P-256`. |
| `holder_key.x` | body | string | yes | The x coordinate, base64url (32 bytes). |
| `holder_key.y` | body | string | yes | The y coordinate, base64url (32 bytes). |

### Returns

The mandate, with its token. The token is shown only once.

### 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)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`usage_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#usage_limit_reached)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "agent_session_id": "sess_buyer_1",
    "purpose": "Pay Brindlecote Supplies invoices this year",
    "constraints": {
      "max_amount": 400,
      "budget_amount": 500,
      "budget_window": "day",
      "allowed_action_types": [
        "payment"
      ],
      "allowed_counterparties": [
        "acct_brindlecote_supplies"
      ],
      "expires_at": "2027-12-31T23:59:59Z"
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
  }'
```

**Node**

```ts
const data = 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",
    "agent_session_id": "sess_buyer_1",
    "purpose": "Pay Brindlecote Supplies invoices this year",
    "constraints": {
      "max_amount": 400,
      "budget_amount": 500,
      "budget_window": "day",
      "allowed_action_types": [
        "payment"
      ],
      "allowed_counterparties": [
        "acct_brindlecote_supplies"
      ],
      "expires_at": "2027-12-31T23:59:59Z"
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "agent_session_id": "sess_buyer_1",
    "purpose": "Pay Brindlecote Supplies invoices this year",
    "constraints": {
        "max_amount": 400,
        "budget_amount": 500,
        "budget_window": "day",
        "allowed_action_types": [
            "payment"
        ],
        "allowed_counterparties": [
            "acct_brindlecote_supplies"
        ],
        "expires_at": "2027-12-31T23:59:59Z"
    },
    "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
}).json()
```

### Response 201

```json
{
  "id": "grt_01M7Y6X1GYPRMR7PN7XHQV3PRE",
  "object": "grant",
  "status": "active",
  "device_id": "dev_00000000000000000000000000000001",
  "agent_session_id": "sess_buyer_1",
  "constraints": {
    "max_amount": 400,
    "budget_amount": 500,
    "budget_window": "day",
    "allowed_action_types": [
      "payment"
    ],
    "allowed_counterparties": [
      "acct_brindlecote_supplies"
    ],
    "schedule": null,
    "expires_at": "2027-12-31T23:59:59Z"
  },
  "approval_context": null,
  "remaining_budget": 500,
  "created_at": "2026-11-21T04:47:44.158Z",
  "expires_at": "2027-12-31T23:59:59Z",
  "purpose": "Pay Brindlecote Supplies invoices this year",
  "holder_jkt": "TS6dSfKQ3OPDHsfzCtUI-gHg4U_s75NEg0BFVXNDS4k",
  "mandate_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0Iiwia2lkIjoiZDM1ZmE0N2E2ZWExNmE2ZCJ9.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsImp0aSI6ImdydF8wMU03WTZYMUdZUFJNUjdQTjdYSFFWM1BSRSIsInN1YiI6ImFub25feHpobjRwNWxqc25wNWp4bWNidWFnazd3aDQiLCJpYXQiOjE3OTUyMzY0NjQsImV4cCI6MTgzMDI5NzU5OSwibWFuZGF0ZSI6dHJ1ZSwiY29uc3RyYWludHMiOnsibWF4X2Ftb3VudCI6NDAwLCJidWRnZXRfYW1vdW50Ijo1MDAsImJ1ZGdldF93aW5kb3ciOiJkYXkiLCJhbGxvd2VkX2FjdGlvbl90eXBlcyI6WyJwYXltZW50Il0sImFsbG93ZWRfY291bnRlcnBhcnRpZXMiOlsiYWNjdF9icmluZGxlY290ZV9zdXBwbGllcyJdLCJzY2hlZHVsZSI6bnVsbCwiZXhwaXJlc19hdCI6IjIwMjctMTItMzFUMjM6NTk6NTlaIn0sInJpc2siOnsic2NvcmUiOjMwLCJhY3Rpb24iOiJhbGxvdyJ9LCJwdXJwb3NlX2hhc2giOiJkNWUyMWFhNjI1NzQ1Yjg3NjUzMjNjM2I4ZmI0OGZhZmZiYWNiNDlmMjE0OGJlODAzNGNhYjEwZjcyMjg4Nzc5IiwiY25mIjp7ImprdCI6IlRTNmRTZktRM09QREhzZnpDdFVJLWdIZzRVX3M3NU5FZzBCRlZYTkRTNGsifX0.LD3-n6Xg3MDdZSKH0EuI68jV6Ez75oBpffoTbCzHIMnDOoWaWjfhcqx0aeSg8cDpFBEWC0syTtDoUG-LuugBxQ"
}
```

## Create a mandate draft

`POST /v1/mandate/grant_drafts`

Proposes a mandate for one device, shown to the person in `<provenance-grant>`. A draft lasts up to 15 minutes and creates nothing until the person allows it with their passkey; Allow grants exactly the mandate `POST /v1/mandate/grants` would, with an `approval_context` that records how.

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). |
| `device_id` | body | string | yes | The device whose passkey allows the mandate. |
| `agent` | body | object | yes | Who the person is allowing. Display only. |
| `agent.name` | body | string | yes | The agent's name, as the person knows it. |
| `agent.id` | body | string | no | A registry agent (`agt_…`). When another account made it, the component shows its avatar. |
| `agent.description` | body | string | no | One line under the name. |
| `constraints` | body | object | yes | Bounded standing-authority constraints, validated at grant. |
| `constraints.max_amount` | body | number \| null | no | Per-action cap. |
| `constraints.budget_amount` | body | number \| null | no | Cumulative cap per window. |
| `constraints.budget_window` | body | enum | no | The budget's window: `day`, `week` or `month`, in UTC. One of `day`, `week`, `month`. |
| `constraints.allowed_action_types` | body | array of strings | no | Empty ⇒ any action type. Matched against context.action_type at verify. |
| `constraints.allowed_counterparties` | body | array of strings \| null | no | null ⇒ any counterparty. Matched against context.counterparty at verify. |
| `constraints.schedule` | body | object \| null | no | A standing schedule. The human authorizes a recurrence once; the agent executes ONE action per cycle inside a grace window. We authorize, we NEVER move money. Verify denials: schedule_counterparty_mismatch, schedule_amount_exceeded, schedule_window_missed, schedule_already_executed, schedule_occurrences_exhausted. UTC only (caller maps local time). |
| `constraints.schedule.cadence` | body | enum | yes | How often the scheduled payment runs: `weekly`, `monthly` or `quarterly`. One of `weekly`, `monthly`, `quarterly`. |
| `constraints.schedule.day` | body | integer | no | day-of-month (monthly/quarterly) or ISO weekday 1-7 (weekly). |
| `constraints.schedule.amount_fixed` | body | number \| null | no | Exact required amount (XOR amount_max). |
| `constraints.schedule.amount_max` | body | number \| null | no | Max allowed amount (XOR amount_fixed). |
| `constraints.schedule.counterparty` | body | string | yes | The required counterparty. |
| `constraints.schedule.occurrences` | body | integer \| null | no | Total executions allowed (null ⇒ until expiry). |
| `constraints.schedule.grace_window_hours` | body | integer | no | Hours after the scheduled instant an execution is valid (default 48). |
| `constraints.heartbeat` | body | object | no | The check-in: the grant stays valid only while its person checks in with their passkey each period; a missed check-in pauses it. Present only when set. |
| `constraints.heartbeat.interval` | body | enum | yes | How often the person checks in: `weekly`, `biweekly` or `monthly` (UTC periods). One of `weekly`, `biweekly`, `monthly`. |
| `constraints.heartbeat.grace_hours` | body | integer | no | Hours into a period before a missing check-in pauses the grant (default 72). |
| `constraints.currency` | body | string | no | The ISO 4217 code the grant's amounts are in (stored upper-case). Present only when set. An amount in another currency isn't covered (`grant_currency_mismatch`): verify needs `context.currency` to match, a store's cart must be in it. A child inherits it and can't change it. Not carried in the mandate token. |
| `constraints.max_uses` | body | integer | no | Purchases allowed over the grant's whole life (1 = single use). Each verify pass and each cart the grant covers at a store is one. A spent grant refuses (`grant_uses_exhausted`). Counts for every grant below it. Present only when set; not carried in the token. |
| `constraints.max_purchases` | body | integer | no | Purchases allowed per `purchase_window` (`grant_purchase_limit_reached` past it). Needs `purchase_window`. Present only when set; not carried in the token. |
| `constraints.purchase_window` | body | enum | no | The window `max_purchases` is counted over: `day`, `week` or `month` in UTC, or `lifetime` (the whole grant). Independent of the budget window. One of `day`, `week`, `month`, `lifetime`. |
| `constraints.over_limit` | body | object | no | What each lock does when a purchase at a store goes past it (ask a person or refuse; the amount and budget locks ask up to a margin, a percentage of the limit). A lock left out follows the grant above it, then the account's settings, then the defaults. On a delegation each lock given can only be stricter than the parent's. Present only when set; not carried in the token. |
| `constraints.over_limit.amount` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.amount.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.amount.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.amount.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.amount.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.budget` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.budget.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.budget.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.budget.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.budget.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.dates` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.dates.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.dates.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.dates.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.dates.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.category` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.category.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.category.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.category.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.category.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.counterparty` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.counterparty.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.counterparty.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.counterparty.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.counterparty.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.currency` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.currency.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.currency.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.currency.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.currency.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.block` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.block.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.block.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.block.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.block.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.uses` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.uses.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.uses.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.uses.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.uses.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.purchases` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.purchases.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.purchases.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.purchases.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.purchases.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.over_limit.country` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `constraints.over_limit.country.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `constraints.over_limit.country.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `constraints.over_limit.country.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `constraints.over_limit.country.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `constraints.allowed_mcc` | body | array of objects | no | Kinds of merchant allowed, by merchant category code (MCC): each entry a group by name (`{ "group": "lodging" }`) or a range (`{ "from": "3000", "to": "3299" }`, `to` left out for one code). A group is stored as its ranges with its name. Checked against the MCC the merchant declares with the cart (`merchant.mcc`) or in verify's `context.mcc`; a cart with no MCC isn't covered. A miss follows the `category` lock (ask by default). Groups: `airlines`, `lodging`, `car_rental`, `rail`, `grocery`, `office_supplies`, `software`, `gambling`, `cash_like`, `money_transfer`. On a delegation each range sits inside the parent's. Present only when set; not carried in the token. |
| `constraints.allowed_mcc.group` | body | string | no | A group by name when sending (`lodging`); stored on each of its ranges. |
| `constraints.allowed_mcc.from` | body | string | no | The first MCC in the range. |
| `constraints.allowed_mcc.to` | body | string | no | The last MCC in the range (the same as `from` for one code). |
| `constraints.allowed_mcc.name` | body | string | no | The plain name ("Lodging"). |
| `constraints.blocked_mcc` | body | array of objects | no | MCC ranges refused, in the same form as `allowed_mcc`. A block wins over every allow list. A hit follows the `block` lock (refuse by default); a cart with no MCC follows the `category` lock. A child's list is its parent's with its own additions. Present only when set; not carried in the token. |
| `constraints.blocked_mcc.group` | body | string | no | A group by name when sending (`lodging`); stored on each of its ranges. |
| `constraints.blocked_mcc.from` | body | string | no | The first MCC in the range. |
| `constraints.blocked_mcc.to` | body | string | no | The last MCC in the range (the same as `from` for one code). |
| `constraints.blocked_mcc.name` | body | string | no | The plain name ("Lodging"). |
| `constraints.blocked_counterparties` | body | array of strings | no | Merchants refused, matched as `allowed_counterparties` is (a cart's `merchant_id` or `origin`, verify's `context.counterparty`). A hit follows the `block` lock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token. |
| `constraints.allowed_countries` | body | array of string \| objects | no | Merchant countries allowed, given as alpha-2 (`"PT"`) or ISO 3166-1 numeric (`"620"`) codes and stored as `{ code, alpha2 }`. Checked against the country the merchant declares (`merchant.country`, verify's `context.merchant_country`); a cart with no country isn't covered. A miss follows the `country` lock (ask by default). On a delegation each country is one of the parent's. Present only when set; not carried in the token. |
| `constraints.allowed_countries.code` | body | string | no | The ISO 3166-1 numeric code (`620`). |
| `constraints.allowed_countries.alpha2` | body | string | no | The alpha-2 code (`PT`), for display. |
| `constraints.blocked_countries` | body | array of string \| objects | no | Merchant countries refused, in the same form as `allowed_countries`. A hit follows the `block` lock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token. |
| `constraints.blocked_countries.code` | body | string | no | The ISO 3166-1 numeric code (`620`). |
| `constraints.blocked_countries.alpha2` | body | string | no | The alpha-2 code (`PT`), for display. |
| `constraints.service_window` | body | object | no | The dates of what is bought, separate from `expires_at` (when the agent may act). Two calendar dates, both included; for lodging `to` is the check-out date. Every cart line's `service_period` (verify's `context.service_start` and `context.service_end`) must sit inside it, compared as calendar dates in their own offset; a cart with no dates isn't covered. A miss follows the `dates` lock (ask by default). On a delegation it sits inside the parent's. Present only when set; not carried in the token. |
| `constraints.service_window.from` | body | string | yes | The first date (`2027-03-12`). |
| `constraints.service_window.to` | body | string | yes | The last date, on or after `from` (`2027-03-16`). |
| `constraints.expires_at` | body | timestamp | yes | The grant's hard expiry. |
| `agent_session_id` | body | string | no | The agent session the mandate is bound to. |
| `currency` | body | string | no | How the amounts read (ISO 4217, default `USD`). Display only. |
| `expires_in` | body | integer | no | Seconds the draft stays open (default 900). |

### Returns

The draft, pending.

### 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)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`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 POST "$PROVENANCE_API/v1/mandate/grant_drafts" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "agent": {
      "name": "Cartwise",
      "description": "Cartwise Labs · your shopping assistant"
    },
    "constraints": {
      "max_amount": 50,
      "budget_amount": 200,
      "budget_window": "month",
      "allowed_counterparties": [
        "quillstack.example"
      ],
      "heartbeat": {
        "interval": "monthly",
        "grace_hours": 72
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grant_drafts`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "agent": {
      "name": "Cartwise",
      "description": "Cartwise Labs · your shopping assistant"
    },
    "constraints": {
      "max_amount": 50,
      "budget_amount": 200,
      "budget_window": "month",
      "allowed_counterparties": [
        "quillstack.example"
      ],
      "heartbeat": {
        "interval": "monthly",
        "grace_hours": 72
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/grant_drafts", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "agent": {
        "name": "Cartwise",
        "description": "Cartwise Labs · your shopping assistant"
    },
    "constraints": {
        "max_amount": 50,
        "budget_amount": 200,
        "budget_window": "month",
        "allowed_counterparties": [
            "quillstack.example"
        ],
        "heartbeat": {
            "interval": "monthly",
            "grace_hours": 72
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
```

### Response 201

```json
{
  "id": "gdr_01M7P1E26VW3BGXS0KP9V1V687",
  "object": "grant_draft",
  "status": "pending",
  "device_id": "dev_00000000000000000000000000000001",
  "agent": {
    "name": "Cartwise",
    "id": null,
    "description": "Cartwise Labs · your shopping assistant"
  },
  "agent_session_id": null,
  "constraints": {
    "max_amount": 50,
    "budget_amount": 200,
    "budget_window": "month",
    "allowed_action_types": [],
    "allowed_counterparties": [
      "quillstack.example"
    ],
    "schedule": null,
    "heartbeat": {
      "interval": "monthly",
      "grace_hours": 72
    },
    "expires_at": "2027-12-31T23:59:59Z"
  },
  "currency": "USD",
  "limits": [
    {
      "kind": "per_order",
      "text": "Up to $50.00 an order"
    },
    {
      "kind": "budget",
      "text": "Up to $200.00 a month"
    },
    {
      "kind": "counterparties",
      "text": "Only at quillstack.example"
    },
    {
      "kind": "checkin",
      "text": "Check in every month"
    },
    {
      "kind": "expires",
      "text": "Until Dec 31, 2027"
    }
  ],
  "grant_id": null,
  "created_at": "2026-11-18T00:38:15.003Z",
  "expires_at": "2026-11-18T00:53:15.003Z",
  "decided_at": null
}
```

## Add a trusted outside agent

`POST /v1/mandate/trusted_agents`

Adds an agent to the company's list: one registered in another account (`provenance_agent`), or one named by its public key, name and https origin (`key`). `max_amount` and `budget_amount` bound what skips the ask; a hand-off over a cap, or without one where the entry sets it, is asked. Needs an admin key or an owner or admin session.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `receiver` | body | object | yes | `provenance_agent` with `agent_id`, or `key` with `name`, `origin` and `holder_key`. |
| `receiver.kind` | body | enum | yes | How the agent is named. One of `provenance_agent`, `key`. |
| `receiver.agent_id` | body | string | no | An agent registered in another account. |
| `receiver.name` | body | string | no | The agent's name (up to 100 characters). |
| `receiver.origin` | body | string | no | The agent's https origin, such as `https://seats.skydesk.example`. |
| `receiver.holder_key` | body | object | no | The agent's P-256 public key (JWK). |
| `max_amount` | body | number | no | The highest per-order cap that skips the ask. |
| `budget_amount` | body | number | no | The highest budget that skips the ask. |

### Returns

The trusted agent.

### 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)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`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 POST "$PROVENANCE_API/v1/mandate/trusted_agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "receiver": {
      "kind": "key",
      "name": "SkyDesk Seats",
      "origin": "https://seats.skydesk.example",
      "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
      }
    },
    "max_amount": 600
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/trusted_agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "receiver": {
      "kind": "key",
      "name": "SkyDesk Seats",
      "origin": "https://seats.skydesk.example",
      "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
      }
    },
    "max_amount": 600
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/trusted_agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "receiver": {
        "kind": "key",
        "name": "SkyDesk Seats",
        "origin": "https://seats.skydesk.example",
        "holder_key": {
            "kty": "EC",
            "crv": "P-256",
            "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
            "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
        }
    },
    "max_amount": 600
}).json()
```

### Response 201

```json
{
  "object": "trusted_agent",
  "id": "tra_01M7Z8C2D4F6H8J0K2M4N6P8Q0",
  "owner": "account",
  "receiver": {
    "kind": "key",
    "name": "SkyDesk Seats",
    "origin": "https://seats.skydesk.example",
    "holder_jkt": "2pn4Kxw1bCq8m7Zf0vYH3eR5tU9sL6aJ1dG4hN2pQ0c"
  },
  "max_amount": 600,
  "budget_amount": null,
  "created_at": "2026-11-21T14:18:42.530Z"
}
```

## Create a device enrolment link

`POST /v1/mandate/device_enrollments`

A link for one person to enrol their phone with a passkey, to name that phone on their grant. Show `enroll_url` as a QR code or text `short_url`; once the person makes a passkey on Provenance's page, `get` returns `device_id`. One use, 15 minutes unless `expires_in` says otherwise. Free on every plan.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `display_name` | body | string | yes | The name the page and the passkey show for the person. |
| `reference` | body | string | no | Your own reference (a customer or session ID), for `list`. Never shown on the page. |
| `expires_in` | body | integer | no | Seconds the link works (900 by default). |

### Returns

The enrolment, with its link (shown once).

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/mandate/device_enrollments" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "display_name": "Maya", "reference": "ds_session_1" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "display_name": "Maya", "reference": "ds_session_1" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/device_enrollments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "display_name": "Maya",
    "reference": "ds_session_1"
}).json()
```

### Response 201

```json
{
  "object": "device_enrollment",
  "id": "denr_01M7QKCV60DMW0CCSQHJDEB2TK",
  "status": "pending",
  "display_name": "Maya",
  "reference": "ds_session_1",
  "device_id": null,
  "created_at": "2026-11-18T15:11:23.840Z",
  "expires_at": "2026-11-18T15:26:23.840Z",
  "enrolled_at": null,
  "revoked_at": null,
  "enroll_url": "http://localhost:5173/enrol/d/denr_01M7QKCV60DMW0CCSQHJDEB2TK?t=denl_tXwRv1w9QG6ahh7fW099ry8776Sz4oJVRWbab5YJEHE",
  "short_url": null
}
```

## Retrieve a mandate

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

Returns a mandate with its constraints, status, the budget left in the current window and each lock's over-limit rows (what is allowed, asked about and refused).

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

### Parameters

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

### Returns

The mandate.

### 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)
- [`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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID" \
  -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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}`, {
  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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
        "max_amount": 400,
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step1["id"]
data = httpx.get(f"{api}/v1/mandate/grants/{mandate_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "grt_01M8CPXW0HBSYRKYYN47C3FRWS",
  "object": "grant",
  "status": "active",
  "device_id": "dev_00000000000000000000000000000001",
  "agent_session_id": "sess_buyer_1",
  "constraints": {
    "max_amount": 400,
    "budget_amount": null,
    "budget_window": null,
    "allowed_action_types": [],
    "allowed_counterparties": null,
    "schedule": null,
    "expires_at": "2027-12-31T23:59:59Z"
  },
  "approval_context": null,
  "remaining_budget": null,
  "created_at": "2026-11-26T19:57:10.545Z",
  "expires_at": "2027-12-31T23:59:59Z",
  "over_limit_rows": [
    {
      "lock": "amount",
      "action": "ask",
      "limit": 400,
      "allow_up_to": 400,
      "ask_up_to": 480,
      "refuse_past": 480
    }
  ]
}
```

## Get a mandate draft

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

Returns a draft and its status. Once the person allows it, `grant_id` names the mandate and `mandate_token` carries the signed token for your agent; this response is the only place the token appears.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The draft's ID (`mdr_…`). |

### Returns

The draft.

### 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/grant_drafts" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "agent": {
      "name": "Cartwise"
    },
    "constraints": {
      "max_amount": 50,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export DRAFT_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/grant_drafts/$DRAFT_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grant_drafts`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "agent": {
      "name": "Cartwise"
    },
    "constraints": {
      "max_amount": 50,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const draftId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grant_drafts/${draftId}`, {
  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/grant_drafts", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "agent": {
        "name": "Cartwise"
    },
    "constraints": {
        "max_amount": 50,
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
draft_id = step1["id"]
data = httpx.get(f"{api}/v1/mandate/grant_drafts/{draft_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "gdr_01M6VQDE9DFAWPPZYWWRE5HP4T",
  "object": "grant_draft",
  "status": "pending",
  "device_id": "dev_00000000000000000000000000000001",
  "agent": {
    "name": "Cartwise",
    "id": null,
    "description": null
  },
  "agent_session_id": null,
  "constraints": {
    "max_amount": 50,
    "budget_amount": null,
    "budget_window": null,
    "allowed_action_types": [],
    "allowed_counterparties": null,
    "schedule": null,
    "expires_at": "2027-12-31T23:59:59Z"
  },
  "currency": "USD",
  "limits": [
    {
      "kind": "per_order",
      "text": "Up to $50.00 an order"
    },
    {
      "kind": "expires",
      "text": "Until Dec 31, 2027"
    }
  ],
  "grant_id": null,
  "created_at": "2026-11-07T19:22:53.613Z",
  "expires_at": "2026-11-07T19:37:53.613Z",
  "decided_at": null
}
```

## Retrieve a delegation proposal

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

The proposal with the agent's structure, the approved one and the person's edits, and `page`: the mandate's limits and bounds in plain words and the agents a child can go to, for the edit view. An API key also gets the minted children's tokens. The hosted page reads it with its link token (`token`), with no key.

Auth: an API key is optional.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The proposal's ID. |
| `token` | query | string | no | The hosted page's link token, in place of a key or session. |

### Returns

The proposal and its edit view.

### 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)
- [`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/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Scout Flights", "category": "shopping_agent" }' > step.json
export FLIGHTS_ID=$(jq -r '.id' step.json)
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": "Book Maya'\''s Lisbon trip",
    "constraints": {
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "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/grants/$MANDATE_ID/delegation_proposals" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"notify\": false,
    \"children\": [
      {
        \"agent_id\": \"$FLIGHTS_ID\",
        \"purpose\": \"Book the flights\",
        \"constraints\": {
          \"budget_amount\": 900
        }
      }
    ]
  }" > step.json
export PROPOSAL_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/delegation_proposals/$PROPOSAL_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Scout Flights", "category": "shopping_agent" }),
})).json();
const flightsId = step1.id;
const step2 = 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": "Book Maya's Lisbon trip",
    "constraints": {
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegation_proposals`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "notify": false,
    "children": [
      {
        "agent_id": flightsId,
        "purpose": "Book the flights",
        "constraints": {
          "budget_amount": 900
        }
      }
    ]
  }),
})).json();
const proposalId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/delegation_proposals/${proposalId}`, {
  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/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Scout Flights",
    "category": "shopping_agent"
}).json()
flights_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip",
    "constraints": {
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step2["id"]
step3 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegation_proposals", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "notify": False,
    "children": [
        {
            "agent_id": flights_id,
            "purpose": "Book the flights",
            "constraints": {
                "budget_amount": 900
            }
        }
    ]
}).json()
proposal_id = step3["id"]
data = httpx.get(f"{api}/v1/mandate/delegation_proposals/{proposal_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "dgp_01M8G6C9BW2NFXQ1GY5F8BGEBR",
  "object": "delegation_proposal",
  "status": "pending",
  "parent_grant_id": "grt_01M8G6C9BQHP3RTMCZ040G5S1Y",
  "root_grant_id": "grt_01M8G6C9BQHP3RTMCZ040G5S1Y",
  "agent_id": null,
  "proposed_by": "account_key",
  "proposed": {
    "children": [
      {
        "agent_id": "agt_01M8G6C9BD0H8J4FTZXSJRGY2Y",
        "purpose": "Book the flights",
        "purpose_tags": [],
        "max_depth": null,
        "constraints": {
          "budget_amount": 900
        },
        "budget": {
          "allocation": "shared",
          "at_limit": "ask",
          "ask_up_to": {
            "percent": 20
          }
        }
      }
    ]
  },
  "proposed_hash": "3b37e0bb6c1c070309636cc13381bcd342fb53f68588ab400529a62e674fded1",
  "approved": null,
  "approved_hash": null,
  "edits": [],
  "edited": false,
  "minted": [],
  "parent_change": null,
  "supersedes": null,
  "superseded_by": null,
  "decided_via": null,
  "created_at": "2026-11-28T04:24:54.908Z",
  "expires_at": "2026-11-29T04:24:54.908Z",
  "decided_at": null,
  "approval_context": null,
  "page": {
    "parent": {
      "id": "grt_01M8G6C9BQHP3RTMCZ040G5S1Y",
      "purpose": "Book Maya's Lisbon trip",
      "agent": null,
      "status": "active",
      "currency": "USD",
      "max_amount": null,
      "budget_amount": 2400,
      "budget_window": "month",
      "expires_at": "2027-12-31T23:59:59Z",
      "budget_lock": {
        "action": "ask",
        "refuse_over": {
          "percent": 20
        }
      },
      "allowed_mcc": null,
      "service_window": null,
      "limits": [
        {
          "kind": "budget",
          "text": "Up to $2,400.00 a month"
        },
        {
          "kind": "expires",
          "text": "Until Dec 31, 2027"
        }
      ],
      "available_to_reserve": 2400
    },
    "children": [
      {
        "agent": {
          "id": "agt_01M8G6C9BD0H8J4FTZXSJRGY2Y",
          "name": "Scout Flights"
        },
        "limits": [
          {
            "kind": "budget",
            "text": "Up to $900.00 a month"
          },
          {
            "kind": "expires",
            "text": "Until Dec 31, 2027"
          }
        ]
      }
    ],
    "agents": [
      {
        "id": "agt_01M8G6C9BD0H8J4FTZXSJRGY2Y",
        "name": "Scout Flights"
      }
    ],
    "agent_names": {
      "agt_01M8G6C9BD0H8J4FTZXSJRGY2Y": "Scout Flights"
    }
  },
  "theme": {
    "page_theme": "dark",
    "theme_switch": true
  }
}
```

## Retrieve an external hand-off

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

A grant handed to an agent outside the account: pending, minted (with the grant's ID) or declined, and the state of the grantor's approval. An agent that asked with holder proof reads the same answer by sending its delegate call again with `handoff_id`.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The hand-off's ID (`xho_`). |

### Returns

The hand-off.

### Errors

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

### 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": "Book Maya'\''s Lisbon trip",
    "constraints": {
      "max_amount": 1200,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "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/grants/$MANDATE_ID/delegate" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_session_id": "sess_valet_flights_1",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
      "max_amount": 600,
      "budget_amount": 600
    },
    "receiver": {
      "kind": "key",
      "name": "SkyDesk Seats",
      "origin": "https://seats.skydesk.example"
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
  }' > step.json
export HANDOFF_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/external_handoffs/$HANDOFF_ID" \
  -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": "Book Maya's Lisbon trip",
    "constraints": {
      "max_amount": 1200,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegate`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "agent_session_id": "sess_valet_flights_1",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
      "max_amount": 600,
      "budget_amount": 600
    },
    "receiver": {
      "kind": "key",
      "name": "SkyDesk Seats",
      "origin": "https://seats.skydesk.example"
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
  }),
})).json();
const handoffId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/external_handoffs/${handoffId}`, {
  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": "Book Maya's Lisbon trip",
    "constraints": {
        "max_amount": 1200,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "agent_session_id": "sess_valet_flights_1",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
        "max_amount": 600,
        "budget_amount": 600
    },
    "receiver": {
        "kind": "key",
        "name": "SkyDesk Seats",
        "origin": "https://seats.skydesk.example"
    },
    "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
}).json()
handoff_id = step2["id"]
data = httpx.get(f"{api}/v1/mandate/external_handoffs/{handoff_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "external_handoff",
  "id": "xho_01M7Z3ZYP75KZHHPXETY7G181D",
  "status": "pending",
  "parent_grant_id": "grt_01M7Z3ZYP5H2NQES63GBQJVQXA",
  "grant_id": null,
  "receiver": {
    "kind": "key",
    "name": "SkyDesk Seats",
    "origin": "https://seats.skydesk.example",
    "verified": false
  },
  "holder_jkt": "TS6dSfKQ3OPDHsfzCtUI-gHg4U_s75NEg0BFVXNDS4k",
  "offline_checks": "refused",
  "grantor": "account",
  "approval_id": "appr_01M7Z3ZYP7ME9FVQH14T6ERMCT",
  "status_url": "http://localhost:8080/v1/mandate/external_handoffs/xho_01M7Z3ZYP75KZHHPXETY7G181D",
  "created_at": "2026-11-21T13:16:08.263Z",
  "expires_at": "2026-11-21T13:26:08.263Z",
  "decided_at": null,
  "approval_status": "pending"
}
```

## Retrieve an incoming grant

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

A grant another account handed to one of your registered agents, with the grant's live status and, once a revoke reached it, `revoked_at` and `stopped_by`.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The incoming grant's ID (`ing_`). |

### Returns

The incoming grant.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "SkyDesk Booking", "category": "shopping_agent" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip",
    "constraints": {
      "max_amount": 1200,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "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/grants/$MANDATE_ID/delegate" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d "{
    \"agent_session_id\": \"sess_valet_flights_2\",
    \"purpose\": \"Hold seat 14C on TP1351\",
    \"constraints\": {
      \"max_amount\": 600,
      \"budget_amount\": 600
    },
    \"receiver\": {
      \"kind\": \"provenance_agent\",
      \"agent_id\": \"$AGENT_ID\"
    },
    \"holder_key\": {
      \"kty\": \"EC\",
      \"crv\": \"P-256\",
      \"x\": \"NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js\",
      \"y\": \"qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8\"
    }
  }" > step.json
export HANDOFF_ID=$(jq -r '.id' step.json)
export APPROVAL_ID=$(jq -r '.approval_id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/approvals/$APPROVAL_ID/respond" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{ "decision": "approve" }' > /dev/null
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID/delegate" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d "{
    \"agent_session_id\": \"sess_valet_flights_2\",
    \"purpose\": \"Hold seat 14C on TP1351\",
    \"constraints\": {
      \"max_amount\": 600,
      \"budget_amount\": 600
    },
    \"receiver\": {
      \"kind\": \"provenance_agent\",
      \"agent_id\": \"$AGENT_ID\"
    },
    \"holder_key\": {
      \"kty\": \"EC\",
      \"crv\": \"P-256\",
      \"x\": \"NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js\",
      \"y\": \"qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8\"
    },
    \"handoff_id\": \"$HANDOFF_ID\"
  }" > /dev/null
curl -s "$PROVENANCE_API/v1/mandate/incoming_grants?limit=1" \
  -H "Authorization: Bearer $PROVENANCE_KEY" > step.json
export INCOMING_ID=$(jq -r '.data[0].id' step.json)
curl "$PROVENANCE_API/v1/mandate/incoming_grants/$INCOMING_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "SkyDesk Booking", "category": "shopping_agent" }),
})).json();
const agentId = step1.id;
const step2 = 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": "Book Maya's Lisbon trip",
    "constraints": {
      "max_amount": 1200,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegate`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
      "max_amount": 600,
      "budget_amount": 600
    },
    "receiver": {
      "kind": "provenance_agent",
      "agent_id": agentId
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
  }),
})).json();
const handoffId = step3.id;
const approvalId = step3.approval_id;
const step4 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approvals/${approvalId}/respond`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "decision": "approve" }),
})).json();
const step5 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegate`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
      "max_amount": 600,
      "budget_amount": 600
    },
    "receiver": {
      "kind": "provenance_agent",
      "agent_id": agentId
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    },
    "handoff_id": handoffId
  }),
})).json();
const step6 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/incoming_grants?limit=1`, {
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
const incomingId = step6.data[0].id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/incoming_grants/${incomingId}`, {
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "name": "SkyDesk Booking",
    "category": "shopping_agent"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip",
    "constraints": {
        "max_amount": 1200,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step2["id"]
step3 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
        "max_amount": 600,
        "budget_amount": 600
    },
    "receiver": {
        "kind": "provenance_agent",
        "agent_id": agent_id
    },
    "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
}).json()
handoff_id = step3["id"]
approval_id = step3["approval_id"]
step4 = httpx.post(f"{api}/v1/mandate/approvals/{approval_id}/respond", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "decision": "approve"
}).json()
step5 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
        "max_amount": 600,
        "budget_amount": 600
    },
    "receiver": {
        "kind": "provenance_agent",
        "agent_id": agent_id
    },
    "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    },
    "handoff_id": handoff_id
}).json()
step6 = httpx.get(f"{api}/v1/mandate/incoming_grants?limit=1", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
incoming_id = step6["data"][0]["id"]
data = httpx.get(f"{api}/v1/mandate/incoming_grants/{incoming_id}", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
```

### Response 200

```json
{
  "object": "incoming_grant",
  "id": "ing_01M7Z720C8417WT60ES7MC15F5",
  "agent_id": "agt_01M7Z720BMVHY8JP6SZN37238P",
  "grant_id": "grt_01M7Z720C7R1HW92E429WPJ4H4",
  "handoff_id": "xho_01M7Z720C2SG9KTPWWK4B2V260",
  "chain": [
    "grt_01M7Z720BTKAKZYV3QCHS03YWC",
    "grt_01M7Z720C7R1HW92E429WPJ4H4"
  ],
  "purpose": "Hold seat 14C on TP1351",
  "constraints": {
    "max_amount": 600,
    "budget_amount": 600,
    "budget_window": "month",
    "allowed_action_types": [],
    "allowed_counterparties": null,
    "schedule": null,
    "expires_at": "2027-12-31T23:59:59Z"
  },
  "holder_jkt": "TS6dSfKQ3OPDHsfzCtUI-gHg4U_s75NEg0BFVXNDS4k",
  "offline_checks": "refused",
  "status": "active",
  "stopped_by": null,
  "created_at": "2026-11-21T14:09:41.256Z",
  "expires_at": "2027-12-31T23:59:59Z",
  "revoked_at": null
}
```

## Get a device enrolment

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

The enrolment's state and, once the phone made its passkey, `device_id`, the device to name on the person's grant.

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

### Parameters

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

### Returns

The enrolment.

### 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)
- [`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/device_enrollments" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "display_name": "Maya", "reference": "ds_session_get" }' > step.json
export ENROLMENT_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/device_enrollments/$ENROLMENT_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "display_name": "Maya", "reference": "ds_session_get" }),
})).json();
const enrolmentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments/${enrolmentId}`, {
  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/device_enrollments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "display_name": "Maya",
    "reference": "ds_session_get"
}).json()
enrollment_id = step1["id"]
data = httpx.get(f"{api}/v1/mandate/device_enrollments/{enrollment_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "device_enrollment",
  "id": "denr_01M7QKCZR7QQYFVZ8WYAYP0P0B",
  "status": "pending",
  "display_name": "Maya",
  "reference": "ds_session_get",
  "device_id": null,
  "created_at": "2026-11-18T15:11:28.519Z",
  "expires_at": "2026-11-18T15:26:28.519Z",
  "enrolled_at": null,
  "revoked_at": null
}
```

## Get a person's usual spend

`GET /v1/mandate/grants/{id}/usual_spend`

Returns the usual spend of the person who gave this grant, per category of spend: the median of their purchases in each category over the last 90 days, how many purchases that is, and whether it is a baseline (five or more). Every grant the person gave your account counts. An agent's `over_usual` default asks only against a baseline; before it, it does nothing. Free on every plan.

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

### Parameters

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

### Returns

The person's usual spend per category.

### 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)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`usual_spend_unavailable`](https://provenanceauth.com/docs/platform/errors.md#usual_spend_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",
    "agent_session_id": "sess_supper_1",
    "purpose": "Dinners out",
    "constraints": {
      "budget_amount": 600,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
export MANDATE_TOKEN=$(jq -r '.mandate_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/intents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"action_description\": \"Dinner at Taberna Ruiva: \$48.00\",
    \"agent_session_id\": \"sess_supper_1\",
    \"device_id\": \"dev_00000000000000000000000000000001\",
    \"mandate_token\": \"$MANDATE_TOKEN\"
  }" > step.json
export INTENT_TOKEN=$(jq -r '.intent_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/assessments" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"intent_token\": \"$INTENT_TOKEN\",
    \"action_description\": \"Dinner at Taberna Ruiva: \$48.00\",
    \"context\": {
      \"transaction_amount\": 48,
      \"currency\": \"USD\",
      \"mcc\": \"5812\"
    }
  }" > /dev/null
curl "$PROVENANCE_API/v1/mandate/grants/$GRANT_ID/usual_spend" \
  -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",
    "agent_session_id": "sess_supper_1",
    "purpose": "Dinners out",
    "constraints": {
      "budget_amount": 600,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const mandateToken = step1.mandate_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Dinner at Taberna Ruiva: $48.00",
    "agent_session_id": "sess_supper_1",
    "device_id": "dev_00000000000000000000000000000001",
    "mandate_token": mandateToken
  }),
})).json();
const intentToken = step2.intent_token;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "intent_token": intentToken,
    "action_description": "Dinner at Taberna Ruiva: $48.00",
    "context": {
      "transaction_amount": 48,
      "currency": "USD",
      "mcc": "5812"
    }
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${grantId}/usual_spend`, {
  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",
    "agent_session_id": "sess_supper_1",
    "purpose": "Dinners out",
    "constraints": {
        "budget_amount": 600,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
mandate_token = step1["mandate_token"]
step2 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "action_description": "Dinner at Taberna Ruiva: $48.00",
    "agent_session_id": "sess_supper_1",
    "device_id": "dev_00000000000000000000000000000001",
    "mandate_token": mandate_token
}).json()
intent_token = step2["intent_token"]
step3 = httpx.post(f"{api}/v1/mandate/assessments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "intent_token": intent_token,
    "action_description": "Dinner at Taberna Ruiva: $48.00",
    "context": {
        "transaction_amount": 48,
        "currency": "USD",
        "mcc": "5812"
    }
}).json()
data = httpx.get(f"{api}/v1/mandate/grants/{grant_id}/usual_spend", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "usual_spend",
  "grant_id": "grt_01M84S05EEKJN4B5KXGC39WAJZ",
  "window_days": 90,
  "min_purchases": 5,
  "categories": [
    {
      "category": "dining",
      "label": "Dining",
      "currency": "USD",
      "median": 48,
      "purchases": 1,
      "baseline": false
    }
  ],
  "computed_at": "2026-11-23T17:59:27.460Z",
  "truncated": false
}
```

## Get the heartbeat challenge

`GET /v1/mandate/grants/{id}/heartbeat/challenge`

Returns this period's WebAuthn challenge for a mandate's heartbeat check-in. It changes every period, so an old check-in can't be replayed.

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

### Parameters

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

### Returns

A single-use passkey challenge.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "heartbeat": {
        "interval": "weekly",
        "grace_hours": 72
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID/heartbeat/challenge" \
  -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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "heartbeat": {
        "interval": "weekly",
        "grace_hours": 72
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/heartbeat/challenge`, {
  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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
        "max_amount": 400,
        "heartbeat": {
            "interval": "weekly",
            "grace_hours": 72
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
data = httpx.get(f"{api}/v1/mandate/grants/{grant_id}/heartbeat/challenge", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "challenge": "57766dda5690ea220ffaabf356cb926d735c13927a17de0eae7163c930a54ba5"
}
```

## Get the purpose-check settings

`GET /v1/mandate/settings/purpose_check`

Returns the account's purpose checks for actions under delegated mandates: the default rule (ask the person when an action is outside the subagent's purpose; on for new accounts) and the opt-in AI check, and whether the server has a purpose-check endpoint.

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

### Parameters

No parameters.

### Returns

The settings.

### 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/purpose_check" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/purpose_check`, {
  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/purpose_check", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "purpose_check_setting",
  "default_rule": "on",
  "ai_check": "off",
  "ai_check_configured": false
}
```

## Get the over-limit settings

`GET /v1/mandate/settings/delegation`

Returns what each of a grant's locks does when a purchase goes past it: ask a person or refuse, and for the amount and budget locks the margin past which it refuses (a percentage or an amount). Also `require_same_person`, `at_verify` (whether verify follows them) and `require_holder_proof` (whether delegating needs holder proof).

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

### Parameters

No parameters.

### Returns

The settings.

### 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/delegation" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/delegation`, {
  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/delegation", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "delegation_setting",
  "over_limit": {
    "amount": {
      "action": "ask",
      "refuse_over": {
        "percent": 20
      }
    },
    "budget": {
      "action": "ask",
      "refuse_over": {
        "percent": 20
      }
    },
    "dates": {
      "action": "ask"
    },
    "category": {
      "action": "ask"
    },
    "counterparty": {
      "action": "refuse"
    },
    "currency": {
      "action": "ask"
    },
    "block": {
      "action": "refuse"
    },
    "uses": {
      "action": "refuse"
    },
    "purchases": {
      "action": "ask"
    },
    "country": {
      "action": "ask"
    }
  },
  "require_same_person": false,
  "at_verify": "settings",
  "require_holder_proof": false,
  "external": "ask",
  "external_online_above": 0,
  "defaults": {
    "amount": {
      "action": "ask",
      "refuse_over": {
        "percent": 20
      }
    },
    "budget": {
      "action": "ask",
      "refuse_over": {
        "percent": 20
      }
    },
    "dates": {
      "action": "ask"
    },
    "category": {
      "action": "ask"
    },
    "counterparty": {
      "action": "refuse"
    },
    "currency": {
      "action": "ask"
    },
    "block": {
      "action": "refuse"
    },
    "uses": {
      "action": "refuse"
    },
    "purchases": {
      "action": "ask"
    },
    "country": {
      "action": "ask"
    }
  }
}
```

## Get the spend summary

`GET /v1/mandate/spend_summary`

Returns what your agents spent under their grants in a window: a total, one row per group and one row per day. Group by category of spend (from the merchant category code) or by agent. Amounts in different currencies are never added: the summary is in one currency and the rest is listed in `other_currencies`.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `group_by` | query | enum | no | How to group the spend. One of `category`, `agent`. |
| `window` | query | enum | no | The window, in whole UTC days ending today. One of `7d`, `30d`, `90d`. |
| `currency` | query | string | no | A three-letter currency code. Left out, the summary is in the currency most of the window's spend is in. |

### Returns

The spend in the window, per group and per day.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`spend_summary_unavailable`](https://provenanceauth.com/docs/platform/errors.md#spend_summary_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",
    "agent_session_id": "sess_rooms_1",
    "purpose": "Lisbon trip",
    "constraints": {
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_TOKEN=$(jq -r '.mandate_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/intents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"action_description\": \"Book Hotel Alfama, 2 nights: \$344.00\",
    \"agent_session_id\": \"sess_rooms_1\",
    \"device_id\": \"dev_00000000000000000000000000000001\",
    \"mandate_token\": \"$MANDATE_TOKEN\"
  }" > step.json
export INTENT_TOKEN=$(jq -r '.intent_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/assessments" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"intent_token\": \"$INTENT_TOKEN\",
    \"action_description\": \"Book Hotel Alfama, 2 nights: \$344.00\",
    \"context\": {
      \"transaction_amount\": 344,
      \"currency\": \"USD\",
      \"mcc\": \"7011\"
    }
  }" > /dev/null
curl "$PROVENANCE_API/v1/mandate/spend_summary?group_by=category&window=7d" \
  -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",
    "agent_session_id": "sess_rooms_1",
    "purpose": "Lisbon trip",
    "constraints": {
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateToken = step1.mandate_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Book Hotel Alfama, 2 nights: $344.00",
    "agent_session_id": "sess_rooms_1",
    "device_id": "dev_00000000000000000000000000000001",
    "mandate_token": mandateToken
  }),
})).json();
const intentToken = step2.intent_token;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "intent_token": intentToken,
    "action_description": "Book Hotel Alfama, 2 nights: $344.00",
    "context": {
      "transaction_amount": 344,
      "currency": "USD",
      "mcc": "7011"
    }
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/spend_summary?group_by=category&window=7d`, {
  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",
    "agent_session_id": "sess_rooms_1",
    "purpose": "Lisbon trip",
    "constraints": {
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_token = step1["mandate_token"]
step2 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "action_description": "Book Hotel Alfama, 2 nights: $344.00",
    "agent_session_id": "sess_rooms_1",
    "device_id": "dev_00000000000000000000000000000001",
    "mandate_token": mandate_token
}).json()
intent_token = step2["intent_token"]
step3 = httpx.post(f"{api}/v1/mandate/assessments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "intent_token": intent_token,
    "action_description": "Book Hotel Alfama, 2 nights: $344.00",
    "context": {
        "transaction_amount": 344,
        "currency": "USD",
        "mcc": "7011"
    }
}).json()
data = httpx.get(f"{api}/v1/mandate/spend_summary?group_by=category&window=7d", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "spend_summary",
  "group_by": "category",
  "window": "7d",
  "since": "2026-11-17T00:00:00.000Z",
  "until": "2026-11-23T13:02:00.477Z",
  "currency": "USD",
  "total": 344,
  "entries": 1,
  "groups": [
    {
      "key": "lodging",
      "label": "Lodging",
      "total": 344,
      "entries": 1
    }
  ],
  "days": [
    {
      "date": "2026-11-17",
      "total": 0,
      "by_group": {}
    },
    {
      "date": "2026-11-18",
      "total": 0,
      "by_group": {}
    },
    {
      "date": "2026-11-19",
      "total": 0,
      "by_group": {}
    },
    "… 4 more"
  ],
  "other_currencies": [],
  "truncated": false
}
```

## Get the mandate limits

`GET /v1/mandate/settings/limits`

Returns the account's live mandate limits: the overall cap, how sub-agents share it, the merchant lists, the margin past which a purchase over a budget is refused, and whether a person is asked below it. Until a version is published this is the built-in document (`is_default: true`), which applies nothing.

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

### Parameters

No parameters.

### Returns

The mandate limits.

### 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/limits" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits`, {
  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/limits", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "mandate_limits",
  "id": null,
  "version": null,
  "is_default": true,
  "document": {
    "cap": {
      "enabled": false,
      "amount": 1000,
      "currency": "USD"
    },
    "budget": {
      "allocation": "shared",
      "at_limit": "ask"
    },
    "allowed_mcc": {
      "enabled": false,
      "action": "refuse",
      "mcc": []
    },
    "named_merchants": {
      "enabled": false,
      "action": "refuse",
      "merchants": []
    },
    "blocked_mcc": {
      "enabled": false,
      "mcc": []
    },
    "blocked_merchants": {
      "enabled": false,
      "merchants": []
    },
    "refuse_over_cap": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    },
    "ask_over_cap": {
      "enabled": true
    },
    "refuse_over_share": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    }
  }
}
```

## Get a mandate limits version

`GET /v1/mandate/settings/limits/versions/{version}`

One version of the account's mandate limits, a waiting draft included, with its document.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `version` | path | integer | yes | The version number. |

### Returns

The version. See [the policy version object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`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/limits/versions/1" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits/versions/1`, {
  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/limits/versions/1", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "policy_version",
  "policy_id": "pol_01M7PS9D7T0DB5ZT9JAA5FQT87",
  "domain": "mandate_limits",
  "version": 2,
  "active": true,
  "note": null,
  "created_by": "k-9b7ea63bc5b2",
  "created_at": "2026-11-18T13:20:00.000Z",
  "source": "embed",
  "embed_session": "01M7PRQCQ1GW4RAYZRP3X9DX47",
  "document": {
    "cap": {
      "enabled": true,
      "amount": 2400,
      "currency": "USD"
    },
    "budget": {
      "allocation": "shared",
      "at_limit": "ask"
    },
    "allowed_mcc": {
      "enabled": true,
      "action": "refuse",
      "mcc": [
        {
          "from": "3501",
          "to": "3999",
          "name": "Lodging",
          "group": "lodging"
        },
        {
          "from": "7011",
          "to": "7011",
          "name": "Lodging",
          "group": "lodging"
        }
      ]
    },
    "named_merchants": {
      "enabled": false,
      "action": "refuse",
      "merchants": []
    },
    "blocked_mcc": {
      "enabled": false,
      "mcc": []
    },
    "blocked_merchants": {
      "enabled": false,
      "merchants": []
    },
    "refuse_over_cap": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    },
    "ask_over_cap": {
      "enabled": true
    },
    "refuse_over_share": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    }
  }
}
```

## Set an agent's holder binding

`PUT /v1/mandate/holder_bindings/{agent_id}`

`required`: every grant to this agent of yours, on grant or delegate, must carry `holder_key`. `not_required`: a hand-off to this outside registered agent may leave `holder_key` out (a bearer grant). Needs an admin key or an owner or admin session.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `agent_id` | path | string | yes | The agent, yours or registered in another account. |
| `holder_binding` | body | enum | yes | The setting. One of `required`, `not_required`. |

### Returns

The setting.

### 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)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`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/holder_bindings/agt_01M7Z71YM4GVGFZ5D6PQQE0VZN" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "holder_binding": "required" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/holder_bindings/agt_01M7Z71YM4GVGFZ5D6PQQE0VZN`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "holder_binding": "required" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/mandate/holder_bindings/agt_01M7Z71YM4GVGFZ5D6PQQE0VZN", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "holder_binding": "required"
}).json()
```

### Response 200

```json
{
  "object": "holder_binding",
  "agent_id": "agt_01M7Z71YM4GVGFZ5D6PQQE0VZN",
  "agent_name": "Valet Flights",
  "inside": true,
  "holder_binding": "required",
  "updated_at": "2026-11-21T14:19:10.002Z"
}
```

## Set the purpose-check settings

`PUT /v1/mandate/settings/purpose_check`

Turns the default rule or the AI check on or off. Needs an admin key or an owner or admin session.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `default_rule` | body | enum | no | Ask the person when an action under a delegated mandate is outside its purpose. One of `on`, `off`. |
| `ai_check` | body | enum | no | Also ask the configured model whether the action fits the purpose. One of `on`, `off`. |

### Returns

The settings.

### 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/purpose_check" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "default_rule": "on", "ai_check": "off" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/purpose_check`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "default_rule": "on", "ai_check": "off" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/mandate/settings/purpose_check", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "default_rule": "on",
    "ai_check": "off"
}).json()
```

### Response 200

```json
{
  "object": "purpose_check_setting",
  "default_rule": "on",
  "ai_check": "off",
  "ai_check_configured": false
}
```

## Set the over-limit settings

`PUT /v1/mandate/settings/delegation`

Changes the account's setting for each lock given (the others keep theirs), `require_same_person`, `at_verify`, `require_holder_proof`, `external` and `external_online_above`. Changing `over_limit` without `at_verify` sets it to `settings`. Needs an admin key or an owner or admin session. A grant's own `constraints.over_limit` still comes first.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `over_limit` | body | object | no | Over-limit settings per lock (any subset). `amount` is the per-purchase limit, `budget` the grant's budget and each one above it, `counterparty` its merchant list, `currency` its currency, `uses` and `purchases` its counts. `dates`, `category`, `block` and `country` are accepted now and take effect with the locks they name. |
| `over_limit.amount` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.amount.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.amount.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.amount.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.amount.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.budget` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.budget.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.budget.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.budget.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.budget.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.dates` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.dates.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.dates.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.dates.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.dates.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.category` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.category.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.category.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.category.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.category.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.counterparty` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.counterparty.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.counterparty.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.counterparty.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.counterparty.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.currency` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.currency.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.currency.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.currency.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.currency.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.block` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.block.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.block.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.block.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.block.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.uses` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.uses.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.uses.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.uses.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.uses.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.purchases` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.purchases.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.purchases.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.purchases.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.purchases.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `over_limit.country` | body | object | no | What one of a grant's locks does when a purchase goes past it. `ask` opens an approval for a person; `refuse` refuses without asking. The amount and budget locks take `refuse_over` with `ask`: past the limit plus that margin, the purchase is refused without asking. |
| `over_limit.country.action` | body | enum | yes | Ask a person, or refuse. One of `ask`, `refuse`. |
| `over_limit.country.refuse_over` | body | object \| null | no | The amount and budget locks only, with `ask`: how far past the limit a person may still be asked, as a percentage of the limit (`percent`, 20 by default when left out) or, in Advanced, a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount over. |
| `over_limit.country.refuse_over.percent` | body | number | no | The margin, in percent of the limit (20: ask up to 1.2 times the limit). |
| `over_limit.country.refuse_over.amount` | body | number | no | The margin as a fixed amount in the grant's currency (300: ask up to the limit plus 300). On a grant it needs the grant's `currency`. |
| `require_same_person` | body | boolean | no | Accept a yes over a grant's limit only from a passkey the grant's person registered. |
| `at_verify` | body | enum | no | `settings`: verify follows the over-limit settings. `refuse`: verify refuses every miss. One of `settings`, `refuse`. |
| `require_holder_proof` | body | boolean | no | An account key can't delegate: the agent that holds a mandate delegates with its own grant (holder proof), or a person in the console. |
| `external` | body | enum | no | A grant handed to an agent outside the account: `ask` the grantor first, or `refuse` it. One of `ask`, `refuse`. |
| `external_online_above` | body | number | no | The budget at or under which a hand-off that doesn't say allows offline checks. |

### Returns

The settings.

### 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/delegation" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "over_limit": {
      "budget": {
        "action": "ask",
        "refuse_over": {
          "percent": 10
        }
      }
    },
    "require_same_person": true
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/delegation`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "over_limit": {
      "budget": {
        "action": "ask",
        "refuse_over": {
          "percent": 10
        }
      }
    },
    "require_same_person": true
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/mandate/settings/delegation", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "over_limit": {
        "budget": {
            "action": "ask",
            "refuse_over": {
                "percent": 10
            }
        }
    },
    "require_same_person": True
}).json()
```

### Response 200

```json
{
  "object": "delegation_setting",
  "over_limit": {
    "amount": {
      "action": "ask",
      "refuse_over": {
        "percent": 20
      }
    },
    "budget": {
      "action": "ask",
      "refuse_over": {
        "percent": 10
      }
    },
    "dates": {
      "action": "ask"
    },
    "category": {
      "action": "ask"
    },
    "counterparty": {
      "action": "refuse"
    },
    "currency": {
      "action": "ask"
    },
    "block": {
      "action": "refuse"
    },
    "uses": {
      "action": "refuse"
    },
    "purchases": {
      "action": "ask"
    },
    "country": {
      "action": "ask"
    }
  },
  "require_same_person": true,
  "at_verify": "settings",
  "require_holder_proof": false,
  "external": "ask",
  "external_online_above": 0,
  "defaults": {
    "amount": {
      "action": "ask",
      "refuse_over": {
        "percent": 20
      }
    },
    "budget": {
      "action": "ask",
      "refuse_over": {
        "percent": 20
      }
    },
    "dates": {
      "action": "ask"
    },
    "category": {
      "action": "ask"
    },
    "counterparty": {
      "action": "refuse"
    },
    "currency": {
      "action": "ask"
    },
    "block": {
      "action": "refuse"
    },
    "uses": {
      "action": "refuse"
    },
    "purchases": {
      "action": "ask"
    },
    "country": {
      "action": "ask"
    }
  }
}
```

## List mandates

`GET /v1/mandate/grants`

Lists your account's mandates, newest first.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `q` | query | string | no | Search text. Matches when the grant's ID, its agent's ID, its agent session, its purpose or its run's ID contains it, ignoring case. At most 200 characters. |
| `status` | query | array of enums | no | Only grants in these statuses. One value, or several separated by commas. |
| `agent_id` | query | string | no | Only grants this registered agent holds. |
| `sort` | query | enum | no | The order of the list: `created`, `spent` (this budget window) or `ends` (when the grant expires), with `-` in front for descending. Newest first when omitted. A grant with no budget sorts last by `spent`. A `next_cursor` carries its order; pass it back with the same `sort`. One of `created`, `-created`, `spent`, `-spent`, `ends`, `-ends`. |

### Returns

The account's mandates, each with its remaining budget.

### 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/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  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/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

## List delegation proposals

`GET /v1/mandate/delegation_proposals`

The account's delegation proposals, newest first. Filter by `status` or by the mandate (`parent_grant_id`).

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `status` | query | enum | no | Only proposals in this state. One of `pending`, `approved`, `declined`, `expired`, `stale`, `superseded`. |
| `parent_grant_id` | query | string | no | Only proposals for this mandate. |
| `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. |

### Returns

The proposals.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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 -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Scout Flights", "category": "shopping_agent" }' > step.json
export FLIGHTS_ID=$(jq -r '.id' step.json)
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": "Book Maya'\''s Lisbon trip",
    "constraints": {
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "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/grants/$MANDATE_ID/delegation_proposals" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"notify\": false,
    \"children\": [
      {
        \"agent_id\": \"$FLIGHTS_ID\",
        \"purpose\": \"Book the flights\",
        \"constraints\": {
          \"budget_amount\": 900
        }
      }
    ]
  }" > /dev/null
curl "$PROVENANCE_API/v1/mandate/delegation_proposals?status=pending&limit=1" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Scout Flights", "category": "shopping_agent" }),
})).json();
const flightsId = step1.id;
const step2 = 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": "Book Maya's Lisbon trip",
    "constraints": {
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegation_proposals`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "notify": false,
    "children": [
      {
        "agent_id": flightsId,
        "purpose": "Book the flights",
        "constraints": {
          "budget_amount": 900
        }
      }
    ]
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/delegation_proposals?status=pending&limit=1`, {
  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/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Scout Flights",
    "category": "shopping_agent"
}).json()
flights_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip",
    "constraints": {
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step2["id"]
step3 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegation_proposals", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "notify": False,
    "children": [
        {
            "agent_id": flights_id,
            "purpose": "Book the flights",
            "constraints": {
                "budget_amount": 900
            }
        }
    ]
}).json()
data = httpx.get(f"{api}/v1/mandate/delegation_proposals?status=pending&limit=1", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "dgp_01M8G6BWXZ2VMY47WBG27D0QX9",
      "object": "delegation_proposal",
      "status": "pending",
      "parent_grant_id": "grt_01M8G6BWXWHY3PEM4PSX0PNZ9X",
      "root_grant_id": "grt_01M8G6BWXWHY3PEM4PSX0PNZ9X",
      "agent_id": null,
      "proposed_by": "account_key",
      "proposed": {
        "children": [
          {
            "agent_id": "agt_01M8G6BWXMVZXYN3PYB391NR27",
            "purpose": "Book the flights",
            "purpose_tags": [],
            "max_depth": null,
            "constraints": {
              "budget_amount": 900
            },
            "budget": {
              "allocation": "shared",
              "at_limit": "ask",
              "ask_up_to": {
                "percent": 20
              }
            }
          }
        ]
      },
      "proposed_hash": "1ad6a86ee1a0aa2f612157cc10c34bd4e88639b50e70b6486113f120078a91af",
      "approved": null,
      "approved_hash": null,
      "edits": [],
      "edited": false,
      "minted": [],
      "parent_change": null,
      "supersedes": null,
      "superseded_by": null,
      "decided_via": null,
      "created_at": "2026-11-28T04:24:42.175Z",
      "expires_at": "2026-11-29T04:24:42.175Z",
      "decided_at": null,
      "approval_context": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List incoming grants

`GET /v1/mandate/incoming_grants`

Grants other accounts handed to your registered agents, newest first, each with the grant's live status. Your account gets `mandate.incoming_grant.received` when one arrives and `mandate.incoming_grant.revoked` when a revoke reaches it.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `agent_id` | query | string | no | Only this agent's incoming grants. |
| `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. |

### Returns

The incoming grants.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "SkyDesk Booking", "category": "shopping_agent" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip",
    "constraints": {
      "max_amount": 1200,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "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/grants/$MANDATE_ID/delegate" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d "{
    \"agent_session_id\": \"sess_valet_flights_2\",
    \"purpose\": \"Hold seat 14C on TP1351\",
    \"constraints\": {
      \"max_amount\": 600,
      \"budget_amount\": 600
    },
    \"receiver\": {
      \"kind\": \"provenance_agent\",
      \"agent_id\": \"$AGENT_ID\"
    },
    \"holder_key\": {
      \"kty\": \"EC\",
      \"crv\": \"P-256\",
      \"x\": \"NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js\",
      \"y\": \"qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8\"
    }
  }" > step.json
export HANDOFF_ID=$(jq -r '.id' step.json)
export APPROVAL_ID=$(jq -r '.approval_id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/approvals/$APPROVAL_ID/respond" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{ "decision": "approve" }' > /dev/null
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID/delegate" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d "{
    \"agent_session_id\": \"sess_valet_flights_2\",
    \"purpose\": \"Hold seat 14C on TP1351\",
    \"constraints\": {
      \"max_amount\": 600,
      \"budget_amount\": 600
    },
    \"receiver\": {
      \"kind\": \"provenance_agent\",
      \"agent_id\": \"$AGENT_ID\"
    },
    \"holder_key\": {
      \"kty\": \"EC\",
      \"crv\": \"P-256\",
      \"x\": \"NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js\",
      \"y\": \"qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8\"
    },
    \"handoff_id\": \"$HANDOFF_ID\"
  }" > /dev/null
curl "$PROVENANCE_API/v1/mandate/incoming_grants?limit=1" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "SkyDesk Booking", "category": "shopping_agent" }),
})).json();
const agentId = step1.id;
const step2 = 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": "Book Maya's Lisbon trip",
    "constraints": {
      "max_amount": 1200,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegate`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
      "max_amount": 600,
      "budget_amount": 600
    },
    "receiver": {
      "kind": "provenance_agent",
      "agent_id": agentId
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
  }),
})).json();
const handoffId = step3.id;
const approvalId = step3.approval_id;
const step4 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approvals/${approvalId}/respond`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "decision": "approve" }),
})).json();
const step5 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegate`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
      "max_amount": 600,
      "budget_amount": 600
    },
    "receiver": {
      "kind": "provenance_agent",
      "agent_id": agentId
    },
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    },
    "handoff_id": handoffId
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/incoming_grants?limit=1`, {
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "name": "SkyDesk Booking",
    "category": "shopping_agent"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip",
    "constraints": {
        "max_amount": 1200,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step2["id"]
step3 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
        "max_amount": 600,
        "budget_amount": 600
    },
    "receiver": {
        "kind": "provenance_agent",
        "agent_id": agent_id
    },
    "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    }
}).json()
handoff_id = step3["id"]
approval_id = step3["approval_id"]
step4 = httpx.post(f"{api}/v1/mandate/approvals/{approval_id}/respond", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "decision": "approve"
}).json()
step5 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "agent_session_id": "sess_valet_flights_2",
    "purpose": "Hold seat 14C on TP1351",
    "constraints": {
        "max_amount": 600,
        "budget_amount": 600
    },
    "receiver": {
        "kind": "provenance_agent",
        "agent_id": agent_id
    },
    "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    },
    "handoff_id": handoff_id
}).json()
data = httpx.get(f"{api}/v1/mandate/incoming_grants?limit=1", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "object": "incoming_grant",
      "id": "ing_01M7Z71YMQ7NNZBZRX34VS4EQ8",
      "agent_id": "agt_01M7Z71YM4GVGFZ5D6PQQE0VZN",
      "grant_id": "grt_01M7Z71YMQHFC3FVGVDVXMVYJP",
      "handoff_id": "xho_01M7Z71YMHW4562JRHNJPXVKME",
      "chain": [
        "grt_01M7Z71YMAPMYZAT3N41E234VP",
        "grt_01M7Z71YMQHFC3FVGVDVXMVYJP"
      ],
      "purpose": "Hold seat 14C on TP1351",
      "constraints": {
        "max_amount": 600,
        "budget_amount": 600,
        "budget_window": "month",
        "allowed_action_types": [],
        "allowed_counterparties": null,
        "schedule": null,
        "expires_at": "2027-12-31T23:59:59Z"
      },
      "holder_jkt": "TS6dSfKQ3OPDHsfzCtUI-gHg4U_s75NEg0BFVXNDS4k",
      "offline_checks": "refused",
      "status": "active",
      "stopped_by": null,
      "created_at": "2026-11-21T14:09:39.479Z",
      "expires_at": "2027-12-31T23:59:59Z",
      "revoked_at": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List the trusted outside agents

`GET /v1/mandate/trusted_agents`

The company's trusted outside agents. A hand-off under a grant your account issued, to an agent on this list and within its caps, is minted without asking; the hand-off names the entry in `trusted_agent_id`.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `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. |

### Returns

The trusted agents.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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 "$PROVENANCE_API/v1/mandate/trusted_agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/trusted_agents`, {
  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/trusted_agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

## List the holder-binding settings

`GET /v1/mandate/holder_bindings`

The company's per-agent holder-binding settings. An agent without one follows the default: your own agents get bearer grants, outside agents get grants bound to their key.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `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. |

### Returns

The settings.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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 "$PROVENANCE_API/v1/mandate/holder_bindings" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/holder_bindings`, {
  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/holder_bindings", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

## List device enrolments

`GET /v1/mandate/device_enrollments`

The account's enrolment links, newest first. Filter by `status` or by your `reference`.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `status` | query | enum | no | Only enrolments in this state. One of `pending`, `enrolled`, `revoked`, `expired`. |
| `reference` | query | string | no | Only enrolments with this reference. |
| `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. |

### Returns

The enrolments.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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 -s -X POST "$PROVENANCE_API/v1/mandate/device_enrollments" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "display_name": "Maya", "reference": "ds_session_list" }' > /dev/null
curl "$PROVENANCE_API/v1/mandate/device_enrollments?reference=ds_session_list&limit=1" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "display_name": "Maya", "reference": "ds_session_list" }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments?reference=ds_session_list&limit=1`, {
  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/device_enrollments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "display_name": "Maya",
    "reference": "ds_session_list"
}).json()
data = httpx.get(f"{api}/v1/mandate/device_enrollments?reference=ds_session_list&limit=1", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "object": "device_enrollment",
      "id": "denr_01M7QKCXKA2XD8WKYCPCMNEJF7",
      "status": "pending",
      "display_name": "Maya",
      "reference": "ds_session_list",
      "device_id": null,
      "created_at": "2026-11-18T15:11:26.314Z",
      "expires_at": "2026-11-18T15:26:26.314Z",
      "enrolled_at": null,
      "revoked_at": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List a mandate's spend

`GET /v1/mandate/grants/{id}/spend`

Lists what a mandate spent, newest first: one entry per debit, with its kind, amount and currency and what caused it (the decision, the checkout assessment, the token). A verify pass and a cart the grant covers at a store each write one. With `include_descendants=true`, its subagents' entries are listed too. Free on every plan.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The object's ID. |
| `include_descendants` | query | enum | no | `true` lists the entries of every mandate delegated from this one as well (default `false`). One of `true`, `false`. |
| `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. |

### Returns

The entries.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
export MANDATE_TOKEN=$(jq -r '.mandate_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/intents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"action_description\": \"Pay invoice INV-2041: \$180.00 to Brindlecote Supplies\",
    \"agent_session_id\": \"sess_buyer_1\",
    \"device_id\": \"dev_00000000000000000000000000000001\",
    \"mandate_token\": \"$MANDATE_TOKEN\"
  }" > step.json
export INTENT_TOKEN=$(jq -r '.intent_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/assessments" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"intent_token\": \"$INTENT_TOKEN\",
    \"action_description\": \"Pay invoice INV-2041: \$180.00 to Brindlecote Supplies\",
    \"context\": {
      \"transaction_amount\": 180,
      \"currency\": \"USD\"
    }
  }" > /dev/null
curl "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID/spend" \
  -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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const mandateToken = step1.mandate_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Pay invoice INV-2041: $180.00 to Brindlecote Supplies",
    "agent_session_id": "sess_buyer_1",
    "device_id": "dev_00000000000000000000000000000001",
    "mandate_token": mandateToken
  }),
})).json();
const intentToken = step2.intent_token;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "intent_token": intentToken,
    "action_description": "Pay invoice INV-2041: $180.00 to Brindlecote Supplies",
    "context": {
      "transaction_amount": 180,
      "currency": "USD"
    }
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/spend`, {
  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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
        "max_amount": 400,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
mandate_token = step1["mandate_token"]
step2 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "action_description": "Pay invoice INV-2041: $180.00 to Brindlecote Supplies",
    "agent_session_id": "sess_buyer_1",
    "device_id": "dev_00000000000000000000000000000001",
    "mandate_token": mandate_token
}).json()
intent_token = step2["intent_token"]
step3 = httpx.post(f"{api}/v1/mandate/assessments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "intent_token": intent_token,
    "action_description": "Pay invoice INV-2041: $180.00 to Brindlecote Supplies",
    "context": {
        "transaction_amount": 180,
        "currency": "USD"
    }
}).json()
data = httpx.get(f"{api}/v1/mandate/grants/{grant_id}/spend", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "gse_01M7K8GXD40BWW7D2THC698VB8",
      "object": "grant_spend_entry",
      "grant_id": "grt_01M7K8GX2TGN4ZKYDWYR2J4GMC",
      "root_grant_id": "grt_01M7K8GX2TGN4ZKYDWYR2J4GMC",
      "kind": "verify",
      "amount": 180,
      "currency": "USD",
      "window_start": "2026-11-01T00:00:00.000Z",
      "decision_id": "dec_01M7K8GXD4MQ2G9RES0WD1VM95",
      "assessment_id": null,
      "checkout_approval_id": null,
      "jti": "794fbd50-9237-4759-b4d5-f83186bad082",
      "created_at": "2026-11-16T22:44:25.124Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List the mandate limits' versions

`GET /v1/mandate/settings/limits/versions`

The versions of the account's mandate limits, newest first, with where each was written (`source`: the console, the API or a rules embed session). A sandbox draft group's waiting drafts are listed only with `draft_group` naming that group.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `draft_group` | query | string | no | Sandbox. Also list the drafts waiting in this draft group (a rules embed session minted with `rules.draft_group`, the live demo's per-visitor drafts). Without it, the groups' unpublished drafts are left out. 1 to 64 characters. |

### Returns

The versions, newest first.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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 "$PROVENANCE_API/v1/mandate/settings/limits/versions" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits/versions`, {
  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/limits/versions", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

## Remove a trusted outside agent

`DELETE /v1/mandate/trusted_agents/{id}`

Takes the agent off the company's list. Hand-offs to it are asked again; grants already minted stay as they are. Needs an admin key or an owner or admin session.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The trusted agent's ID (`tra_`). |

### Returns

The trusted agent is removed.

### 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)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`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 DELETE "$PROVENANCE_API/v1/mandate/trusted_agents/tra_01M7Z8C2D4F6H8J0K2M4N6P8Q0" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

**Python**

```python
import os
import httpx

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

### Response 200

```json
{
  "id": "tra_01M7Z8C2D4F6H8J0K2M4N6P8Q0",
  "object": "trusted_agent",
  "deleted": true
}
```

## Delegate a mandate to a subagent

`POST /v1/mandate/grants/{id}/delegate`

Mints a narrower child mandate for a subagent, at most 4 levels deep and 50 per parent. With `receiver` it goes to an agent outside the account: the grantor is asked first (`202`), and the same call with `handoff_id` mints it after a yes. See [outside agents](https://provenanceauth.com/docs/mandate/guides/hand-a-grant-to-an-outside-agent.md).

Auth: an API key is optional.

### 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). |
| `DPoP` | header | string | no | A DPoP proof (RFC 9449) from the grant's holder key, when the grant is holder-bound (`holder_jkt`): an ES256 `dpop+jwt` naming this request (`htm`, `htu`), `iat` within 60 seconds, a fresh `jti`, and `ath`, the SHA-256 of the grant token sent. One per request. See [bind a grant to its holder](https://provenanceauth.com/docs/mandate/guides/bind-a-grant-to-its-holder.md). |
| `Content-Digest` | header | string | no | Holder proof: `sha-256=:<base64>:` of the request body as sent (RFC 9530). |
| `Signature-Input` | header | string | no | Holder proof: the signature's covered components and parameters (`created`, `expires`, `keyid`, `nonce`, `tag="web-bot-auth"`). |
| `Signature` | header | string | no | Holder proof: the agent's Ed25519 signature. |
| `Signature-Agent` | header | string | no | Holder proof: the agent's directory URL, as registering its key returned it. |
| `id` | path | string | yes | The parent mandate's ID. |
| `agent_session_id` | body | string | yes | The subagent's session. The child mandate works only for it. |
| `purpose` | body | string | yes | What the subagent is working on, in plain text ("Find A4 paper prices at three stores"). The person sees it when the subagent asks for approval. |
| `purpose_tags` | body | array of strings | no | Up to 10 of the parent's action types or counterparties the task is about. |
| `agent_id` | body | string | no | The registered agent that holds the child. |
| `constraints` | body | object | no | The child's limits. Each field is optional and inherits the parent's value when left out. Caps can't be higher, the budget window can't be longer, lists must be within the parent's, and the expiry can't be later. `schedule` and check-ins are always inherited. |
| `constraints.max_amount` | body | number \| null | no | The largest single action. Null only when the parent has no cap. |
| `constraints.budget_amount` | body | number \| null | no | The budget per window. Null only when the parent has no budget. |
| `constraints.budget_window` | body | enum | no | The budget window: the parent's or shorter. One of `day`, `week`, `month`. |
| `constraints.allowed_action_types` | body | array of strings | no | Within the parent's; empty inherits them. |
| `constraints.allowed_counterparties` | body | array of strings \| null | no | Within the parent's; null inherits them. |
| `constraints.allowed_mcc` | body | array of objects | no | Kinds of merchant by MCC (groups or ranges), each inside the parent's ranges; left out inherits them. |
| `constraints.allowed_mcc.group` | body | string | no | A group by name when sending (`lodging`); stored on each of its ranges. |
| `constraints.allowed_mcc.from` | body | string | no | The first MCC in the range. |
| `constraints.allowed_mcc.to` | body | string | no | The last MCC in the range (the same as `from` for one code). |
| `constraints.allowed_mcc.name` | body | string | no | The plain name ("Lodging"). |
| `constraints.allowed_countries` | body | array of string \| objects | no | Merchant countries, each one of the parent's; left out inherits them. |
| `constraints.allowed_countries.code` | body | string | no | The ISO 3166-1 numeric code (`620`). |
| `constraints.allowed_countries.alpha2` | body | string | no | The alpha-2 code (`PT`), for display. |
| `constraints.blocked_mcc` | body | array of objects | no | More MCC ranges to refuse. Stored with the parent's (a child can't remove a block). |
| `constraints.blocked_mcc.group` | body | string | no | A group by name when sending (`lodging`); stored on each of its ranges. |
| `constraints.blocked_mcc.from` | body | string | no | The first MCC in the range. |
| `constraints.blocked_mcc.to` | body | string | no | The last MCC in the range (the same as `from` for one code). |
| `constraints.blocked_mcc.name` | body | string | no | The plain name ("Lodging"). |
| `constraints.blocked_counterparties` | body | array of strings | no | More merchants to refuse. Stored with the parent's. |
| `constraints.blocked_countries` | body | array of string \| objects | no | More merchant countries to refuse. Stored with the parent's. |
| `constraints.blocked_countries.code` | body | string | no | The ISO 3166-1 numeric code (`620`). |
| `constraints.blocked_countries.alpha2` | body | string | no | The alpha-2 code (`PT`), for display. |
| `constraints.service_window` | body | object | no | The dates of what is bought, inside the parent's; left out inherits them. |
| `constraints.service_window.from` | body | string | yes | On or after the parent's. |
| `constraints.service_window.to` | body | string | yes | On or before the parent's. |
| `constraints.expires_at` | body | timestamp | no | No later than the parent's. |
| `max_depth` | body | integer | no | The deepest level its own subtree may reach (between its depth and the parent's limit). |
| `run_id` | body | string | no | The run the child joins. It inherits the parent's run when left out, and must match it when both are set. |
| `budget` | body | object | no | A budget's two settings, the same on company grants and on a person's subagents. `allocation`: is the money set aside for this budget (`reserved`, so its siblings can't spend it) or drawn from what the parent has left (`shared`, "Flexible share")? `at_limit`: when it reaches its amount, does it `stop` (refuse anything past it), `ask` (ask the person, or the grant's approver, up to `ask_up_to` past it, then refuse) or `continue` (go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour. |
| `budget.allocation` | body | enum | no | `reserved`: set aside from the parent; siblings can't spend it. `shared`: drawn from what the parent has left. One of `reserved`, `shared`. |
| `budget.at_limit` | body | enum | no | `stop`: refuse past the amount. `ask`: ask the person, refusing past `ask_up_to`. `continue`: go past without asking while every budget above has room. One of `stop`, `ask`, `continue`. |
| `budget.ask_up_to` | body | object \| null | no | With `ask` only: how far past the amount a person may still be asked, as a percentage of it (`percent`, 20 by default when left out) or a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount the parent has room for. |
| `budget.ask_up_to.percent` | body | number | no | The margin, in percent of the amount (10: ask up to 1.1 times it). |
| `budget.ask_up_to.amount` | body | number | no | The margin as a fixed amount in the grant's currency. |
| `parent_token` | body | string | no | Holder proof, in place of an account key: the parent mandate's own token, with a request signature (Web Bot Auth, RFC 9421) from a key registered to the agent the parent names (named at grant, `agent_id`). The signature covers `@method`, `@path`, `content-digest` and the `Signature-Agent` member and carries a nonce; the `Content-Digest` (RFC 9530, `sha-256`) matches the body as sent. The child records `delegated_by: holder`. An account with `require_holder_proof` refuses an account key (403 `holder_proof_required`); a console session still delegates. When the parent is holder-bound (`holder_jkt`), the request also carries the parent holder's DPoP proof (`DPoP`). |
| `holder_key` | body | object | no | Bind the child to its holder: the holder's P-256 public key as a JWK (`kty` `EC`, `crv` `P-256`, `x`, `y`; never `d`). Only its RFC 7638 thumbprint is kept (`holder_jkt`), and the token carries it as `cnf.jkt`. Every use then needs a DPoP proof from that key (the `DPoP` header). Leave it out for a bearer grant. Free on every plan. |
| `holder_key.kty` | body | enum | yes | The key type. One of `EC`. |
| `holder_key.crv` | body | enum | yes | The curve. One of `P-256`. |
| `holder_key.x` | body | string | yes | The x coordinate, base64url (32 bytes). |
| `holder_key.y` | body | string | yes | The y coordinate, base64url (32 bytes). |
| `receiver` | body | object | no | Hand the child to an agent outside the account. `provenance_agent`: an agent registered in another account (`agent_id`); the grantor sees its registry name and operator. `key`: an agent named only by its key, with its `name` and `origin` (`https://…`); the grantor sees them marked unverified. An agent in your own account is delegated to with `agent_id` instead. Needs `holder_key` (the receiver's key), and `max_depth` is left out or the child's own depth: an outside agent can't hand it on. Refused with `403 external_delegation_refused` when the account's `delegation.external` is `refuse`. |
| `receiver.kind` | body | enum | no | An agent registered in another account. One of `provenance_agent`. |
| `receiver.agent_id` | body | string | no | The registered agent. |
| `receiver.name` | body | string | no | The name it declared. |
| `receiver.origin` | body | string | no | The https origin it declared (`https://agent.example`). |
| `offline_checks` | body | enum | no | With `receiver`: whether stores may check the grant offline. `refused`: its token says `status_check: "online"`, so every verifier checks its status online first and every purchase counts against the budget. `allowed`: purchases at stores that check offline aren't counted, and they learn of a revoke only when they check online. Left out: `allowed` only when the child's budget (its own or the tightest above it) is at or under the account's `external_online_above` (0 by default), else `refused`. The grantor sees the choice and what it costs. One of `allowed`, `refused`. |
| `handoff_id` | body | string | no | With `receiver`: the hand-off the first call answered with, to mint the grant after the grantor's yes. The rest of the body must be what the grantor was asked about. |
| `limits_version` | body | integer | no | Sandbox only (`400` in live): a version of the account's mandate limits, a draft included, to apply instead of the live version. The account's published limits fill what a child leaves out (the share mode, the merchant lists, a provisioned cap's own budget setting) and cap the budgets handed on together (`mandate_limits_cap_exceeded`). |
| `draft_group` | body | string | no | With `limits_version`: the draft's group, when it was saved in one (a draft of another group is `400`). |

### Returns

The child mandate, its chain, and its token. The token is shown only once.

### 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)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`usage_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#usage_limit_reached)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`grant_invalid`](https://provenanceauth.com/docs/platform/errors.md#grant_invalid)
- [`agent_suspended`](https://provenanceauth.com/docs/platform/errors.md#agent_suspended)
- [`purpose_required`](https://provenanceauth.com/docs/platform/errors.md#purpose_required)
- [`purpose_tags_exceed_parent`](https://provenanceauth.com/docs/platform/errors.md#purpose_tags_exceed_parent)
- [`delegation_exceeds_parent`](https://provenanceauth.com/docs/platform/errors.md#delegation_exceeds_parent)
- [`delegation_depth_exceeded`](https://provenanceauth.com/docs/platform/errors.md#delegation_depth_exceeded)
- [`delegation_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#delegation_limit_reached)
- [`mandate_limits_cap_exceeded`](https://provenanceauth.com/docs/platform/errors.md#mandate_limits_cap_exceeded)
- [`external_delegation_refused`](https://provenanceauth.com/docs/platform/errors.md#external_delegation_refused)
- [`external_delegation_declined`](https://provenanceauth.com/docs/platform/errors.md#external_delegation_declined)
- [`external_delegation_used`](https://provenanceauth.com/docs/platform/errors.md#external_delegation_used)
- [`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",
      "currency": "USD",
      "allowed_action_types": [
        "quote",
        "purchase"
      ],
      "allowed_counterparties": [
        "paper.example",
        "office.example"
      ],
      "allowed_mcc": [
        {
          "group": "office_supplies"
        }
      ],
      "blocked_mcc": [
        {
          "group": "cash_like"
        }
      ],
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID/delegate" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_session_id": "sess_paperfinder_1",
    "purpose": "Find A4 paper prices at three stores",
    "purpose_tags": [
      "quote"
    ],
    "budget": {
      "allocation": "reserved",
      "at_limit": "ask",
      "ask_up_to": {
        "percent": 10
      }
    },
    "constraints": {
      "max_amount": 40,
      "budget_amount": 60,
      "allowed_action_types": [
        "quote"
      ],
      "blocked_counterparties": [
        "pawn.example"
      ]
    }
  }'
```

**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",
      "currency": "USD",
      "allowed_action_types": [
        "quote",
        "purchase"
      ],
      "allowed_counterparties": [
        "paper.example",
        "office.example"
      ],
      "allowed_mcc": [
        {
          "group": "office_supplies"
        }
      ],
      "blocked_mcc": [
        {
          "group": "cash_like"
        }
      ],
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegate`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "agent_session_id": "sess_paperfinder_1",
    "purpose": "Find A4 paper prices at three stores",
    "purpose_tags": [
      "quote"
    ],
    "budget": {
      "allocation": "reserved",
      "at_limit": "ask",
      "ask_up_to": {
        "percent": 10
      }
    },
    "constraints": {
      "max_amount": 40,
      "budget_amount": 60,
      "allowed_action_types": [
        "quote"
      ],
      "blocked_counterparties": [
        "pawn.example"
      ]
    }
  }),
})).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",
        "currency": "USD",
        "allowed_action_types": [
            "quote",
            "purchase"
        ],
        "allowed_counterparties": [
            "paper.example",
            "office.example"
        ],
        "allowed_mcc": [
            {
                "group": "office_supplies"
            }
        ],
        "blocked_mcc": [
            {
                "group": "cash_like"
            }
        ],
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "agent_session_id": "sess_paperfinder_1",
    "purpose": "Find A4 paper prices at three stores",
    "purpose_tags": [
        "quote"
    ],
    "budget": {
        "allocation": "reserved",
        "at_limit": "ask",
        "ask_up_to": {
            "percent": 10
        }
    },
    "constraints": {
        "max_amount": 40,
        "budget_amount": 60,
        "allowed_action_types": [
            "quote"
        ],
        "blocked_counterparties": [
            "pawn.example"
        ]
    }
}).json()
```

### Response 201

```json
{
  "id": "grt_01M8G6BRV834PPB6WNCVEHDTV1",
  "object": "grant",
  "status": "active",
  "device_id": "dev_00000000000000000000000000000001",
  "agent_session_id": "sess_paperfinder_1",
  "constraints": {
    "max_amount": 40,
    "budget_amount": 60,
    "budget_window": "month",
    "allowed_action_types": [
      "quote"
    ],
    "allowed_counterparties": [
      "paper.example",
      "office.example"
    ],
    "schedule": null,
    "currency": "USD",
    "over_limit": {
      "budget": {
        "action": "ask",
        "refuse_over": {
          "percent": 10
        }
      }
    },
    "allowed_mcc": [
      {
        "from": "5111",
        "to": "5111",
        "name": "Office supplies",
        "group": "office_supplies"
      },
      {
        "from": "5943",
        "to": "5943",
        "name": "Office supplies",
        "group": "office_supplies"
      }
    ],
    "blocked_mcc": [
      {
        "from": "6051",
        "to": "6051",
        "name": "Cash-like",
        "group": "cash_like"
      }
    ],
    "blocked_counterparties": [
      "pawn.example"
    ],
    "expires_at": "2027-12-31T23:59:59Z"
  },
  "approval_context": null,
  "remaining_budget": 60,
  "created_at": "2026-11-28T04:24:37.992Z",
  "expires_at": "2027-12-31T23:59:59Z",
  "purpose": "Find A4 paper prices at three stores",
  "parent_grant_id": "grt_01M8G6BRTQ1AKZ3A82716YEZ6F",
  "root_grant_id": "grt_01M8G6BRTQ1AKZ3A82716YEZ6F",
  "depth": 1,
  "purpose_tags": [
    "quote"
  ],
  "budget": {
    "allocation": "reserved",
    "at_limit": "ask",
    "ask_up_to": {
      "percent": 10
    }
  },
  "reserved_amount": 60,
  "delegated_by": "account_key",
  "chain": [
    {
      "mandate_id": "grt_01M8G6BRTQ1AKZ3A82716YEZ6F",
      "agent": null,
      "purpose": "Restock printer paper for the office"
    },
    {
      "mandate_id": "grt_01M8G6BRV834PPB6WNCVEHDTV1",
      "agent": null,
      "purpose": "Find A4 paper prices at three stores"
    }
  ],
  "mandate_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0Iiwia2lkIjoiMGJiMDQ4MjQ2ODdhZmM3ZCJ9.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsImp0aSI6ImdydF8wMU04RzZCUlY4MzRQUEI2V05DVkVIRFRWMSIsInN1YiI6ImFub25feWtodjZlNXdtd2JkdGwyM3dmaXFvZ2d3Y2YiLCJpYXQiOjE3OTU4Mzk4NzcsImV4cCI6MTgzMDI5NzU5OSwibWFuZGF0ZSI6dHJ1ZSwiY29uc3RyYWludHMiOnsibWF4X2Ftb3VudCI6NDAsImJ1ZGdldF9hbW91bnQiOjYwLCJidWRnZXRfd2luZG93IjoibW9udGgiLCJhbGxvd2VkX2FjdGlvbl90eXBlcyI6WyJxdW90ZSJdLCJhbGxvd2VkX2NvdW50ZXJwYXJ0aWVzIjpbInBhcGVyLmV4YW1wbGUiLCJvZmZpY2UuZXhhbXBsZSJdLCJzY2hlZHVsZSI6bnVsbCwib3Zlcl9saW1pdCI6eyJidWRnZXQiOnsiYWN0aW9uIjoiYXNrIiwicmVmdXNlX292ZXIiOnsicGVyY2VudCI6MTB9fX0sImV4cGlyZXNfYXQiOiIyMDI3LTEyLTMxVDIzOjU5OjU5WiJ9LCJyaXNrIjp7InNjb3JlIjozMCwiYWN0aW9uIjoiYWxsb3cifSwicHVycG9zZV9oYXNoIjoiZTcxMTA5ZTM5ZDljYjEwZjRmYWJiZTlmNmMwOTE5YWFiN2U1YjZiNzRkNzRiZWQ3ZDkxYWZhMGM3MWJhZDAyNyIsInBhcmVudCI6ImdydF8wMU04RzZCUlRRMUFLWjNBODI3MTZZRVo2RiIsInJvb3Rfc3ViIjoiYW5vbl9pY2xybjJmbGVoYmM3eTd3cHg1YzZ6aHd0ZiIsImNoYWluIjpbeyJtYW5kYXRlX2lkIjoiZ3J0XzAxTThHNkJSVFExQUtaM0E4MjcxNllFWjZGIiwiYWdlbnQiOm51bGwsInB1cnBvc2UiOiJSZXN0b2NrIHByaW50ZXIgcGFwZXIgZm9yIHRoZSBvZmZpY2UifSx7Im1hbmRhdGVfaWQiOiJncnRfMDFNOEc2QlJWODM0UFBCNldOQ1ZFSERUVjEiLCJhZ2VudCI6bnVsbCwicHVycG9zZSI6IkZpbmQgQTQgcGFwZXIgcHJpY2VzIGF0IHRocmVlIHN0b3JlcyJ9XSwiZGVwdGgiOjF9.9xvBSUn1GY9w-RoiTE3ZXvcqtluS3E6LYpKtoQTPKDc7ddph1YpGCLP9AJjsbLXaUXqK2Q1-6uhFucMI0ihRvg"
}
```

## Issue a grant as open AP2 mandates

`POST /v1/mandate/grants/{id}/ap2_open_mandates`

Signs a holder-bound grant as an open AP2 Payment Mandate (its limit and payees as constraints, its token unchanged) and, when it names merchants, an open Checkout Mandate, each bound to the holder key and ending with the grant. Send the grant token and a DPoP proof from its holder. Free. See [issue AP2 mandates](https://provenanceauth.com/docs/mandate/guides/issue-ap2-mandates.md#open-mandates-from-a-grant).

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `DPoP` | header | string | no | A DPoP proof (RFC 9449) from the grant's holder key, when the grant is holder-bound (`holder_jkt`): an ES256 `dpop+jwt` naming this request (`htm`, `htu`), `iat` within 60 seconds, a fresh `jti`, and `ath`, the SHA-256 of the grant token sent. One per request. See [bind a grant to its holder](https://provenanceauth.com/docs/mandate/guides/bind-a-grant-to-its-holder.md). |
| `id` | path | string | yes | The grant's ID. |
| `mandate_token` | body | string | yes | The grant's token, as creating it returned it (it rides in the open Payment Mandate unchanged). |
| `holder_key` | body | object | yes | The grant's holder key (P-256 public JWK); its thumbprint must be the grant's `holder_jkt`. |
| `currency` | body | string | yes | ISO 4217: AP2 amounts carry a currency, a grant doesn't. |
| `payees` | body | array of objects | no | AP2 Merchant objects for the grant's allowed counterparties (an `id` and a `name` each). |
| `payees.id` | body | string | yes | The counterparty id the grant allows. |
| `payees.name` | body | string | yes | What the person sees. |
| `payees.website` | body | string | no | The merchant's origin. |

### Returns

The open mandates.

### 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)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`ap2_mandates_not_issuable`](https://provenanceauth.com/docs/platform/errors.md#ap2_mandates_not_issuable)
- [`ap2_issuer_unconfigured`](https://provenanceauth.com/docs/platform/errors.md#ap2_issuer_unconfigured)
- [`dpop_proof_required`](https://provenanceauth.com/docs/platform/errors.md#dpop_proof_required)
- [`dpop_proof_invalid`](https://provenanceauth.com/docs/platform/errors.md#dpop_proof_invalid)
- [`holder_mismatch`](https://provenanceauth.com/docs/platform/errors.md#holder_mismatch)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -X POST "$PROVENANCE_API/v1/mandate/grants/grt_01M81A3B5C7D9E1F3G5H7J9K1M/ap2_open_mandates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mandate_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0In0.eyJqdGkiOiJncnRfMDFNODFBM0I1QzdEOUUxRjNHNUg3SjlLMU0iLCJtYW5kYXRlIjp0cnVlfQ.c2ln",
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    },
    "currency": "USD",
    "payees": [
      {
        "id": "harborbean",
        "name": "Harbor Bean",
        "website": "https://harborbean.example"
      }
    ]
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/grt_01M81A3B5C7D9E1F3G5H7J9K1M/ap2_open_mandates`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "mandate_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0In0.eyJqdGkiOiJncnRfMDFNODFBM0I1QzdEOUUxRjNHNUg3SjlLMU0iLCJtYW5kYXRlIjp0cnVlfQ.c2ln",
    "holder_key": {
      "kty": "EC",
      "crv": "P-256",
      "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
      "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    },
    "currency": "USD",
    "payees": [
      {
        "id": "harborbean",
        "name": "Harbor Bean",
        "website": "https://harborbean.example"
      }
    ]
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/grants/grt_01M81A3B5C7D9E1F3G5H7J9K1M/ap2_open_mandates", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
    "mandate_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0In0.eyJqdGkiOiJncnRfMDFNODFBM0I1QzdEOUUxRjNHNUg3SjlLMU0iLCJtYW5kYXRlIjp0cnVlfQ.c2ln",
    "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
    },
    "currency": "USD",
    "payees": [
        {
            "id": "harborbean",
            "name": "Harbor Bean",
            "website": "https://harborbean.example"
        }
    ]
}).json()
```

### Response 201

```json
{
  "object": "ap2_open_mandates",
  "grant_id": "grt_01M81A3B5C7D9E1F3G5H7J9K1M",
  "open_payment_mandate": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImRjK3NkLWp3dCIsImtpZCI6IjNjMWYwYTliN2QyZTRmNjAifQ.eyJ2Y3QiOiJtYW5kYXRlLnBheW1lbnQub3Blbi4xIn0.c2ln~WyJzYWx0Iix7fV0~",
  "open_checkout_mandate": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImRjK3NkLWp3dCIsImtpZCI6IjNjMWYwYTliN2QyZTRmNjAifQ.eyJ2Y3QiOiJtYW5kYXRlLmNoZWNrb3V0Lm9wZW4uMSJ9.c2ln~WyJzYWx0Iix7fV0~",
  "holder_jkt": "j_5HRy9_SuFFX3DvEoS7HPlcI6FM8Q9V0llPx2aWTrE",
  "not_mapped": [
    "constraints.budget_amount + budget_window",
    "payment.reference (required by AP2; add it with checkoutReference once the open Checkout Mandate exists)"
  ],
  "expires_at": "2026-11-29T10:00:00.000Z",
  "issuer_jwks_url": "https://api.provenanceauth.com/.well-known/ap2/jwks.json"
}
```

## Propose a delegation structure

`POST /v1/mandate/grants/{id}/delegation_proposals`

An orchestrator proposes the children it wants under a mandate it holds, each checked as a delegation would be, with the reserved sum rule across the proposal. Nothing is minted until the mandate's person approves it with the passkey of the grant at the top of the chain, as proposed or edited. The person is told by text and email; `approve_url` is the hosted page.

Auth: an API key is optional.

### 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). |
| `Content-Digest` | header | string | no | Holder proof: `sha-256=:<base64>:` of the request body as sent (RFC 9530). |
| `Signature-Input` | header | string | no | Holder proof: the signature's covered components and parameters. |
| `Signature` | header | string | no | Holder proof: the agent's Ed25519 signature. |
| `Signature-Agent` | header | string | no | Holder proof: the agent's directory URL. |
| `id` | path | string | yes | The parent mandate's ID. |
| `approver` | body | object | no | Display only: the name of the person you expect to answer ("Maya Chen"). The run reads `waiting_on: "Maya Chen"` while the proposal waits, and your reads of the proposal return it as `approver`. Never shown on the plan page. |
| `approver.name` | body | string | no | One line of 1 to 100 characters. |
| `children` | body | array of objects | yes | The proposed children, in the order the person sees them. |
| `children.agent_id` | body | string | yes | A registered agent of the account that will hold the child. |
| `children.purpose` | body | string | yes | What the child is for. |
| `children.purpose_tags` | body | array of strings | no | Up to 10 of the parent's action types or counterparties. |
| `children.constraints` | body | object | no | The child's limits, as `POST /v1/mandate/grants/{id}/delegate` takes them. |
| `children.budget` | body | object | no | A budget's two settings, the same on company grants and on a person's subagents. `allocation`: is the money set aside for this budget (`reserved`, so its siblings can't spend it) or drawn from what the parent has left (`shared`, "Flexible share")? `at_limit`: when it reaches its amount, does it `stop` (refuse anything past it), `ask` (ask the person, or the grant's approver, up to `ask_up_to` past it, then refuse) or `continue` (go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour. |
| `children.budget.allocation` | body | enum | no | `reserved`: set aside from the parent; siblings can't spend it. `shared`: drawn from what the parent has left. One of `reserved`, `shared`. |
| `children.budget.at_limit` | body | enum | no | `stop`: refuse past the amount. `ask`: ask the person, refusing past `ask_up_to`. `continue`: go past without asking while every budget above has room. One of `stop`, `ask`, `continue`. |
| `children.budget.ask_up_to` | body | object \| null | no | With `ask` only: how far past the amount a person may still be asked, as a percentage of it (`percent`, 20 by default when left out) or a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount the parent has room for. |
| `children.budget.ask_up_to.percent` | body | number | no | The margin, in percent of the amount (10: ask up to 1.1 times it). |
| `children.budget.ask_up_to.amount` | body | number | no | The margin as a fixed amount in the grant's currency. |
| `children.max_depth` | body | integer | no | How deep its own subtree may go. |
| `supersedes` | body | string | no | A pending proposal on the same mandate this one replaces (it becomes `superseded`). |
| `expires_in` | body | integer | no | Seconds the proposal waits for the person (24 hours by default, never past the mandate's expiry). |
| `notify` | body | boolean | no | Tell the person by text and email. `false` when the agent sends `approve_url` itself. |
| `parent_token` | body | string | no | Holder proof, in place of an account key: the mandate's own token, with a request signature from a key registered to the agent the mandate names, as on `POST /v1/mandate/grants/{id}/delegate`. |
| `limits_version` | body | integer | no | Sandbox only (`400` in live): a version of the account's mandate limits, a draft included, to apply instead of the live version. The account's published limits fill what a child leaves out (the share mode, the merchant lists, a provisioned cap's own budget setting) and cap the budgets handed on together (`mandate_limits_cap_exceeded`). |
| `draft_group` | body | string | no | With `limits_version`: the draft's group, when it was saved in one (a draft of another group is `400`). |

### Returns

The proposal, the hosted page's link (shown once) and how the person was told.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`holder_proof_invalid`](https://provenanceauth.com/docs/platform/errors.md#holder_proof_invalid)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`delegation_exceeds_parent`](https://provenanceauth.com/docs/platform/errors.md#delegation_exceeds_parent)
- [`delegation_depth_exceeded`](https://provenanceauth.com/docs/platform/errors.md#delegation_depth_exceeded)
- [`delegation_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#delegation_limit_reached)
- [`mandate_limits_cap_exceeded`](https://provenanceauth.com/docs/platform/errors.md#mandate_limits_cap_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`purpose_tags_exceed_parent`](https://provenanceauth.com/docs/platform/errors.md#purpose_tags_exceed_parent)
- [`grant_invalid`](https://provenanceauth.com/docs/platform/errors.md#grant_invalid)
- [`proposal_closed`](https://provenanceauth.com/docs/platform/errors.md#proposal_closed)
- [`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/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Scout Flights", "category": "shopping_agent" }' > step.json
export FLIGHTS_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Scout Stays", "category": "shopping_agent" }' > step.json
export STAYS_ID=$(jq -r '.id' step.json)
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": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "allowed_mcc": [
        {
          "group": "airlines"
        },
        {
          "group": "lodging"
        }
      ],
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID/delegation_proposals" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"notify\": false,
    \"approver\": {
      \"name\": \"Maya Chen\"
    },
    \"children\": [
      {
        \"agent_id\": \"$FLIGHTS_ID\",
        \"purpose\": \"Book the flights\",
        \"budget\": {
          \"allocation\": \"shared\",
          \"at_limit\": \"continue\"
        },
        \"constraints\": {
          \"budget_amount\": 900,
          \"allowed_mcc\": [
            {
              \"group\": \"airlines\"
            }
          ]
        }
      },
      {
        \"agent_id\": \"$STAYS_ID\",
        \"purpose\": \"Book the stay\",
        \"budget\": {
          \"allocation\": \"reserved\",
          \"at_limit\": \"stop\"
        },
        \"constraints\": {
          \"budget_amount\": 1100,
          \"allowed_mcc\": [
            {
              \"group\": \"lodging\"
            }
          ],
          \"allowed_counterparties\": [
            \"casamarlinde.example\"
          ]
        }
      }
    ]
  }"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Scout Flights", "category": "shopping_agent" }),
})).json();
const flightsId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Scout Stays", "category": "shopping_agent" }),
})).json();
const staysId = step2.id;
const step3 = 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": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "allowed_mcc": [
        {
          "group": "airlines"
        },
        {
          "group": "lodging"
        }
      ],
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegation_proposals`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "notify": false,
    "approver": {
      "name": "Maya Chen"
    },
    "children": [
      {
        "agent_id": flightsId,
        "purpose": "Book the flights",
        "budget": {
          "allocation": "shared",
          "at_limit": "continue"
        },
        "constraints": {
          "budget_amount": 900,
          "allowed_mcc": [
            {
              "group": "airlines"
            }
          ]
        }
      },
      {
        "agent_id": staysId,
        "purpose": "Book the stay",
        "budget": {
          "allocation": "reserved",
          "at_limit": "stop"
        },
        "constraints": {
          "budget_amount": 1100,
          "allowed_mcc": [
            {
              "group": "lodging"
            }
          ],
          "allowed_counterparties": [
            "casamarlinde.example"
          ]
        }
      }
    ]
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Scout Flights",
    "category": "shopping_agent"
}).json()
flights_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Scout Stays",
    "category": "shopping_agent"
}).json()
stays_id = step2["id"]
step3 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "allowed_mcc": [
            {
                "group": "airlines"
            },
            {
                "group": "lodging"
            }
        ],
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
mandate_id = step3["id"]
data = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegation_proposals", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "notify": False,
    "approver": {
        "name": "Maya Chen"
    },
    "children": [
        {
            "agent_id": flights_id,
            "purpose": "Book the flights",
            "budget": {
                "allocation": "shared",
                "at_limit": "continue"
            },
            "constraints": {
                "budget_amount": 900,
                "allowed_mcc": [
                    {
                        "group": "airlines"
                    }
                ]
            }
        },
        {
            "agent_id": stays_id,
            "purpose": "Book the stay",
            "budget": {
                "allocation": "reserved",
                "at_limit": "stop"
            },
            "constraints": {
                "budget_amount": 1100,
                "allowed_mcc": [
                    {
                        "group": "lodging"
                    }
                ],
                "allowed_counterparties": [
                    "casamarlinde.example"
                ]
            }
        }
    ]
}).json()
```

### Response 201

```json
{
  "id": "dgp_01M8G6BGXGNGT8MC0MPHH6GXPV",
  "object": "delegation_proposal",
  "status": "pending",
  "parent_grant_id": "grt_01M8G6BGX8S7PP89Q4AVE3X1K1",
  "root_grant_id": "grt_01M8G6BGX8S7PP89Q4AVE3X1K1",
  "agent_id": null,
  "proposed_by": "account_key",
  "proposed": {
    "children": [
      {
        "agent_id": "agt_01M8G6BGWZ161Q7SVMS7CZS5XB",
        "purpose": "Book the flights",
        "purpose_tags": [],
        "max_depth": null,
        "constraints": {
          "budget_amount": 900,
          "allowed_mcc": [
            {
              "from": "3000",
              "to": "3299",
              "name": "Airlines",
              "group": "airlines"
            },
            {
              "from": "4511",
              "to": "4511",
              "name": "Airlines",
              "group": "airlines"
            }
          ]
        },
        "budget": {
          "allocation": "shared",
          "at_limit": "continue",
          "ask_up_to": null
        }
      },
      {
        "agent_id": "agt_01M8G6BGX5R52S9DQ8M0MM7M4N",
        "purpose": "Book the stay",
        "purpose_tags": [],
        "max_depth": null,
        "constraints": {
          "budget_amount": 1100,
          "allowed_counterparties": [
            "casamarlinde.example"
          ],
          "allowed_mcc": [
            {
              "from": "3501",
              "to": "3999",
              "name": "Lodging",
              "group": "lodging"
            },
            {
              "from": "7011",
              "to": "7011",
              "name": "Lodging",
              "group": "lodging"
            }
          ],
          "over_limit": {
            "budget": {
              "action": "refuse",
              "refuse_over": null
            }
          }
        },
        "budget": {
          "allocation": "reserved",
          "at_limit": "stop",
          "ask_up_to": null
        }
      }
    ]
  },
  "proposed_hash": "020ba485abd420587b15114b59fdb13666d6891c660d51b1dc00ab9963bbb6e6",
  "approved": null,
  "approved_hash": null,
  "edits": [],
  "edited": false,
  "minted": [],
  "parent_change": null,
  "supersedes": null,
  "superseded_by": null,
  "decided_via": null,
  "created_at": "2026-11-28T04:24:29.872Z",
  "expires_at": "2026-11-29T04:24:29.872Z",
  "decided_at": null,
  "approver": {
    "name": "Maya Chen"
  },
  "approval_context": null,
  "approve_url": "http://localhost:5173/approve/p/dgp_01M8G6BGXGNGT8MC0MPHH6GXPV?t=dgl_XYCpJ4rMFobtwODpA3T418KttRR5-9Oy_KRPJM-1vaY",
  "short_url": null,
  "delivery": []
}
```

## Check a delegation proposal

`POST /v1/mandate/delegation_proposals/{id}/check`

The person's structure (edited, or as proposed) checked against the mandate as it is now or as raised, nothing stored: every problem by child and field, what is left to reserve, the edits, the structure's hash and, with no problems, the passkey challenge bound to it. The page sends its link token; the console its session.

Auth: an API key is optional.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The proposal's ID. |
| `token` | body | string | no | The hosted page's link token (`t` in its link). Left out in a signed-in console session. |
| `children` | body | array of objects | no | The structure as the person edited it. Left out: as proposed. Each proposed child appears at most once by `proposed_index` (left out or `removed`: removed); a child with no index is added. Every child stays within the parent (or the parent as raised). |
| `children.proposed_index` | body | integer | no | The proposed child this one is; left out for a child the person adds. |
| `children.removed` | body | boolean | no | true to remove a proposed child (or leave it out). |
| `children.agent_id` | body | string | no | The agent that holds it (another of the account's agents swaps it). |
| `children.purpose` | body | string | no | An added child's purpose (a proposed child keeps the agent's). |
| `children.purpose_tags` | body | array of strings | no | An added child's purpose tags. |
| `children.constraints` | body | object | no | The child's limits, as a delegate call takes them (replaces the proposed ones). |
| `children.budget` | body | object | no | A budget's two settings, the same on company grants and on a person's subagents. `allocation`: is the money set aside for this budget (`reserved`, so its siblings can't spend it) or drawn from what the parent has left (`shared`, "Flexible share")? `at_limit`: when it reaches its amount, does it `stop` (refuse anything past it), `ask` (ask the person, or the grant's approver, up to `ask_up_to` past it, then refuse) or `continue` (go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour. |
| `children.budget.allocation` | body | enum | no | `reserved`: set aside from the parent; siblings can't spend it. `shared`: drawn from what the parent has left. One of `reserved`, `shared`. |
| `children.budget.at_limit` | body | enum | no | `stop`: refuse past the amount. `ask`: ask the person, refusing past `ask_up_to`. `continue`: go past without asking while every budget above has room. One of `stop`, `ask`, `continue`. |
| `children.budget.ask_up_to` | body | object \| null | no | With `ask` only: how far past the amount a person may still be asked, as a percentage of it (`percent`, 20 by default when left out) or a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount the parent has room for. |
| `children.budget.ask_up_to.percent` | body | number | no | The margin, in percent of the amount (10: ask up to 1.1 times it). |
| `children.budget.ask_up_to.amount` | body | number | no | The margin as a fixed amount in the grant's currency. |
| `children.max_depth` | body | integer \| null | no | How deep its own subtree may go. |
| `parent` | body | object | no | Raise the parent in the same approval (each only up): one passkey covers both. |
| `parent.budget_amount` | body | number | no | The parent's new budget. |
| `parent.refuse_over` | body | object \| null | no | The budget lock's new margin (`percent` or `amount`; null asks at any amount). |
| `parent.expires_at` | body | timestamp | no | The parent's new expiry. |

### Returns

The check.

### 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)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`proposal_closed`](https://provenanceauth.com/docs/platform/errors.md#proposal_closed)
- [`proposal_stale`](https://provenanceauth.com/docs/platform/errors.md#proposal_stale)
- [`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
curl -X POST "$PROVENANCE_API/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/check" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "dgl_example",
    "children": [
      {
        "proposed_index": 0,
        "constraints": {
          "budget_amount": 700
        }
      }
    ]
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/check`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "token": "dgl_example",
    "children": [
      {
        "proposed_index": 0,
        "constraints": {
          "budget_amount": 700
        }
      }
    ]
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/check", json={
    "token": "dgl_example",
    "children": [
        {
            "proposed_index": 0,
            "constraints": {
                "budget_amount": 700
            }
        }
    ]
}).json()
```

### Response 200

```json
{
  "object": "delegation_proposal_check",
  "ok": true,
  "problems": [],
  "available_to_reserve": 1300,
  "edits": [
    {
      "child": 0,
      "field": "budget_amount",
      "from": 900,
      "to": 700
    }
  ],
  "approved_hash": "2b9e4f61c0d8a7e3b5f2c9d1a6e8b4f7c3d0a9e2b6f1c8d5a7e4b3f0c9d2a1e6",
  "biometric_challenge": "q1b7m0Yh3c2Zk9e8d7c6b5a4f3e2d1c0"
}
```

## Approve a delegation proposal

`POST /v1/mandate/delegation_proposals/{id}/approve`

The person's yes: the passkey of the grant at the top of the chain answers the challenge `check` returned for this exact structure. Every child is minted in one step with any raise of the parent, or nothing (`stale`). Children record `delegated_by: proposal`; `mandate.delegation_proposal.decided` tells the orchestrator.

Auth: an API key is optional.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The proposal's ID. |
| `token` | body | string | no | The hosted page's link token (`t` in its link). Left out in a signed-in console session. |
| `children` | body | array of objects | no | The structure as the person edited it. Left out: as proposed. Each proposed child appears at most once by `proposed_index` (left out or `removed`: removed); a child with no index is added. Every child stays within the parent (or the parent as raised). |
| `children.proposed_index` | body | integer | no | The proposed child this one is; left out for a child the person adds. |
| `children.removed` | body | boolean | no | true to remove a proposed child (or leave it out). |
| `children.agent_id` | body | string | no | The agent that holds it (another of the account's agents swaps it). |
| `children.purpose` | body | string | no | An added child's purpose (a proposed child keeps the agent's). |
| `children.purpose_tags` | body | array of strings | no | An added child's purpose tags. |
| `children.constraints` | body | object | no | The child's limits, as a delegate call takes them (replaces the proposed ones). |
| `children.budget` | body | object | no | A budget's two settings, the same on company grants and on a person's subagents. `allocation`: is the money set aside for this budget (`reserved`, so its siblings can't spend it) or drawn from what the parent has left (`shared`, "Flexible share")? `at_limit`: when it reaches its amount, does it `stop` (refuse anything past it), `ask` (ask the person, or the grant's approver, up to `ask_up_to` past it, then refuse) or `continue` (go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour. |
| `children.budget.allocation` | body | enum | no | `reserved`: set aside from the parent; siblings can't spend it. `shared`: drawn from what the parent has left. One of `reserved`, `shared`. |
| `children.budget.at_limit` | body | enum | no | `stop`: refuse past the amount. `ask`: ask the person, refusing past `ask_up_to`. `continue`: go past without asking while every budget above has room. One of `stop`, `ask`, `continue`. |
| `children.budget.ask_up_to` | body | object \| null | no | With `ask` only: how far past the amount a person may still be asked, as a percentage of it (`percent`, 20 by default when left out) or a fixed `amount` in the grant's currency. Exactly one of the two. `null` asks at any amount the parent has room for. |
| `children.budget.ask_up_to.percent` | body | number | no | The margin, in percent of the amount (10: ask up to 1.1 times it). |
| `children.budget.ask_up_to.amount` | body | number | no | The margin as a fixed amount in the grant's currency. |
| `children.max_depth` | body | integer \| null | no | How deep its own subtree may go. |
| `parent` | body | object | no | Raise the parent in the same approval (each only up): one passkey covers both. |
| `parent.budget_amount` | body | number | no | The parent's new budget. |
| `parent.refuse_over` | body | object \| null | no | The budget lock's new margin (`percent` or `amount`; null asks at any amount). |
| `parent.expires_at` | body | timestamp | no | The parent's new expiry. |
| `biometric_challenge` | body | string | yes | The challenge `check` returned for this structure. |
| `biometric_assertion` | body | object | yes | The passkey assertion of the person whose grant is at the top of the chain. |
| `biometric_assertion.authenticator_data` | body | string | yes | The base64url authenticatorData from the passkey assertion. |
| `biometric_assertion.client_data_json` | body | string | yes | The base64url clientDataJSON from the passkey ceremony. |
| `biometric_assertion.signature` | body | string | yes | The base64url signature from the passkey assertion. |

### Returns

The approved proposal with the minted children.

### Errors

- [`approver_not_linked`](https://provenanceauth.com/docs/platform/errors.md#approver_not_linked)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`dashboard_session_required`](https://provenanceauth.com/docs/platform/errors.md#dashboard_session_required)
- [`delegation_exceeds_parent`](https://provenanceauth.com/docs/platform/errors.md#delegation_exceeds_parent)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`proposal_closed`](https://provenanceauth.com/docs/platform/errors.md#proposal_closed)
- [`proposal_stale`](https://provenanceauth.com/docs/platform/errors.md#proposal_stale)
- [`proposal_structure_mismatch`](https://provenanceauth.com/docs/platform/errors.md#proposal_structure_mismatch)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`trial_ended`](https://provenanceauth.com/docs/platform/errors.md#trial_ended)

### Request

**curl**

```bash
curl -X POST "$PROVENANCE_API/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/approve" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "dgl_example",
    "children": [
      {
        "proposed_index": 0,
        "constraints": {
          "budget_amount": 700
        }
      }
    ],
    "biometric_challenge": "q1b7m0Yh3c2Zk9e8d7c6b5a4f3e2d1c0",
    "biometric_assertion": {
      "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
      "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
      "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/approve`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "token": "dgl_example",
    "children": [
      {
        "proposed_index": 0,
        "constraints": {
          "budget_amount": 700
        }
      }
    ],
    "biometric_challenge": "q1b7m0Yh3c2Zk9e8d7c6b5a4f3e2d1c0",
    "biometric_assertion": {
      "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
      "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
      "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/approve", json={
    "token": "dgl_example",
    "children": [
        {
            "proposed_index": 0,
            "constraints": {
                "budget_amount": 700
            }
        }
    ],
    "biometric_challenge": "q1b7m0Yh3c2Zk9e8d7c6b5a4f3e2d1c0",
    "biometric_assertion": {
        "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
        "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
        "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
}).json()
```

### Response 200

```json
{
  "id": "dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P",
  "object": "delegation_proposal",
  "status": "approved",
  "parent_grant_id": "grt_01M7Q2ZJX5V8N3B6C9D2F4G7H1",
  "root_grant_id": "grt_01M7Q2ZJX5V8N3B6C9D2F4G7H1",
  "agent_id": "agt_01M7Q2ZJW0K3M6P9R2T5V8X1Z4",
  "proposed_by": "holder",
  "proposed": {
    "children": [
      {
        "agent_id": "agt_01M7Q2ZJW4A7D0G3J6M9P2S5V8",
        "purpose": "Book the flights",
        "purpose_tags": [],
        "budget": {
          "allocation": "shared",
          "at_limit": "continue",
          "ask_up_to": null
        },
        "max_depth": null,
        "constraints": {
          "budget_amount": 900
        }
      }
    ]
  },
  "proposed_hash": "6f1d0c3a9e2b7f45d8c1a0e9b3f6d2c7a4e8b1f0d9c6a3e7b2f5d8c1a4e7b0f3",
  "approved": {
    "children": [
      {
        "proposed_index": 0,
        "agent_id": "agt_01M7Q2ZJW4A7D0G3J6M9P2S5V8",
        "purpose": "Book the flights",
        "purpose_tags": [],
        "budget": {
          "allocation": "shared",
          "at_limit": "continue",
          "ask_up_to": null
        },
        "max_depth": null,
        "constraints": {
          "budget_amount": 700
        }
      }
    ]
  },
  "approved_hash": "2b9e4f61c0d8a7e3b5f2c9d1a6e8b4f7c3d0a9e2b6f1c8d5a7e4b3f0c9d2a1e6",
  "edits": [
    {
      "child": 0,
      "field": "budget_amount",
      "from": 900,
      "to": 700
    }
  ],
  "edited": true,
  "minted": [
    {
      "grant_id": "grt_01M7Q30A2B5C8D1E4F7G0H3J6K",
      "agent_id": "agt_01M7Q2ZJW4A7D0G3J6M9P2S5V8",
      "purpose": "Book the flights"
    }
  ],
  "parent_change": null,
  "supersedes": null,
  "superseded_by": null,
  "decided_via": "link",
  "created_at": "2026-11-17T18:04:11.212Z",
  "expires_at": "2026-11-18T18:04:11.212Z",
  "decided_at": "2026-11-17T18:09:42.530Z"
}
```

## Decline a delegation proposal

`POST /v1/mandate/delegation_proposals/{id}/decline`

The person's no: nothing is minted, the proposal keeps no edits, and `mandate.delegation_proposal.decided` tells the orchestrator. It may send a new proposal.

Auth: an API key is optional.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The proposal's ID. |
| `token` | body | string | no | The hosted page's link token (`t` in its link). Left out in a signed-in console session. |

### Returns

The declined proposal.

### 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)
- [`proposal_closed`](https://provenanceauth.com/docs/platform/errors.md#proposal_closed)
- [`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
curl -X POST "$PROVENANCE_API/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/decline" \
  -H "Content-Type: application/json" \
  -d '{ "token": "dgl_example" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/decline`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ "token": "dgl_example" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/decline", json={
    "token": "dgl_example"
}).json()
```

### Response 200

```json
{
  "id": "dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P",
  "object": "delegation_proposal",
  "status": "declined",
  "parent_grant_id": "grt_01M7Q2ZJX5V8N3B6C9D2F4G7H1",
  "root_grant_id": "grt_01M7Q2ZJX5V8N3B6C9D2F4G7H1",
  "agent_id": "agt_01M7Q2ZJW0K3M6P9R2T5V8X1Z4",
  "proposed_by": "holder",
  "proposed": {
    "children": [
      {
        "agent_id": "agt_01M7Q2ZJW4A7D0G3J6M9P2S5V8",
        "purpose": "Book the flights",
        "purpose_tags": [],
        "budget": {
          "allocation": "shared",
          "at_limit": "continue",
          "ask_up_to": null
        },
        "max_depth": null,
        "constraints": {
          "budget_amount": 900
        }
      }
    ]
  },
  "proposed_hash": "6f1d0c3a9e2b7f45d8c1a0e9b3f6d2c7a4e8b1f0d9c6a3e7b2f5d8c1a4e7b0f3",
  "approved": null,
  "approved_hash": null,
  "edits": [],
  "edited": false,
  "minted": [],
  "parent_change": null,
  "supersedes": null,
  "superseded_by": null,
  "decided_via": "link",
  "created_at": "2026-11-17T18:04:11.212Z",
  "expires_at": "2026-11-18T18:04:11.212Z",
  "decided_at": "2026-11-17T18:07:02.118Z"
}
```

## Clear an agent's holder binding

`DELETE /v1/mandate/holder_bindings/{agent_id}`

Puts the agent back on the default: your own agents get bearer grants, outside agents get grants bound to their key. Needs an admin key or an owner or admin session.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `agent_id` | path | string | yes | The agent. |

### Returns

The setting is cleared.

### 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)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`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 DELETE "$PROVENANCE_API/v1/mandate/holder_bindings/agt_01M7Z71YM4GVGFZ5D6PQQE0VZN" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

**Python**

```python
import os
import httpx

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

### Response 200

```json
{
  "id": "agt_01M7Z71YM4GVGFZ5D6PQQE0VZN",
  "object": "holder_binding",
  "deleted": true
}
```

## Revoke a device enrolment

`POST /v1/mandate/device_enrollments/{id}/revoke`

A pending link stops working; an enrolled phone's device is revoked, so its passkey approves nothing after (a grant naming it can't be approved or raised). Revoking twice changes nothing.

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

### Parameters

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

### Returns

The enrolment, revoked.

### 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)
- [`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/device_enrollments" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "display_name": "Maya", "reference": "ds_session_revoke" }' > step.json
export ENROLMENT_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/device_enrollments/$ENROLMENT_ID/revoke" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "display_name": "Maya", "reference": "ds_session_revoke" }),
})).json();
const enrolmentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments/${enrolmentId}/revoke`, {
  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/device_enrollments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "display_name": "Maya",
    "reference": "ds_session_revoke"
}).json()
enrollment_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/device_enrollments/{enrollment_id}/revoke", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "device_enrollment",
  "id": "denr_01M7QKD1XM8PF91F00E5PW12ZY",
  "status": "revoked",
  "display_name": "Maya",
  "reference": "ds_session_revoke",
  "device_id": null,
  "created_at": "2026-11-18T15:11:30.740Z",
  "expires_at": "2026-11-18T15:26:30.740Z",
  "enrolled_at": null,
  "revoked_at": "2026-11-18T15:11:30.751Z"
}
```

## Revoke a mandate

`POST /v1/mandate/grants/{id}/revoke`

Revokes a mandate and every mandate delegated below it. Every token authorized under any of them then fails verify with grant_revoked. The decision ledger gets a `revoke` row for each mandate below it that this stops, with `stopped_by` naming this mandate. Revoking again returns the same result and writes nothing more.

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 object's ID. |
| `reason` | body | string | yes | The reason given or recorded. |

### Returns

The object, now revoked.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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)

### 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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/mandate/grants/$MANDATE_ID/revoke" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "supplier contract ended" }'
```

**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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
      "max_amount": 400,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/revoke`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "reason": "supplier contract ended" }),
})).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",
    "agent_session_id": "sess_buyer_1",
    "constraints": {
        "max_amount": 400,
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/grants/{grant_id}/revoke", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "reason": "supplier contract ended"
}).json()
```

### Response 200

```json
{
  "id": "grt_01M7P1H0K7A5NPF12SGVEFEAFK",
  "object": "grant",
  "status": "revoked",
  "device_id": "dev_00000000000000000000000000000001",
  "agent_session_id": "sess_buyer_1",
  "constraints": {
    "max_amount": 400,
    "budget_amount": null,
    "budget_window": null,
    "allowed_action_types": [],
    "allowed_counterparties": null,
    "schedule": null,
    "expires_at": "2027-12-31T23:59:59Z"
  },
  "approval_context": null,
  "remaining_budget": null,
  "created_at": "2026-11-18T00:39:51.656Z",
  "expires_at": "2027-12-31T23:59:59Z"
}
```

## Check in a mandate heartbeat

`POST /v1/mandate/grants/{id}/heartbeat`

Records the person's passkey check-in for this period, which keeps the mandate active. A check-in soon after a lapse reactivates a suspended mandate.

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 object's ID. |
| `biometric_assertion` | body | object | yes | The passkey assertion over the challenge. |
| `biometric_assertion.authenticator_data` | body | string | no | The base64url authenticatorData from the passkey assertion. |
| `biometric_assertion.client_data_json` | body | string | no | The base64url clientDataJSON from the passkey ceremony. |
| `biometric_assertion.signature` | body | string | no | The base64url signature from the passkey assertion. |

### Returns

The check-in, with the mandate's status and when the next one is due.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`grant_invalid`](https://provenanceauth.com/docs/platform/errors.md#grant_invalid)
- [`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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/mandate/grants/grt_01M5QFJRZCB3FZ2V3J76K9JSFX/heartbeat" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "biometric_assertion": {
      "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
      "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
      "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/grt_01M5QFJRZCB3FZ2V3J76K9JSFX/heartbeat`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "biometric_assertion": {
      "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
      "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
      "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/grants/grt_01M5QFJRZCB3FZ2V3J76K9JSFX/heartbeat", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "biometric_assertion": {
        "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
        "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
        "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
}).json()
```

### Response 200

```json
{
  "object": "grant_heartbeat",
  "grant_id": "grt_01M5R0BZT2C8Q6W4NE9V3HKD7P",
  "status": "active",
  "event": "checked_in",
  "last_checkin_at": "2026-10-24T22:31:05.118Z",
  "next_checkin_due": "2026-10-31T22:31:05.118Z"
}
```

## Check a mandate's status without a key

`GET /v1/public/grants/{id}/status`

Returns whether a mandate can still be used, and the mandate above it that stops it. No API key is needed, so an agent asked by another agent can check the asker's mandate. Nothing else is returned. Limited per IP.

Auth: none. No API key needed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The mandate's ID (the token's `jti`). |

### Returns

The mandate's status.

### Errors

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

### Request

**curl**

```bash
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
      "max_amount": 80,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export PARENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants/$PARENT_ID/delegate" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_session_id": "sess_paperfinder_2",
    "purpose": "Find A4 paper prices at three stores"
  }' > step.json
export MANDATE_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/public/grants/$MANDATE_ID/status"
```

**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,
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const parentId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${parentId}/delegate`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "agent_session_id": "sess_paperfinder_2",
    "purpose": "Find A4 paper prices at three stores"
  }),
})).json();
const mandateId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/public/grants/${mandateId}/status`)).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,
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
parent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants/{parent_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "agent_session_id": "sess_paperfinder_2",
    "purpose": "Find A4 paper prices at three stores"
}).json()
grant_id = step2["id"]
data = httpx.get(f"{api}/v1/public/grants/{grant_id}/status").json()
```

### Response 200

```json
{
  "object": "grant_status",
  "id": "grt_01M6VQBCHQ0QPBJCZ4E3F53XFC",
  "status": "active"
}
```

## Save the mandate limits

`PUT /v1/mandate/settings/limits`

Saves the document as a new live version. The cap rows become the account's over-limit settings (as `PUT /v1/mandate/settings/delegation` would); the rest are the defaults each delegation is handed where it leaves a field out. Writes the audit row and sends `mandate.policy.published`. Needs a key with the `mandate` scope, or Manage policies in the console.

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). |
| `document` | body | object | yes | The account's mandate limits, a fixed set of rows over the grant fields: the overall cap, a sub-agent's budget settings, the merchant lists, reject past a margin, then ask. Published, the overall cap's rows become the account's over-limit settings for the budget lock (and the merchant locks when their rows are on), and the rest are the defaults each delegation on the account is handed where it leaves a field out. Strict: an unknown key is `400 policy_invalid`. |
| `document.cap` | body | object | yes | The most a parent hands its sub-agents in all (their budgets together). Off: no cap. |
| `document.cap.enabled` | body | boolean | yes | Whether the cap applies. |
| `document.cap.amount` | body | number | yes | The cap, in major units. |
| `document.cap.currency` | body | string | yes | ISO 4217 code, stored upper-case. |
| `document.budget` | body | object | yes | The budget settings a sub-agent is handed when its delegation doesn't say, the same words as a grant's `budget`. |
| `document.budget.allocation` | body | enum | yes | `shared` (drawn from what the parent has left) or `reserved` (set aside from the parent's budget; siblings can't spend it). One of `shared`, `reserved`. |
| `document.budget.at_limit` | body | enum | yes | At the sub-agent's limit: `stop` (refuse past it), `ask` (ask a person, refusing past `refuse_over_share`; off, at any amount over) or `continue` (go past without asking while every budget above has room). One of `stop`, `ask`, `continue`. |
| `document.allowed_mcc` | body | object | yes | Kinds of merchant a sub-agent may buy from; any other is refused or asked. |
| `document.allowed_mcc.enabled` | body | boolean | yes | Whether the row applies (on needs at least one entry). |
| `document.allowed_mcc.action` | body | enum | yes | What a purchase from another kind of merchant does. One of `refuse`, `ask`. |
| `document.allowed_mcc.mcc` | body | array of objects | yes | MCC groups by name (`{ group: lodging }`) or ranges (`{ from, to }`), stored as ranges with the group's name. |
| `document.named_merchants` | body | object | yes | Merchants a sub-agent may buy from; any other is refused or asked. |
| `document.named_merchants.enabled` | body | boolean | yes | Whether the row applies (on needs at least one merchant). |
| `document.named_merchants.action` | body | enum | yes | What a purchase from another merchant does. One of `refuse`, `ask`. |
| `document.named_merchants.merchants` | body | array of strings | yes | Merchant ids or origins, matched as `allowed_counterparties`. |
| `document.blocked_mcc` | body | object | yes | Kinds of merchant always refused. |
| `document.blocked_mcc.enabled` | body | boolean | yes | Whether the row applies. |
| `document.blocked_mcc.mcc` | body | array of objects | yes | MCC groups or ranges. |
| `document.blocked_merchants` | body | object | yes | Merchants always refused. |
| `document.blocked_merchants.enabled` | body | boolean | yes | Whether the row applies. |
| `document.blocked_merchants.merchants` | body | array of strings | yes | Merchant ids or origins. |
| `document.refuse_over_cap` | body | object | yes | A margin row: past a budget (`refuse_over_cap`, any mandate's budget; `refuse_over_share`, a sub-agent's own limit when its `budget.at_limit` is `ask`) by more than `value` percent of it, or by more than `value` in the cap's currency, refuse without asking. Off: ask at any amount over. |
| `document.refuse_over_cap.enabled` | body | boolean | yes | Whether the margin applies. |
| `document.refuse_over_cap.unit` | body | enum | yes | A percentage of the budget (the default), or a fixed amount. One of `percent`, `amount`. |
| `document.refuse_over_cap.value` | body | number | yes | The margin (a percentage is at most 1000). |
| `document.ask_over_cap` | body | object | yes | Otherwise over a mandate's budget: ask a person. Off: refuse at the budget. |
| `document.ask_over_cap.enabled` | body | boolean | yes | Whether a person is asked. |
| `document.refuse_over_share` | body | object | yes | A margin row: past a budget (`refuse_over_cap`, any mandate's budget; `refuse_over_share`, a sub-agent's own limit when its `budget.at_limit` is `ask`) by more than `value` percent of it, or by more than `value` in the cap's currency, refuse without asking. Off: ask at any amount over. |
| `document.refuse_over_share.enabled` | body | boolean | yes | Whether the margin applies. |
| `document.refuse_over_share.unit` | body | enum | yes | A percentage of the budget (the default), or a fixed amount. One of `percent`, `amount`. |
| `document.refuse_over_share.value` | body | number | yes | The margin (a percentage is at most 1000). |
| `note` | body | string | no | A note for the record. |

### Returns

The new live version, with its document as stored. See [the policy version 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)
- [`manage_policies_required`](https://provenanceauth.com/docs/platform/errors.md#manage_policies_required)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`policy_invalid`](https://provenanceauth.com/docs/platform/errors.md#policy_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/limits" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document": {
      "cap": {
        "enabled": true,
        "amount": 2400,
        "currency": "USD"
      },
      "budget": {
        "allocation": "shared",
        "at_limit": "continue"
      },
      "allowed_mcc": {
        "enabled": true,
        "action": "refuse",
        "mcc": [
          {
            "group": "airlines"
          },
          {
            "group": "lodging"
          },
          {
            "group": "car_rental"
          }
        ]
      },
      "named_merchants": {
        "enabled": false,
        "action": "refuse",
        "merchants": []
      },
      "blocked_mcc": {
        "enabled": false,
        "mcc": []
      },
      "blocked_merchants": {
        "enabled": false,
        "merchants": []
      },
      "refuse_over_cap": {
        "enabled": true,
        "unit": "percent",
        "value": 20
      },
      "ask_over_cap": {
        "enabled": true
      },
      "refuse_over_share": {
        "enabled": false,
        "unit": "percent",
        "value": 20
      }
    },
    "note": "Scout'\''s trip limits"
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "document": {
      "cap": {
        "enabled": true,
        "amount": 2400,
        "currency": "USD"
      },
      "budget": {
        "allocation": "shared",
        "at_limit": "continue"
      },
      "allowed_mcc": {
        "enabled": true,
        "action": "refuse",
        "mcc": [
          {
            "group": "airlines"
          },
          {
            "group": "lodging"
          },
          {
            "group": "car_rental"
          }
        ]
      },
      "named_merchants": {
        "enabled": false,
        "action": "refuse",
        "merchants": []
      },
      "blocked_mcc": {
        "enabled": false,
        "mcc": []
      },
      "blocked_merchants": {
        "enabled": false,
        "merchants": []
      },
      "refuse_over_cap": {
        "enabled": true,
        "unit": "percent",
        "value": 20
      },
      "ask_over_cap": {
        "enabled": true
      },
      "refuse_over_share": {
        "enabled": false,
        "unit": "percent",
        "value": 20
      }
    },
    "note": "Scout's trip limits"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/mandate/settings/limits", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "document": {
        "cap": {
            "enabled": True,
            "amount": 2400,
            "currency": "USD"
        },
        "budget": {
            "allocation": "shared",
            "at_limit": "continue"
        },
        "allowed_mcc": {
            "enabled": True,
            "action": "refuse",
            "mcc": [
                {
                    "group": "airlines"
                },
                {
                    "group": "lodging"
                },
                {
                    "group": "car_rental"
                }
            ]
        },
        "named_merchants": {
            "enabled": False,
            "action": "refuse",
            "merchants": []
        },
        "blocked_mcc": {
            "enabled": False,
            "mcc": []
        },
        "blocked_merchants": {
            "enabled": False,
            "merchants": []
        },
        "refuse_over_cap": {
            "enabled": True,
            "unit": "percent",
            "value": 20
        },
        "ask_over_cap": {
            "enabled": True
        },
        "refuse_over_share": {
            "enabled": False,
            "unit": "percent",
            "value": 20
        }
    },
    "note": "Scout's trip limits"
}).json()
```

### Response 201

```json
{
  "object": "policy_version",
  "policy_id": "pol_01M7PS9D7T0DB5ZT9JAA5FQT87",
  "domain": "mandate_limits",
  "version": 1,
  "active": true,
  "note": null,
  "created_by": "k-9b7ea63bc5b2",
  "created_at": "2026-11-18T13:20:00.000Z",
  "source": "api",
  "document": {
    "cap": {
      "enabled": true,
      "amount": 2400,
      "currency": "USD"
    },
    "budget": {
      "allocation": "shared",
      "at_limit": "ask"
    },
    "allowed_mcc": {
      "enabled": true,
      "action": "refuse",
      "mcc": [
        {
          "from": "3501",
          "to": "3999",
          "name": "Lodging",
          "group": "lodging"
        },
        {
          "from": "7011",
          "to": "7011",
          "name": "Lodging",
          "group": "lodging"
        }
      ]
    },
    "named_merchants": {
      "enabled": false,
      "action": "refuse",
      "merchants": []
    },
    "blocked_mcc": {
      "enabled": false,
      "mcc": []
    },
    "blocked_merchants": {
      "enabled": false,
      "merchants": []
    },
    "refuse_over_cap": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    },
    "ask_over_cap": {
      "enabled": true
    },
    "refuse_over_share": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    }
  }
}
```

## Publish a mandate limits draft

`POST /v1/mandate/settings/limits/versions/{version}/publish`

Makes a waiting draft of the mandate limits live (a rules embed session's draft, say). The account's over-limit settings follow it, the `policy_published` audit row records it and `mandate.policy.published` is sent. Mandate limits have no trial run. Needs a key with the `mandate` scope, or a console member with Manage policies.

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). |
| `version` | path | integer | yes | The draft's version number. |

### Returns

The version, now live. See [the policy version 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)
- [`manage_policies_required`](https://provenanceauth.com/docs/platform/errors.md#manage_policies_required)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`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 POST "$PROVENANCE_API/v1/mandate/settings/limits/versions/2/publish" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits/versions/2/publish`, {
  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/settings/limits/versions/2/publish", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "policy_version",
  "policy_id": "pol_01M7PS9D7T0DB5ZT9JAA5FQT87",
  "domain": "mandate_limits",
  "version": 2,
  "active": true,
  "note": null,
  "created_by": "k-9b7ea63bc5b2",
  "created_at": "2026-11-18T13:20:00.000Z",
  "source": "embed",
  "embed_session": "01M7PRQCQ1GW4RAYZRP3X9DX47",
  "document": {
    "cap": {
      "enabled": true,
      "amount": 2400,
      "currency": "USD"
    },
    "budget": {
      "allocation": "shared",
      "at_limit": "ask"
    },
    "allowed_mcc": {
      "enabled": true,
      "action": "refuse",
      "mcc": [
        {
          "from": "3501",
          "to": "3999",
          "name": "Lodging",
          "group": "lodging"
        },
        {
          "from": "7011",
          "to": "7011",
          "name": "Lodging",
          "group": "lodging"
        }
      ]
    },
    "named_merchants": {
      "enabled": false,
      "action": "refuse",
      "merchants": []
    },
    "blocked_mcc": {
      "enabled": false,
      "mcc": []
    },
    "blocked_merchants": {
      "enabled": false,
      "merchants": []
    },
    "refuse_over_cap": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    },
    "ask_over_cap": {
      "enabled": true
    },
    "refuse_over_share": {
      "enabled": true,
      "unit": "percent",
      "value": 20
    }
  }
}
```
