SDK reference · Python SDK
prov.mandate.intents.create
prov.mandate.intents.create in Python SDK. Mint an intent token.
Signature
prov.mandate.intents.create(agent_session_id: str, device_id: str, action_description: Optional[str] = …, action_payload: Any = …, mandate_token: Optional[str] = …, biometric_challenge: Optional[str] = …, biometric_assertion: Optional[dict] = …, biometric_type: Optional[str] = …, options: Optional[list] = …, revises: Optional[str] = …, user_agent_suffix: Optional[str] = …, **extra: Any = …) -> AnyParameters
agent_session_idstrRequireddevice_idstrRequiredaction_descriptionOptional[str]action_payloadAnymandate_tokenOptional[str]biometric_challengeOptional[str]biometric_assertionOptional[dict]biometric_typeOptional[str]optionsOptional[list]revisesOptional[str]user_agent_suffixOptional[str]**extraAny
Request fields
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. action_descriptionstring- The human-readable action, exactly as authorized. Required unless you send
options. action_payloadany- Opaque; its canonical-JSON SHA-256 is bound into the token.
optionsarray of objects- "Choose one": 2 to 5 complete actions instead of
action_description. Each is hashed and gets its own token (a distinctjtiandaction_hash, all carryingoption_group_id); one approval holds the group and opens now. The person approves exactly one; verify on the others answersoption_not_chosen. The account's policy runs on each option, and one it denies outright is shown disabled. Can't be combined withaction_description,action_payload,approval,mandate_tokenordisplay_summary.Show child attributes
labelstringRequired- The option's card label ("United 9:40 am"); unique in the request.
actionstringRequired- The option's action description, hashed into its token.
payloadany- The option's exact payload (opaque), hashed into its token.
action_payloadis accepted too. contextobject- Policy facts and card facts for this option (
transaction_amount,currency,payee,date, …), up to 20.
revisesstring- The approval this request revises: one that ended
changes_requested. The token carries it (revisesclaim), and the new approval shows the person what changed. run_idstring- An agent-team run to join. The token carries
run, and the session stops when the run is halted. Defaults to the mandate's run. agent_session_idstringRequired- The agent session the token was minted for.
device_idstringRequired- The capture or approving device's ID.
agent_idstring- The registered agent that asks. The token's
agentclaim carries{ id, name, integration, sdk_version }: the agent's id and name, plus the integration the client declares in itsUser-Agent(mcp,ai_sdk,langchain,langchain_py,claude_agent_sdk,claude_agent_sdk_py,openai_agents,openai_agents_py,adk_py,crewai_pyornone), signed as reported. A merchant reads it at checkout. mandate_tokenstring- Authorize UNDER a delegation mandate. The mandate is validated here (signature, status, expiry, device/session binding — invalid ⇒ 400 grant_invalid) and its
grant_idis bound into the resulting token so verify enforces its constraints and budget. A holder-bound grant (holder_jkt) also needs its holder's DPoP proof in theDPoPheader (401dpop_proof_required,dpop_proof_invalid,dpop_proof_replayedorholder_mismatch). counter_offer_idstring- the accepted counter-offer this action buys. Needs
mandate_token(the counter-offer's grant). When the accepted option gave anaction_hash, the action's payload hash must equal it; the amount and counterparty are checked at verify, where the acceptance is spent (one purchase each). A mismatch is 409counter_offer_terms_changedand no token is minted. The token carries no new claim: the id stays on the token's server-side record. context_evidenceobject- The agent's justification for the action (a JSON blob of scalars/strings, ≤ ~8KB). Canonicalized + hashed into the token (context_hash), sealed onto the ledger + receipts, and shown to the human in the "Why the agent is asking" panel. It is the agent's STATED reason — a claim, not a verified fact. verify may re-supply it to re-check (context_hash_mismatch on mutation). Free.
trace_idstring- Bind a Trace (a traced inference from /v1/trace/chat/completions, or a sidecar reading, this account) into the token as
trace: {id, canary_hash}, sofact:"canary"policy conditions read its canary readings at verify. Another account's trace → 404 resource_missing. approvalobject- A merchant-requested checkout step-up, taken from the store's
ProvenanceIntentchallenge (approval_request); pass the challenge'sbindingasaction_payload. The first call opens an approval bound to that exact order and answersapproval_pending; relay it to the person (themandate.approval.createdwebhook and the approval embed, or an approver link). The same call after the approval returns the token. A declined, expired or muted step-up answers 200 with thatreasonand no token. No delivery path → 503stepup_delivery_not_configured; over the per-person, per-store or per-account limits → 429rate_limit_exceeded, with no notification. No field identifies the person;ships_tois coarse order data the store holds.Show child attributes
merchant_originstringRequired- The origin of the URL your agent called (
https://shop.example). It must equal the binding'sorigin. displayobjectRequired- What the person sees that the order can't bind. Optional
total,currencyanditemsmust repeat the binding exactly.Show child attributes
merchant_namestringRequired- The store's own name, shown as "calls itself …" (sanitized, at most 80 characters).
ships_toobject- City, region and country only.
Show child attributes
citystring- The city.
regionstring- The region or state.
countrystring- The country.
totalinteger- The bound total in minor units.
currencystring- The bound ISO 4217 currency.
itemsarray of objects- The bound quantities per SKU.
Show child attributes
skustring- The SKU.
quantityinteger- The quantity.
expires_attimestampRequired- The challenge's expiry. The approval lasts until this or 10 minutes, whichever comes first.
require_biometricboolean- Ask for face, fingerprint or passkey on the person's enrolled device. No enrolled credential →
approval_too_weak. min_tierenum- The store's minimum device tier. A passkey (routed) approval can't meet it →
approval_too_weak. One oftee,strongbox,sep. transportenum- How the store asked (default
checkout). Withacp,action_payloadis the ACP binding. Withrequest, it is an Identify request binding (kind: "request", origin, action, method, path),displayholds onlymerchant_name, and the person approves with a biometric or passkey. One ofcheckout,acp,request. routeobject- Route the approval to an approver-network link instead of the in-house device.
Show child attributes
approver_link_idstring- An active approver link of this account.
external_confirmationobject- A confirmation the person gave outside Provenance, accepted only when your policy's
external_confirmations.acceptlists its kind and it verifies for this exact cart. Screenshots, chat transcripts and an agent saying the person confirmed are never a kind. Every plan. See ask once.Show child attributes
kindenumRequiredap2_user_mandate: a closed AP2 0.2 mandate SD-JWT;spc: a Secure Payment Confirmation;platform: a listed agent platform's signed confirmation. One ofap2_user_mandate,spc,platform.evidencestring | objectRequired- The SD-JWT presentation (
ap2_user_mandate) or compact JWS (platform) as a string, or the SPC assertion as an object.Show child attributes
credential_idstring- The passkey's credential ID.
assertionobject- The assertion, base64url fields.
Show child attributes
authenticator_datastringRequired- base64url authenticator data.
client_data_jsonstringRequired- base64url clientDataJSON (
type: payment.get). signaturestringRequired- base64url signature.
public_keystring | object- A passkey your store registered itself: its public key (PEM or JWK). The confirmation is then labelled as your store's credential.
audiencestring- The one site this token is for (its
audclaim): an http(s) origin (normalized, e.g. https://shop.example) or a merchant id. A site running Identify refuses a token minted for another audience. Present only when you send it. With an audience the token'ssubis pairwise (psub_…): stable for this device at this audience, so Identify can give the person one pseudonym there. Without one,subis per token (anon_…).
Returns
Any The signed intent token.
HTTP operation
POST /v1/mandate/intents: Create an intent token
Errors
- agent_suspended
- authentication_required
- insufficient_scope
- invalid_json
- link_revoked
- grant_invalid
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- resource_missing
- stepup_delivery_not_configured
- usage_limit_reached
Example
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
"action_payload": {
"type": "payment",
"amount": 1850,
"currency": "USD",
"payee": "acct_brindlecote_supplies"
},
"agent_session_id": "sess_reference_1",
"device_id": "dev_00000000000000000000000000000001"
}),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
"action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
"action_payload": {
"type": "payment",
"amount": 1850,
"currency": "USD",
"payee": "acct_brindlecote_supplies"
},
"agent_session_id": "sess_reference_1",
"device_id": "dev_00000000000000000000000000000001"
}).json()