SDK reference · Node SDK

prov.mandate.approvers.route

prov.mandate.approvers.route in Node SDK.

Signature

prov.mandate.approvers.route(linkIdOrParams: string | (RouteApprovalParams & GroupRouteParams), params?: RouteApprovalParams): Promise<RoutedApproval | GroupRoutedApproval>

Parameters

linkIdOrParamsstring | (RouteApprovalParams & GroupRouteParams)Required
paramsRouteApprovalParams

Request fields

contactstring
An email or E.164 phone number you already hold. Required unless you send approver_link_ids.
approver_link_idsarray of strings
Group sign-off: the accepted approver links to route to (with intent_token).
approvals_neededinteger
With approver_link_ids: how many must approve (default: all).
deny_ruleenum
With approver_link_ids: any (default) ends it at the first deny; unreachable once approval can't happen. One of any, unreachable.
grantobject
The scope, as on an invite (action_types, max_amount, products).
intent_tokenstring
The agent's intent token (preferred; the approval binds to it).
jtistring
A bare jti (unbound; never satisfies verify).
action_descriptionstringRequired
Must be the action the intent token was authorized for.
amountnumber
The amount.
approval_expires_ininteger
The approval's expiry in seconds.
link_expires_ininteger
How long each single-use link works.
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
Which messages may go (app_notification, email, text); one message goes. Left out, your account's default.
deliveryenum
send, or self: send nothing; the response carries approve_url. Left out, your account's default. One of send, self.
contextobject
Details shown to the approver.

Returns

Promise<RoutedApproval | GroupRoutedApproval> The approval, routed to the new contact. link_status is invited until they set up a passkey.

HTTP operation

POST /v1/mandate/approver_links/route: Route an approval to someone new

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approver_links/route`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "contact": "ana@northside.example",
    "jti": "jti_route_ana_1",
    "action_description": "Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
    "amount": 850
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.