SDK reference · Python SDK

prov.mandate.approvers.route

prov.mandate.approvers.route in Python SDK. Route an approval to the link's approver.

Signature

prov.mandate.approvers.route(link_id: Optional[str] = …, action_description: str, intent_token: Optional[str] = …, jti: Optional[str] = …, amount: Optional[float] = …, needs_biometric: Optional[bool] = …, approval_expires_in: Optional[int] = …, link_expires_in: Optional[int] = …, channels: Optional[list] = …, delivery: Optional[str] = …, context: Optional[dict] = …, approver_link_ids: Optional[list] = …, reminders: Optional[dict] = …, approvals_needed: Optional[int] = …, deny_rule: Optional[str] = …) -> Any

Parameters

link_idOptional[str]
action_descriptionstrRequired
intent_tokenOptional[str]
jtiOptional[str]
amountOptional[float]
needs_biometricOptional[bool]
approval_expires_inOptional[int]
link_expires_inOptional[int]
channelsOptional[list]
deliveryOptional[str]
contextOptional[dict]
approver_link_idsOptional[list]
remindersOptional[dict]
approvals_neededOptional[int]
deny_ruleOptional[str]

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired
The object's ID.
intent_tokenstring
The agent's intent token, issued to your account. The approval covers its action and payload only.
jtistring
Unbound form: a bare token ID. The approval reaches the approver but never satisfies verify.
action_descriptionstringRequired
The human-readable action, exactly as authorized. With intent_token, it must match the token's action.
amountnumber
The amount, checked against the link's ceiling.
needs_biometricboolean
Require the approver's passkey.
approval_expires_ininteger
The expiry of an approval this call opens, in seconds: 60 to 7 days, and never past the intent token's expiry. Defaults to the account default, then the server's.
link_expires_ininteger
How long each single-use link to the approver works, in seconds: at least 60, capped at the approval. Defaults to the whole approval window; a resend issues a new link for the same time.
remindersobject
For a routed approval: its automatic reminders (the approval schedule's shape). Left out, your account's schedule.
Show child attributes
enabledboolean
true tracks this request on the schedule (Pro and above on a live deployment: 402 plan_required on reminders.enabled below Pro, nothing created; every plan in the sandbox); false sends it no automatic reminder (one by hand or by API is still allowed).
afterarray of strings
Up to three offsets from the request's creation (10m, 24h, 3d), increasing, each at least the minimum gap after the one before, at most 7 days. Errors use the Settings messages on reminders.after.
channelsobject
For a routed approval: which messages may go (app_notification, email, text). They narrow the approver's own order (their Provenance app, then their channels, then a text when they have a phone, then email), and one message goes. Left out, your account's default.
deliveryenum
send, or self: send nothing; the response carries approve_url for you to show in your own app. The approver still approves with their own passkey. self needs an approver link. Left out, your account's default. One of send, self.
contextobject
Details shown to the approver.

Returns

Any The approval, now waiting for the approver, with the limits that apply and its delivery.

HTTP operation

POST /v1/mandate/approver_links/{id}/approvals: Route an approval to an approver

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approver_links/lnk_01M5Q2H4DXP9F05T994KREYCNS/approvals`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI3Zjc5YTg4NS01ZmM3In0.c2lnbmF0dXJl",
    "action_description": "Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
    "amount": 850,
    "needs_biometric": true,
    "approval_expires_in": 3600
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.