Mandate · API reference
Grants
Standing, bounded authority a person grants an agent.
Related guide: Grants
The policy version object
Attributes
objectenumRequired- The type of object. One of
policy_version. policy_idstring- The policy's ID (
pol_…), the same on every version of it. domainstringRequired- The policy domain.
versionintegerRequired- The version number.
activebooleanRequired- Whether this version is the active policy.
notestring | null- A note for the record.
created_atstring- When it was created.
created_bystring | null- Who saved the version.
documentobject- The policy document as saved, with Provenance's rule IDs.
shadowboolean- The shadow settings.
draftboolean- Present and true on a draft saved with POST .../versions that has not gone live.
trial_ends_attimestamp- Present while the version is on a trial run, with when the trial run ends.
restored_frominteger- On a restore, the version it copies.
promoted_from_trialboolean- Present and true when the version went live from its trial run.
sourceenum- 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 ofconsole,api,embed. embed_sessionstring- On a version saved by a rules embed session, that session's id (the embed token's
id, never the token).created_bynames the API key or console member that minted the session. draft_groupstring- 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_last4string- 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_byis a console member. warningsarray of objects- Checkout rules only, present when a rule never runs (
shadowed_by). The version is saved either way.Show child attributes
typeenumRequired- Always
shadowed_by. One ofshadowed_by. rule_idstringRequired- The rule that never runs.
shadowed_bystringRequired- The rule above it that always decides first.
messagestringRequired- The warning in words ("This rule never runs: 'No mandate or approval' decides first").
The policy version object
{
"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 when they subscribe:
mandate.grant.heartbeat_lapsedmandate.grant.revokedmandate.grant.over_limit_approvedmandate.grant.mcc_mismatchedmandate.delegation_proposal.decidedmandate.incoming_grant.receivedmandate.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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
device_idstringRequired- The capture or approving device's ID.
agent_session_idstring- The agent session the token was minted for.
constraintsobjectRequired- Bounded standing-authority constraints, validated at grant.
Show child attributes
max_amountnumber | null- Per-action cap.
budget_amountnumber | null- Cumulative cap per window.
budget_windowenum- The budget's window:
day,weekormonth, in UTC. One ofday,week,month. allowed_action_typesarray of strings- Empty ⇒ any action type. Matched against context.action_type at verify.
allowed_counterpartiesarray of strings | null- null ⇒ any counterparty. Matched against context.counterparty at verify.
scheduleobject | null- 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).
Show child attributes
cadenceenumRequired- How often the scheduled payment runs:
weekly,monthlyorquarterly. One ofweekly,monthly,quarterly. dayinteger- day-of-month (monthly/quarterly) or ISO weekday 1-7 (weekly).
amount_fixednumber | null- Exact required amount (XOR amount_max).
amount_maxnumber | null- Max allowed amount (XOR amount_fixed).
counterpartystringRequired- The required counterparty.
occurrencesinteger | null- Total executions allowed (null ⇒ until expiry).
grace_window_hoursinteger- Hours after the scheduled instant an execution is valid (default 48).
heartbeatobject- 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.
Show child attributes
intervalenumRequired- How often the person checks in:
weekly,biweeklyormonthly(UTC periods). One ofweekly,biweekly,monthly. grace_hoursinteger- Hours into a period before a missing check-in pauses the grant (default 72).
currencystring- 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 needscontext.currencyto match, a store's cart must be in it. A child inherits it and can't change it. Not carried in the mandate token. max_usesinteger- 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. max_purchasesinteger- Purchases allowed per
purchase_window(grant_purchase_limit_reachedpast it). Needspurchase_window. Present only when set; not carried in the token. purchase_windowenum- The window
max_purchasesis counted over:day,weekormonthin UTC, orlifetime(the whole grant). Independent of the budget window. One ofday,week,month,lifetime. over_limitobject- 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.
Show child attributes
amountobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
budgetobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
datesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
categoryobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
counterpartyobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
currencyobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
blockobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
usesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
purchasesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
countryobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
allowed_mccarray of objects- Kinds of merchant allowed, by merchant category code (MCC): each entry a group by name (
{ "group": "lodging" }) or a range ({ "from": "3000", "to": "3299" },toleft 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'scontext.mcc; a cart with no MCC isn't covered. A miss follows thecategorylock (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.Show child attributes
groupstring- A group by name when sending (
lodging); stored on each of its ranges. fromstring- The first MCC in the range.
tostring- The last MCC in the range (the same as
fromfor one code). namestring- The plain name ("Lodging").
blocked_mccarray of objects- MCC ranges refused, in the same form as
allowed_mcc. A block wins over every allow list. A hit follows theblocklock (refuse by default); a cart with no MCC follows thecategorylock. A child's list is its parent's with its own additions. Present only when set; not carried in the token.Show child attributes
groupstring- A group by name when sending (
lodging); stored on each of its ranges. fromstring- The first MCC in the range.
tostring- The last MCC in the range (the same as
fromfor one code). namestring- The plain name ("Lodging").
blocked_counterpartiesarray of strings- Merchants refused, matched as
allowed_counterpartiesis (a cart'smerchant_idororigin, verify'scontext.counterparty). A hit follows theblocklock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token. allowed_countriesarray of string | objects- 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'scontext.merchant_country); a cart with no country isn't covered. A miss follows thecountrylock (ask by default). On a delegation each country is one of the parent's. Present only when set; not carried in the token.Show child attributes
codestring- The ISO 3166-1 numeric code (
620). alpha2string- The alpha-2 code (
PT), for display.
blocked_countriesarray of string | objects- Merchant countries refused, in the same form as
allowed_countries. A hit follows theblocklock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token.Show child attributes
codestring- The ISO 3166-1 numeric code (
620). alpha2string- The alpha-2 code (
PT), for display.
service_windowobject- The dates of what is bought, separate from
expires_at(when the agent may act). Two calendar dates, both included; for lodgingtois the check-out date. Every cart line'sservice_period(verify'scontext.service_startandcontext.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 thedateslock (ask by default). On a delegation it sits inside the parent's. Present only when set; not carried in the token.Show child attributes
fromstringRequired- The first date (
2027-03-12). tostringRequired- The last date, on or after
from(2027-03-16).
expires_attimestampRequired- The grant's hard expiry.
biometric_challengestring- The challenge from
POST /v1/mandate/biometric_challengesthe assertion signs. biometric_assertionobject- The passkey assertion over the challenge.
purposestring- 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_idstring- The registered agent that holds the mandate. Its name appears in the chain subagents carry.
max_depthinteger- How many levels below this mandate subagents may delegate (default 4; 0 = no delegation).
holder_keyobject- Bind the grant to its holder: the holder's P-256 public key as a JWK (
ktyEC,crvP-256,x,y; neverd). Only its RFC 7638 thumbprint is kept (holder_jkt), and the token carries it ascnf.jkt. Every use then needs a DPoP proof from that key (theDPoPheader). Leave it out for a bearer grant. Free on every plan.Show child attributes
ktyenumRequired- The key type. One of
EC. crvenumRequired- The curve. One of
P-256. xstringRequired- The x coordinate, base64url (32 bytes).
ystringRequired- The y coordinate, base64url (32 bytes).
Returns
The mandate, with its token. The token is shown only once.
Errors
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"
}
}'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();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
{
"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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
device_idstringRequired- The device whose passkey allows the mandate.
agentobjectRequired- Who the person is allowing. Display only.
Show child attributes
namestringRequired- The agent's name, as the person knows it.
idstring- A registry agent (
agt_…). When another account made it, the component shows its avatar. descriptionstring- One line under the name.
constraintsobjectRequired- Bounded standing-authority constraints, validated at grant.
Show child attributes
max_amountnumber | null- Per-action cap.
budget_amountnumber | null- Cumulative cap per window.
budget_windowenum- The budget's window:
day,weekormonth, in UTC. One ofday,week,month. allowed_action_typesarray of strings- Empty ⇒ any action type. Matched against context.action_type at verify.
allowed_counterpartiesarray of strings | null- null ⇒ any counterparty. Matched against context.counterparty at verify.
scheduleobject | null- 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).
Show child attributes
cadenceenumRequired- How often the scheduled payment runs:
weekly,monthlyorquarterly. One ofweekly,monthly,quarterly. dayinteger- day-of-month (monthly/quarterly) or ISO weekday 1-7 (weekly).
amount_fixednumber | null- Exact required amount (XOR amount_max).
amount_maxnumber | null- Max allowed amount (XOR amount_fixed).
counterpartystringRequired- The required counterparty.
occurrencesinteger | null- Total executions allowed (null ⇒ until expiry).
grace_window_hoursinteger- Hours after the scheduled instant an execution is valid (default 48).
heartbeatobject- 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.
Show child attributes
intervalenumRequired- How often the person checks in:
weekly,biweeklyormonthly(UTC periods). One ofweekly,biweekly,monthly. grace_hoursinteger- Hours into a period before a missing check-in pauses the grant (default 72).
currencystring- 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 needscontext.currencyto match, a store's cart must be in it. A child inherits it and can't change it. Not carried in the mandate token. max_usesinteger- 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. max_purchasesinteger- Purchases allowed per
purchase_window(grant_purchase_limit_reachedpast it). Needspurchase_window. Present only when set; not carried in the token. purchase_windowenum- The window
max_purchasesis counted over:day,weekormonthin UTC, orlifetime(the whole grant). Independent of the budget window. One ofday,week,month,lifetime. over_limitobject- 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.
Show child attributes
amountobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
budgetobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
datesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
categoryobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
counterpartyobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
currencyobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
blockobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
usesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
purchasesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
countryobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
allowed_mccarray of objects- Kinds of merchant allowed, by merchant category code (MCC): each entry a group by name (
{ "group": "lodging" }) or a range ({ "from": "3000", "to": "3299" },toleft 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'scontext.mcc; a cart with no MCC isn't covered. A miss follows thecategorylock (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.Show child attributes
groupstring- A group by name when sending (
lodging); stored on each of its ranges. fromstring- The first MCC in the range.
tostring- The last MCC in the range (the same as
fromfor one code). namestring- The plain name ("Lodging").
blocked_mccarray of objects- MCC ranges refused, in the same form as
allowed_mcc. A block wins over every allow list. A hit follows theblocklock (refuse by default); a cart with no MCC follows thecategorylock. A child's list is its parent's with its own additions. Present only when set; not carried in the token.Show child attributes
groupstring- A group by name when sending (
lodging); stored on each of its ranges. fromstring- The first MCC in the range.
tostring- The last MCC in the range (the same as
fromfor one code). namestring- The plain name ("Lodging").
blocked_counterpartiesarray of strings- Merchants refused, matched as
allowed_counterpartiesis (a cart'smerchant_idororigin, verify'scontext.counterparty). A hit follows theblocklock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token. allowed_countriesarray of string | objects- 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'scontext.merchant_country); a cart with no country isn't covered. A miss follows thecountrylock (ask by default). On a delegation each country is one of the parent's. Present only when set; not carried in the token.Show child attributes
codestring- The ISO 3166-1 numeric code (
620). alpha2string- The alpha-2 code (
PT), for display.
blocked_countriesarray of string | objects- Merchant countries refused, in the same form as
allowed_countries. A hit follows theblocklock (refuse by default). A child's list is its parent's with its own additions. Present only when set; not carried in the token.Show child attributes
codestring- The ISO 3166-1 numeric code (
620). alpha2string- The alpha-2 code (
PT), for display.
service_windowobject- The dates of what is bought, separate from
expires_at(when the agent may act). Two calendar dates, both included; for lodgingtois the check-out date. Every cart line'sservice_period(verify'scontext.service_startandcontext.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 thedateslock (ask by default). On a delegation it sits inside the parent's. Present only when set; not carried in the token.Show child attributes
fromstringRequired- The first date (
2027-03-12). tostringRequired- The last date, on or after
from(2027-03-16).
expires_attimestampRequired- The grant's hard expiry.
agent_session_idstring- The agent session the mandate is bound to.
currencystring- How the amounts read (ISO 4217, default
USD). Display only. expires_ininteger- Seconds the draft stays open (default 900).
Returns
The draft, pending.
Errors
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"
}
}'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();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
{
"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.
Parameters
receiverobjectRequiredprovenance_agentwithagent_id, orkeywithname,originandholder_key.Show child attributes
kindenumRequired- How the agent is named. One of
provenance_agent,key. agent_idstring- An agent registered in another account.
namestring- The agent's name (up to 100 characters).
originstring- The agent's https origin, such as
https://seats.skydesk.example. holder_keyobject- The agent's P-256 public key (JWK).
max_amountnumber- The highest per-order cap that skips the ask.
budget_amountnumber- The highest budget that skips the ask.
Returns
The trusted agent.
Errors
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
}'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();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
{
"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.
Parameters
display_namestringRequired- The name the page and the passkey show for the person.
referencestring- Your own reference (a customer or session ID), for
list. Never shown on the page. expires_ininteger- Seconds the link works (900 by default).
Returns
The enrolment, with its link (shown once).
Errors
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" }'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();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
{
"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).
Parameters
idstringpathRequired- The object's ID.
Returns
The mandate.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The draft's ID (
mdr_…).
Returns
The draft.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The proposal's ID.
tokenstringquery- The hosted page's link token, in place of a key or session.
Returns
The proposal and its edit view.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The hand-off's ID (
xho_).
Returns
The hand-off.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The incoming grant's ID (
ing_).
Returns
The incoming grant.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The enrolment's ID.
Returns
The enrolment.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The object's ID.
Returns
The person's usual spend per category.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The object's ID.
Returns
A single-use passkey challenge.
Errors
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"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();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
{
"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.
Parameters
No parameters.
Returns
The settings.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/settings/purpose_check" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/purpose_check`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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).
Parameters
No parameters.
Returns
The settings.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/settings/delegation" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/delegation`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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.
Parameters
group_byenumquery- How to group the spend. One of
category,agent. windowenumquery- The window, in whole UTC days ending today. One of
7d,30d,90d. currencystringquery- 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
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"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();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
{
"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.
Parameters
No parameters.
Returns
The mandate limits.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/settings/limits" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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.
Parameters
versionintegerpathRequired- The version number.
Returns
The version. See the policy version object.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/settings/limits/versions/1" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits/versions/1`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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.
Parameters
agent_idstringpathRequired- The agent, yours or registered in another account.
holder_bindingenumRequired- The setting. One of
required,not_required.
Returns
The setting.
Errors
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" }'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();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
{
"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.
Parameters
default_ruleenum- Ask the person when an action under a delegated mandate is outside its purpose. One of
on,off. ai_checkenum- Also ask the configured model whether the action fits the purpose. One of
on,off.
Returns
The settings.
Errors
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" }'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();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
{
"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.
Parameters
over_limitobject- Over-limit settings per lock (any subset).
amountis the per-purchase limit,budgetthe grant's budget and each one above it,counterpartyits merchant list,currencyits currency,usesandpurchasesits counts.dates,category,blockandcountryare accepted now and take effect with the locks they name.Show child attributes
amountobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
budgetobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
datesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
categoryobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
counterpartyobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
currencyobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
blockobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
usesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
purchasesobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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.
countryobject- What one of a grant's locks does when a purchase goes past it.
askopens an approval for a person;refuserefuses without asking. The amount and budget locks takerefuse_overwithask: past the limit plus that margin, the purchase is refused without asking.Show child attributes
actionenumRequired- Ask a person, or refuse. One of
ask,refuse. refuse_overobject | null- 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount over.Show child attributes
percentnumber- The margin, in percent of the limit (20: ask up to 1.2 times the limit).
amountnumber- 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_personboolean- Accept a yes over a grant's limit only from a passkey the grant's person registered.
at_verifyenumsettings: verify follows the over-limit settings.refuse: verify refuses every miss. One ofsettings,refuse.require_holder_proofboolean- 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.
externalenum- A grant handed to an agent outside the account:
askthe grantor first, orrefuseit. One ofask,refuse. external_online_abovenumber- The budget at or under which a hand-off that doesn't say allows offline checks.
Returns
The settings.
Errors
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
}'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();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
{
"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.
Parameters
qstringquery- 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.
statusarray of enumsquery- Only grants in these statuses. One value, or several separated by commas.
agent_idstringquery- Only grants this registered agent holds.
sortenumquery- The order of the list:
created,spent(this budget window) orends(when the grant expires), with-in front for descending. Newest first when omitted. A grant with no budget sorts last byspent. Anext_cursorcarries its order; pass it back with the samesort. One ofcreated,-created,spent,-spent,ends,-ends.
Returns
The account's mandates, each with its remaining budget.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/grants" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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).
Parameters
statusenumquery- Only proposals in this state. One of
pending,approved,declined,expired,stale,superseded. parent_grant_idstringquery- Only proposals for this mandate.
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
The proposals.
Errors
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"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();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
{
"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.
Parameters
agent_idstringquery- Only this agent's incoming grants.
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
The incoming grants.
Errors
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"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();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
{
"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.
Parameters
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
The trusted agents.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/trusted_agents" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/trusted_agents`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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.
Parameters
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
The settings.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/holder_bindings" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/holder_bindings`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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.
Parameters
statusenumquery- Only enrolments in this state. One of
pending,enrolled,revoked,expired. referencestringquery- Only enrolments with this reference.
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
The enrolments.
Errors
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"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();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
{
"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.
Parameters
idstringpathRequired- The object's ID.
include_descendantsenumquerytruelists the entries of every mandate delegated from this one as well (defaultfalse). One oftrue,false.limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
The entries.
Errors
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"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();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
{
"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.
Parameters
draft_groupstringquery- 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
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/mandate/settings/limits/versions" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/settings/limits/versions`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();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
{
"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.
Parameters
idstringpathRequired- The trusted agent's ID (
tra_).
Returns
The trusted agent is removed.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X DELETE "$PROVENANCE_API/v1/mandate/trusted_agents/tra_01M7Z8C2D4F6H8J0K2M4N6P8Q0" \
-H "Authorization: Bearer $PROVENANCE_KEY"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();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
{
"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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
DPoPstringheader- A DPoP proof (RFC 9449) from the grant's holder key, when the grant is holder-bound (
holder_jkt): an ES256dpop+jwtnaming this request (htm,htu),iatwithin 60 seconds, a freshjti, andath, the SHA-256 of the grant token sent. One per request. See bind a grant to its holder. Content-Digeststringheader- Holder proof:
sha-256=:<base64>:of the request body as sent (RFC 9530). Signature-Inputstringheader- Holder proof: the signature's covered components and parameters (
created,expires,keyid,nonce,tag="web-bot-auth"). Signaturestringheader- Holder proof: the agent's Ed25519 signature.
Signature-Agentstringheader- Holder proof: the agent's directory URL, as registering its key returned it.
idstringpathRequired- The parent mandate's ID.
agent_session_idstringRequired- The subagent's session. The child mandate works only for it.
purposestringRequired- 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_tagsarray of strings- Up to 10 of the parent's action types or counterparties the task is about.
agent_idstring- The registered agent that holds the child.
constraintsobject- 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.
scheduleand check-ins are always inherited.Show child attributes
max_amountnumber | null- The largest single action. Null only when the parent has no cap.
budget_amountnumber | null- The budget per window. Null only when the parent has no budget.
budget_windowenum- The budget window: the parent's or shorter. One of
day,week,month. allowed_action_typesarray of strings- Within the parent's; empty inherits them.
allowed_counterpartiesarray of strings | null- Within the parent's; null inherits them.
allowed_mccarray of objects- Kinds of merchant by MCC (groups or ranges), each inside the parent's ranges; left out inherits them.
Show child attributes
groupstring- A group by name when sending (
lodging); stored on each of its ranges. fromstring- The first MCC in the range.
tostring- The last MCC in the range (the same as
fromfor one code). namestring- The plain name ("Lodging").
allowed_countriesarray of string | objects- Merchant countries, each one of the parent's; left out inherits them.
Show child attributes
codestring- The ISO 3166-1 numeric code (
620). alpha2string- The alpha-2 code (
PT), for display.
blocked_mccarray of objects- More MCC ranges to refuse. Stored with the parent's (a child can't remove a block).
Show child attributes
groupstring- A group by name when sending (
lodging); stored on each of its ranges. fromstring- The first MCC in the range.
tostring- The last MCC in the range (the same as
fromfor one code). namestring- The plain name ("Lodging").
blocked_counterpartiesarray of strings- More merchants to refuse. Stored with the parent's.
blocked_countriesarray of string | objects- More merchant countries to refuse. Stored with the parent's.
Show child attributes
codestring- The ISO 3166-1 numeric code (
620). alpha2string- The alpha-2 code (
PT), for display.
service_windowobject- The dates of what is bought, inside the parent's; left out inherits them.
Show child attributes
fromstringRequired- On or after the parent's.
tostringRequired- On or before the parent's.
expires_attimestamp- No later than the parent's.
max_depthinteger- The deepest level its own subtree may reach (between its depth and the parent's limit).
run_idstring- The run the child joins. It inherits the parent's run when left out, and must match it when both are set.
budgetobject- 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 itstop(refuse anything past it),ask(ask the person, or the grant's approver, up toask_up_topast it, then refuse) orcontinue(go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour.Show child attributes
allocationenumreserved: set aside from the parent; siblings can't spend it.shared: drawn from what the parent has left. One ofreserved,shared.at_limitenumstop: refuse past the amount.ask: ask the person, refusing pastask_up_to.continue: go past without asking while every budget above has room. One ofstop,ask,continue.ask_up_toobject | null- With
askonly: 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount the parent has room for.Show child attributes
percentnumber- The margin, in percent of the amount (10: ask up to 1.1 times it).
amountnumber- The margin as a fixed amount in the grant's currency.
parent_tokenstring- 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-digestand theSignature-Agentmember and carries a nonce; theContent-Digest(RFC 9530,sha-256) matches the body as sent. The child recordsdelegated_by: holder. An account withrequire_holder_proofrefuses an account key (403holder_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_keyobject- Bind the child to its holder: the holder's P-256 public key as a JWK (
ktyEC,crvP-256,x,y; neverd). Only its RFC 7638 thumbprint is kept (holder_jkt), and the token carries it ascnf.jkt. Every use then needs a DPoP proof from that key (theDPoPheader). Leave it out for a bearer grant. Free on every plan.Show child attributes
ktyenumRequired- The key type. One of
EC. crvenumRequired- The curve. One of
P-256. xstringRequired- The x coordinate, base64url (32 bytes).
ystringRequired- The y coordinate, base64url (32 bytes).
receiverobject- 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 itsnameandorigin(https://…); the grantor sees them marked unverified. An agent in your own account is delegated to withagent_idinstead. Needsholder_key(the receiver's key), andmax_depthis left out or the child's own depth: an outside agent can't hand it on. Refused with403 external_delegation_refusedwhen the account'sdelegation.externalisrefuse.Show child attributes
kindenum- An agent registered in another account. One of
provenance_agent. agent_idstring- The registered agent.
namestring- The name it declared.
originstring- The https origin it declared (
https://agent.example).
offline_checksenum- With
receiver: whether stores may check the grant offline.refused: its token saysstatus_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:allowedonly when the child's budget (its own or the tightest above it) is at or under the account'sexternal_online_above(0 by default), elserefused. The grantor sees the choice and what it costs. One ofallowed,refused. handoff_idstring- 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_versioninteger- Sandbox only (
400in 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_groupstring- With
limits_version: the draft's group, when it was saved in one (a draft of another group is400).
Returns
The child mandate, its chain, and its token. The token is shown only once.
Errors
- authentication_required
- insufficient_scope
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- usage_limit_reached
- resource_missing
- grant_invalid
- agent_suspended
- purpose_required
- purpose_tags_exceed_parent
- delegation_exceeds_parent
- delegation_depth_exceeded
- delegation_limit_reached
- mandate_limits_cap_exceeded
- external_delegation_refused
- external_delegation_declined
- external_delegation_used
- resource_missing
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"
]
}
}'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();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
{
"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.
Parameters
DPoPstringheader- A DPoP proof (RFC 9449) from the grant's holder key, when the grant is holder-bound (
holder_jkt): an ES256dpop+jwtnaming this request (htm,htu),iatwithin 60 seconds, a freshjti, andath, the SHA-256 of the grant token sent. One per request. See bind a grant to its holder. idstringpathRequired- The grant's ID.
mandate_tokenstringRequired- The grant's token, as creating it returned it (it rides in the open Payment Mandate unchanged).
holder_keyobjectRequired- The grant's holder key (P-256 public JWK); its thumbprint must be the grant's
holder_jkt. currencystringRequired- ISO 4217: AP2 amounts carry a currency, a grant doesn't.
payeesarray of objects- AP2 Merchant objects for the grant's allowed counterparties (an
idand anameeach).Show child attributes
idstringRequired- The counterparty id the grant allows.
namestringRequired- What the person sees.
websitestring- The merchant's origin.
Returns
The open mandates.
Errors
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"
}
]
}'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();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
{
"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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
Content-Digeststringheader- Holder proof:
sha-256=:<base64>:of the request body as sent (RFC 9530). Signature-Inputstringheader- Holder proof: the signature's covered components and parameters.
Signaturestringheader- Holder proof: the agent's Ed25519 signature.
Signature-Agentstringheader- Holder proof: the agent's directory URL.
idstringpathRequired- The parent mandate's ID.
approverobject- 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 asapprover. Never shown on the plan page.Show child attributes
namestring- One line of 1 to 100 characters.
childrenarray of objectsRequired- The proposed children, in the order the person sees them.
Show child attributes
agent_idstringRequired- A registered agent of the account that will hold the child.
purposestringRequired- What the child is for.
purpose_tagsarray of strings- Up to 10 of the parent's action types or counterparties.
constraintsobject- The child's limits, as
POST /v1/mandate/grants/{id}/delegatetakes them. budgetobject- 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 itstop(refuse anything past it),ask(ask the person, or the grant's approver, up toask_up_topast it, then refuse) orcontinue(go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour.Show child attributes
allocationenumreserved: set aside from the parent; siblings can't spend it.shared: drawn from what the parent has left. One ofreserved,shared.at_limitenumstop: refuse past the amount.ask: ask the person, refusing pastask_up_to.continue: go past without asking while every budget above has room. One ofstop,ask,continue.ask_up_toobject | null- With
askonly: 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount the parent has room for.Show child attributes
percentnumber- The margin, in percent of the amount (10: ask up to 1.1 times it).
amountnumber- The margin as a fixed amount in the grant's currency.
max_depthinteger- How deep its own subtree may go.
supersedesstring- A pending proposal on the same mandate this one replaces (it becomes
superseded). expires_ininteger- Seconds the proposal waits for the person (24 hours by default, never past the mandate's expiry).
notifyboolean- Tell the person by text and email.
falsewhen the agent sendsapprove_urlitself. parent_tokenstring- 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_versioninteger- Sandbox only (
400in 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_groupstring- With
limits_version: the draft's group, when it was saved in one (a draft of another group is400).
Returns
The proposal, the hosted page's link (shown once) and how the person was told.
Errors
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\"
]
}
}
]
}"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();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
{
"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.
Parameters
idstringpathRequired- The proposal's ID.
tokenstring- The hosted page's link token (
tin its link). Left out in a signed-in console session. childrenarray of objects- The structure as the person edited it. Left out: as proposed. Each proposed child appears at most once by
proposed_index(left out orremoved: removed); a child with no index is added. Every child stays within the parent (or the parent as raised).Show child attributes
proposed_indexinteger- The proposed child this one is; left out for a child the person adds.
removedboolean- true to remove a proposed child (or leave it out).
agent_idstring- The agent that holds it (another of the account's agents swaps it).
purposestring- An added child's purpose (a proposed child keeps the agent's).
purpose_tagsarray of strings- An added child's purpose tags.
constraintsobject- The child's limits, as a delegate call takes them (replaces the proposed ones).
budgetobject- 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 itstop(refuse anything past it),ask(ask the person, or the grant's approver, up toask_up_topast it, then refuse) orcontinue(go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour.Show child attributes
allocationenumreserved: set aside from the parent; siblings can't spend it.shared: drawn from what the parent has left. One ofreserved,shared.at_limitenumstop: refuse past the amount.ask: ask the person, refusing pastask_up_to.continue: go past without asking while every budget above has room. One ofstop,ask,continue.ask_up_toobject | null- With
askonly: 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount the parent has room for.Show child attributes
percentnumber- The margin, in percent of the amount (10: ask up to 1.1 times it).
amountnumber- The margin as a fixed amount in the grant's currency.
max_depthinteger | null- How deep its own subtree may go.
parentobject- Raise the parent in the same approval (each only up): one passkey covers both.
Show child attributes
budget_amountnumber- The parent's new budget.
refuse_overobject | null- The budget lock's new margin (
percentoramount; null asks at any amount). expires_attimestamp- The parent's new expiry.
Returns
The check.
Errors
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
}
}
]
}'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();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
{
"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.
Parameters
idstringpathRequired- The proposal's ID.
tokenstring- The hosted page's link token (
tin its link). Left out in a signed-in console session. childrenarray of objects- The structure as the person edited it. Left out: as proposed. Each proposed child appears at most once by
proposed_index(left out orremoved: removed); a child with no index is added. Every child stays within the parent (or the parent as raised).Show child attributes
proposed_indexinteger- The proposed child this one is; left out for a child the person adds.
removedboolean- true to remove a proposed child (or leave it out).
agent_idstring- The agent that holds it (another of the account's agents swaps it).
purposestring- An added child's purpose (a proposed child keeps the agent's).
purpose_tagsarray of strings- An added child's purpose tags.
constraintsobject- The child's limits, as a delegate call takes them (replaces the proposed ones).
budgetobject- 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 itstop(refuse anything past it),ask(ask the person, or the grant's approver, up toask_up_topast it, then refuse) orcontinue(go past without asking while every budget above it has room)? Any allocation combines with any limit behaviour.Show child attributes
allocationenumreserved: set aside from the parent; siblings can't spend it.shared: drawn from what the parent has left. One ofreserved,shared.at_limitenumstop: refuse past the amount.ask: ask the person, refusing pastask_up_to.continue: go past without asking while every budget above has room. One ofstop,ask,continue.ask_up_toobject | null- With
askonly: 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 fixedamountin the grant's currency. Exactly one of the two.nullasks at any amount the parent has room for.Show child attributes
percentnumber- The margin, in percent of the amount (10: ask up to 1.1 times it).
amountnumber- The margin as a fixed amount in the grant's currency.
max_depthinteger | null- How deep its own subtree may go.
parentobject- Raise the parent in the same approval (each only up): one passkey covers both.
Show child attributes
budget_amountnumber- The parent's new budget.
refuse_overobject | null- The budget lock's new margin (
percentoramount; null asks at any amount). expires_attimestamp- The parent's new expiry.
biometric_challengestringRequired- The challenge
checkreturned for this structure. biometric_assertionobjectRequired- The passkey assertion of the person whose grant is at the top of the chain.
Show child attributes
authenticator_datastringRequired- The base64url authenticatorData from the passkey assertion.
client_data_jsonstringRequired- The base64url clientDataJSON from the passkey ceremony.
signaturestringRequired- The base64url signature from the passkey assertion.
Returns
The approved proposal with the minted children.
Errors
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"
}
}'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();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
{
"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.
Parameters
idstringpathRequired- The proposal's ID.
tokenstring- The hosted page's link token (
tin its link). Left out in a signed-in console session.
Returns
The declined proposal.
Errors
curl -X POST "$PROVENANCE_API/v1/mandate/delegation_proposals/dgp_01M7Q2ZK1E0Y8W3V6T4S9R5N2P/decline" \
-H "Content-Type: application/json" \
-d '{ "token": "dgl_example" }'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();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
{
"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.
Parameters
agent_idstringpathRequired- The agent.
Returns
The setting is cleared.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X DELETE "$PROVENANCE_API/v1/mandate/holder_bindings/agt_01M7Z71YM4GVGFZ5D6PQQE0VZN" \
-H "Authorization: Bearer $PROVENANCE_KEY"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();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
{
"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.
Parameters
idstringpathRequired- The enrolment's ID.
Returns
The enrolment, revoked.
Errors
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"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();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
{
"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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired- The object's ID.
reasonstringRequired- The reason given or recorded.
Returns
The object, now revoked.
Errors
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" }'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();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
{
"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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired- The object's ID.
biometric_assertionobjectRequired- The passkey assertion over the challenge.
Show child attributes
authenticator_datastring- The base64url authenticatorData from the passkey assertion.
client_data_jsonstring- The base64url clientDataJSON from the passkey ceremony.
signaturestring- The base64url signature from the passkey assertion.
Returns
The check-in, with the mandate's status and when the next one is due.
Errors
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"
}
}'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();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
{
"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.
No API key needed.
Parameters
idstringpathRequired- The mandate's ID (the token's
jti).
Returns
The mandate's status.
Errors
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"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();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
{
"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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
documentobjectRequired- 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.Show child attributes
capobjectRequired- The most a parent hands its sub-agents in all (their budgets together). Off: no cap.
Show child attributes
enabledbooleanRequired- Whether the cap applies.
amountnumberRequired- The cap, in major units.
currencystringRequired- ISO 4217 code, stored upper-case.
budgetobjectRequired- The budget settings a sub-agent is handed when its delegation doesn't say, the same words as a grant's
budget.Show child attributes
allocationenumRequiredshared(drawn from what the parent has left) orreserved(set aside from the parent's budget; siblings can't spend it). One ofshared,reserved.at_limitenumRequired- At the sub-agent's limit:
stop(refuse past it),ask(ask a person, refusing pastrefuse_over_share; off, at any amount over) orcontinue(go past without asking while every budget above has room). One ofstop,ask,continue.
allowed_mccobjectRequired- Kinds of merchant a sub-agent may buy from; any other is refused or asked.
Show child attributes
enabledbooleanRequired- Whether the row applies (on needs at least one entry).
actionenumRequired- What a purchase from another kind of merchant does. One of
refuse,ask. mccarray of objectsRequired- MCC groups by name (
{ group: lodging }) or ranges ({ from, to }), stored as ranges with the group's name.
named_merchantsobjectRequired- Merchants a sub-agent may buy from; any other is refused or asked.
Show child attributes
enabledbooleanRequired- Whether the row applies (on needs at least one merchant).
actionenumRequired- What a purchase from another merchant does. One of
refuse,ask. merchantsarray of stringsRequired- Merchant ids or origins, matched as
allowed_counterparties.
blocked_mccobjectRequired- Kinds of merchant always refused.
Show child attributes
enabledbooleanRequired- Whether the row applies.
mccarray of objectsRequired- MCC groups or ranges.
blocked_merchantsobjectRequired- Merchants always refused.
Show child attributes
enabledbooleanRequired- Whether the row applies.
merchantsarray of stringsRequired- Merchant ids or origins.
refuse_over_capobjectRequired- A margin row: past a budget (
refuse_over_cap, any mandate's budget;refuse_over_share, a sub-agent's own limit when itsbudget.at_limitisask) by more thanvaluepercent of it, or by more thanvaluein the cap's currency, refuse without asking. Off: ask at any amount over.Show child attributes
enabledbooleanRequired- Whether the margin applies.
unitenumRequired- A percentage of the budget (the default), or a fixed amount. One of
percent,amount. valuenumberRequired- The margin (a percentage is at most 1000).
ask_over_capobjectRequired- Otherwise over a mandate's budget: ask a person. Off: refuse at the budget.
Show child attributes
enabledbooleanRequired- Whether a person is asked.
refuse_over_shareobjectRequired- A margin row: past a budget (
refuse_over_cap, any mandate's budget;refuse_over_share, a sub-agent's own limit when itsbudget.at_limitisask) by more thanvaluepercent of it, or by more thanvaluein the cap's currency, refuse without asking. Off: ask at any amount over.Show child attributes
enabledbooleanRequired- Whether the margin applies.
unitenumRequired- A percentage of the budget (the default), or a fixed amount. One of
percent,amount. valuenumberRequired- The margin (a percentage is at most 1000).
notestring- A note for the record.
Returns
The new live version, with its document as stored. See the policy version object.
Errors
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"
}'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();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
{
"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.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
versionintegerpathRequired- The draft's version number.
Returns
The version, now live. See the policy version object.
Errors
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/mandate/settings/limits/versions/2/publish" \
-H "Authorization: Bearer $PROVENANCE_KEY"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();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
{
"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
}
}
}