# Route to an approver

Get a yes from someone outside your account. Invite them once, route your agent's approvals to them by text, and the same verify call returns valid when they approve with their passkey.

Use the approver network when your agent needs a yes from someone who isn't on your team, such as your customer, a client or a finance lead. You invite them once. After that, each request reaches them by text, they approve with face, fingerprint or passkey in the browser, and your agent's verify call returns `valid`. You see their display name and their decisions, never their contact details or other links.

The loop:

1. Invite the approver. They accept with a passkey of their own.
2. Verify with `approver_link_id`. When your policy needs a yes, the approval goes to the approver.
3. The approver gets a text, opens the link and decides.
4. The same verify call returns `valid`, bound to the exact action and payload they approved.

**Before you begin:** export the sandbox account key, and set a [step-up policy](https://provenanceauth.com/docs/mandate/guides/step-up-approval.md) rule (`require: { approval: true }`) for the actions that need a yes. You can invite only a contact you already hold for your own user; there is no directory or search.

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
```

**Limitations:** the consent text an approver sees is marked DRAFT while it's under legal review. Texts go out only when the server has an SMS sender configured; in the sandbox nothing is sent, and the response says so.

## 1. Invite the approver

Send an invite with [`POST /v1/mandate/approver_links`](https://provenanceauth.com/docs/api/approver-network.md#post-v1-mandate-approver-links). Give the person's phone in E.164 form, their email, or both in `contact`, the same object every request takes. One string with a phone or an email still works. The `grant` says what you'll ask them to approve:

| Grant field | Meaning |
| --- | --- |
| `max_amount` | The largest amount you'll route to them |
| `action_types` | The kinds of action you'll route |
| `products` | The Provenance products the link covers |

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/approver_links \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "contact": { "phone": "+14155550177", "email": "dana@example.com" }, "grant": { "max_amount": 1000, "action_types": ["payment"] } }' | tee link.json
export LINK_ID=$(jq -r .id link.json)
```

**Node**

```ts
const res = await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approver_links`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ contact: { phone: "+14155550177", email: "dana@example.com" }, grant: { max_amount: 1000, action_types: ["payment"] } }),
});
const link = await res.json();
```

**Python**

```python
import os
import httpx

api, headers = os.environ["PROVENANCE_API"], {"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}
link = httpx.post(
    f"{api}/v1/mandate/approver_links",
    json={"contact": {"phone": "+14155550177", "email": "dana@example.com"}, "grant": {"max_amount": 1000, "action_types": ["payment"]}},
    headers=headers,
).json()
```

```json
{
  "id": "lnk_01M5Q2H4DXP9F05T994KREYCNS",
  "object": "approver_link",
  "status": "invited"
}
```

The response also has an `invite_url` you can deliver yourself. Invites are limited per day, a contact can't be invited again for a while, and a recipient can block you (both contacts, when you gave two).

### How the invite reaches them

An invite goes the way any request does. With both contacts:

| The person | They get |
| --- | --- |
| Has the Provenance app and verified one of the contacts there | An app notification and the email. If they don't open the invite within your wait (5 minutes by default), a text follows |
| Anyone else | The text and the email |

Each message carries its own link: accepting through the texted one proves the phone, and through the emailed one the inbox. The response lists each message in `deliveries`, with the masked contact it went to, and `channels` and `follow_up_text` say what was in force:

| Field | Values |
| --- | --- |
| `delivery` | `send` (the default), or `self`: nothing is sent and you pass `invite_url` on. The contact is still required and kept, because the person verifies it when accepting |
| `channels` | Any of `app_notification`, `email` and `text`. A narrower list sends only what it names; the follow-up text needs both `app_notification` and `text` |
| `follow_up_text` | `{ "enabled", "when", "after_minutes" }`: on or off, `not_opened` (the default) or `not_finished` (not accepted or declined), and the wait from 1 to 1440 minutes. An invite has no expiry, so any wait is accepted. Pro and above on a live deployment; every plan in the sandbox |

Left out, each takes your account's default in **Settings › Reminders**. An invite has no automatic reminders: `reminders` is refused with `400 parameter_invalid`. Opening the invite page or tapping the notification counts as opened; accepting, declining, blocking or your revoke ends a waiting follow-up. When it goes, or was due and could not go, you get `mandate.approver_link.follow_up_sent` or `mandate.approver_link.follow_up_not_sent`. The [request delivery](https://provenanceauth.com/docs/messaging/reminders.md#11-the-follow-up-text) section of the reminders guide has the full rules.

## 2. The approver accepts

The approver opens the invite and sees exactly what you're asking for and the consent text. They accept by creating a passkey that belongs to them, not to you. If they're already in the network, they confirm with the passkey they have.

When they accept through the link in the text, their phone number counts as verified, and text becomes how they hear about your requests. An approver who accepted another way still sees every request in their approver portal.

They can also add their own limits from the approver portal: a lower amount ceiling, a passkey requirement or quiet hours. Their limits only ever tighten your grant.

## 3. Check the link

List your links with [`GET /v1/mandate/approver_links`](https://provenanceauth.com/docs/api/approver-network.md#get-v1-mandate-approver-links). A link is `active` once accepted:

**curl**

```bash
curl $PROVENANCE_API/v1/mandate/approver_links \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const links = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approver_links`, { headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` } })).json();
```

**Python**

```python
links = httpx.get(f"{api}/v1/mandate/approver_links", headers=headers).json()
```

```json
{
  "object": "list",
  "data": [
    {
      "id": "lnk_01M5Q2H4DXP9F05T994KREYCNS",
      "object": "approver_link",
      "status": "invited",
      "approver_display_name": null,
      "grant": { "max_amount": 1000, "action_types": ["payment"] },
      "accepted_at": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## 4. Verify with the approver's link

Verify your agent's intent token as usual with [`POST /v1/mandate/assessments`](https://provenanceauth.com/docs/api/intent-tokens.md#post-v1-mandate-assessments), and add `approver_link_id`. When a step-up rule fires, the approval goes to that approver instead of your own team. This needs an accepted link:

**curl**

```bash norun
curl $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: $850.00 to Brindlecote Supplies",
    "action_payload": { "type": "payment", "amount": 850, "currency": "USD", "payee": "acct_brindlecote_supplies" },
    "context": { "action_type": "payment", "transaction_amount": 850 },
    "approver_link_id": "'"$LINK_ID"'"
  }'
```

**Node**

```ts
import Provenance from "@provenanceauth/sdk";

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY! });
// Polls until the approver decides (or the timeout), then returns the final verification.
const result = await prov.mandate.assessments.createWithApproval({
  intentToken,
  actionDescription: "Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
  actionPayload: { type: "payment", amount: 850, currency: "USD", payee: "acct_brindlecote_supplies" },
  context: { actionType: "payment", transactionAmount: 850 },
  approverLinkId: link.id,
});
```

**Python**

```python
from provenanceauth import Provenance

prov = Provenance(api_key=os.environ["PROVENANCE_KEY"])
result = prov.mandate.assessments.create_with_approval(
    intent_token=intent_token,
    action_description="Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
    action_payload={"type": "payment", "amount": 850, "currency": "USD", "payee": "acct_brindlecote_supplies"},
    context={"action_type": "payment", "transaction_amount": 850},
    approver_link_id=link["id"],
)
```

The first call opens the approval and answers `approval_pending`:

```json
{
  "object": "mandate_assessment",
  "valid": false,
  "reason": "approval_pending",
  "approval_id": "appr_01M5Q2KD3N7V4Y9W1XQ2B8R6TS",
  "expires_at": "2026-10-24T13:59:30.000Z",
  "approver_link_id": "lnk_01M5Q2H4DXP9F05T994KREYCNS",
  "delivery": { "channel": "text", "delivered": true },
  "policy": {
    "id": "pol_3F9A1C7E52B04D8E6A1F27C9B4",
    "version": 3,
    "rule": {
      "id": "rul_01JD9Q4N7C2V5X8B1M3K6T9W2R",
      "name": "Payments need a yes",
      "phase": "assess",
      "action": "challenge",
      "conditions": [
        { "fact": "action_type", "op": "eq", "value": "payment", "actual": "payment" }
      ]
    }
  }
}
```

The approval covers this token's action and payload only. The approver's own limits apply: an amount above the link's ceiling answers `approver_ceiling_exceeded` with `effective_max_amount`, and nothing is sent. Once an approval exists for a token and action, later calls keep its routing.

### Or route it yourself

To ask the approver outside a verify call, send the intent token to [`POST /v1/mandate/approver_links/{id}/approvals`](https://provenanceauth.com/docs/api/approver-network.md#post-v1-mandate-approver-links-id-approvals). The approval binds to the token the same way, so verify finds it:

**curl**

```bash norun
curl $PROVENANCE_API/v1/mandate/approver_links/$LINK_ID/approvals \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "intent_token": "'"$INTENT_TOKEN"'", "action_description": "Pay invoice INV-2041: $850.00 to Brindlecote Supplies", "amount": 850 }'
```

**Node**

```ts
const routed = await prov.mandate.approvers.route(link.id, {
  intentToken,
  actionDescription: "Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
  amount: 850,
});
```

**Python**

```python
routed = prov.mandate.approvers.route(
    link["id"],
    intent_token=intent_token,
    action_description="Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
    amount=850,
)
```

```json
{
  "id": "appr_01M5Q2KD3N7V4Y9W1XQ2B8R6TS",
  "object": "approval",
  "approver_link_id": "lnk_01M5Q2H4DXP9F05T994KREYCNS",
  "status": "pending",
  "bound": true,
  "requires_biometric": true,
  "effective_max_amount": 1000,
  "exceeds_ceiling": false,
  "deferred_quiet_hours": false,
  "delivery": { "channel": "text", "delivered": true },
  "channels": ["app_notification", "email", "text"],
  "expires_at": "2026-10-24T13:59:30.000Z"
}
```

The older form takes a bare `jti` instead of the token. It reaches the approver, but it isn't bound to an action, so it never makes verify return `valid`. Use `intent_token`.

## Choose the channels

One message goes to the approver: their Provenance app when they use it, then their own channels in their order (a text when they have a verified phone, then email). A resend uses the same channel.

To narrow it, pass `channels` on verify or routing, for example `["email"]`. The approver's order stays, a channel you leave out is skipped, and `delivery.channel` says which one went. A list that leaves nothing to try sends nothing and reads `reason: "channel_excluded"`. Left out, `channels` and `delivery` take your account's defaults in **Settings › Reminders**.

## Deliver the link yourself

To show the approval link in your own app instead of sending it, pass `"delivery": "self"` with `approver_link_id` on verify, or on routing. Nothing is sent and nothing counts toward the Free trial's texts. The response carries `approve_url`, a single-use link to show the approver:

```json
{
  "object": "mandate_assessment",
  "valid": false,
  "reason": "approval_pending",
  "approval_id": "appr_01M5Q2KD3N7V4Y9W1XQ2B8R6TS",
  "approver_link_id": "lnk_01M5Q2H4DXP9F05T994KREYCNS",
  "delivery": { "channel": "self", "delivered": false, "reason": "self_delivery" },
  "approve_url": "https://app.provenanceauth.com/approve/m58BLgyzmMWM4iV5i1XhNzS5g9rXsvQ85cv8"
}
```

The approver still approves with their own passkey, so whoever opens the link can't approve without it. Treat `approve_url` as a secret and show it only to the approver. When the approver asks for a new link, the `mandate.approval_link.resent` webhook carries the new `approve_url`. Without `approver_link_id`, `"delivery": "self"` returns `400` `self_delivery_not_allowed`.

## Show the approval in your product

To let the approver decide inside your own app instead of on Provenance's page, mint an embed token with the `approve` widget and the routed approval's ID, and render [`<provenance-approve>`](https://provenanceauth.com/docs/embeds.md) with it.

The component names your company and shows the action and amount. Only the approver's own passkey can approve it, and that passkey works in the component on any site because the passkey step runs on Provenance's domain. Your account's devices and keys still can't approve a routed request; you can only withdraw it with a deny. The decision is the approver's on your ledger (`approver_id`), and the network decision's facts carry `surface: "embed"`.

A first-time approver sets up their passkey on **Approve** in the component, the same way as on the approval page. The component never shows the "Never contact me again" link: that stays on Provenance's own pages.

For an approver who decides many of your requests, mint an `approvals` token with their link and render [`<provenance-approvals>`](https://provenanceauth.com/docs/embeds.md#9-an-approvers-inbox-in-your-product) instead: every request you routed to them that waits for them, newest first, group progress included, with [Approve selected](https://provenanceauth.com/docs/mandate/guides/batch-approvals.md#approve-selected-in-your-product) for up to 25 at once.

## First-time approvers and credential age

To ask someone who has no approver link yet, send the request to [`POST /v1/mandate/approver_links/route`](https://provenanceauth.com/docs/api/approver-network.md#post-v1-mandate-approver-links-route) with their `contact` and the same fields as routing. It creates the invite and the approval together and sends one message. The invite limits apply.

**curl**

```bash norun
curl -X POST $PROVENANCE_API/v1/mandate/approver_links/route \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "contact": "ana@northside.example", "intent_token": "'"$INTENT_TOKEN"'", "action_description": "Pay invoice INV-2041: $850.00 to Brindlecote Supplies", "amount": 850 }'
```

**Node**

```ts
const routed = await prov.mandate.approvers.routeTo("ana@northside.example", {
  intentToken,
  actionDescription: "Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
  amount: 850,
});
```

**Python**

```python
routed = prov.mandate.approvers.route_to(
    "ana@northside.example",
    intent_token=intent_token,
    action_description="Pay invoice INV-2041: $850.00 to Brindlecote Supplies",
    amount=850,
)
```

The page looks the same as for anyone else. When the person taps **Approve**, it asks them to set up a passkey on that phone or with another passkey, and the passkey then approves in the same step. Deny and "Never contact me again" work without setting anything up. Someone who already approves for another company uses the passkey they have.

Every decision by an approver carries an [approval context](https://provenanceauth.com/docs/concepts/approval-context.md) on the mandate assessment, on [`GET /v1/mandate/approvals/{id}`](https://provenanceauth.com/docs/api/approvals.md#get-v1-mandate-approvals-id) and in the `mandate.approval.approved` and `mandate.approval.declined` webhooks:

| Field | What it tells you |
| --- | --- |
| `method` | `passkey`, `device_key` (the Provenance app) or `voice_keypad`, and whether the person was verified |
| `passkey` | `new` when it was set up during this approval, else `existing`, its age in days and minutes, and whether it is synced |
| `device` | The OS, browser, time zone and language the device reports, never verified |
| `network` | The connection's country and region (a provider's estimate) and its VPN, proxy, cloud, Tor and Private Relay flags |

A passkey proves that whoever holds it unlocked their device. It doesn't prove who they are, and a new passkey only proves control of the phone or inbox the link reached. To ask for an older one, add `approval_min_credential_age_s` to the rule:

```json
{ "id": "big-payments-need-a-known-approver", "when": [{ "fact": "transaction_amount", "op": "gt", "value": 10000 }], "require": { "approval": true, "biometric": true, "approval_min_credential_age_s": 86400 } }
```

A younger passkey makes verify answer `approval_credential_too_new`. Rules can also read the decision as facts:

- `approval.passkey`: `new` or `existing`.
- `approval.tor`: the connection came from a Tor exit.
- `approval.vpn_or_proxy`: `likely` or `not_detected`.
- `approval.timezone_changed`: the zone differs from this passkey's last decision.
- `approval.timezone_mismatch`: the zone and the address are in different countries (with an IP-intelligence provider).

The approver's IP address is off by default. Turn it on with `share_approver_ip` on [`PUT /v1/mandate/settings/approvals`](https://provenanceauth.com/docs/api/account.md#put-v1-mandate-settings-approvals) once you have a purpose for collecting it. It is then returned as `approval_context.network.ip` with each decision and kept for 30 days. The decision ledger never holds the address, only a hash that matches when two decisions came from the same one.

## Require the Provenance app

Some approvers should use a phone key: finance and operations staff, for example. Add `approval_method: "device_key"` to the approval rule, and only the approver's phone, in the Provenance app, can approve. Your face or fingerprint unlocks a key made on that phone, and the key signs the exact action.

The approval link and your console can still deny, but not approve. To require a phone whose key the server verified at a given tier, add `min_tier`. Without `approval_method`, an approval rule doesn't read `min_tier`.

```json
{ "id": "spend-needs-the-app", "when": [{ "fact": "transaction_amount", "op": "gt", "value": 5000 }], "require": { "approval": true, "approval_method": "device_key", "min_tier": "tee" } }
```

| What happened | Verify answers |
| --- | --- |
| Approved without the app | `approval_device_key_required` |
| Approved on a phone below `min_tier` | `device_tier_insufficient` |
| Approved in the app at the tier | valid |

A decision made in the app has `decided_via: "app"`. Its approval context's method is `device_key`, and its device (iOS or Android) comes from the phone's enrollment. The device reads `verified: true` when the server verified the phone's attestation in full. Rules can read `approval.method` and `approval.device_tier` (software, tee, strongbox or sep).

To ask an approver to set up the app, invite them with `"ask_app": true` on [`POST /v1/mandate/approver_links`](https://provenanceauth.com/docs/api/approver-network.md#post-v1-mandate-approver-links). The invite page then asks them to approve with the Provenance app. Each approver's app status is in the `app` field of [`GET /v1/mandate/approver_links`](https://provenanceauth.com/docs/api/approver-network.md#get-v1-mandate-approver-links) and on the console's **Team** page.

## 5. The approver decides

The approver gets one text with a single-use link:

```text
Brindlecote's agent is attempting to Pay invoice INV-2041: $850.00 to Brindlecote Supplies and requires verification: https://app.provenanceauth.com/approve/…
```

The link opens the request, "Brindlecote’s agent requested your approval", with Approve, Ask for a change and Deny. Approving takes the approver’s own passkey, with their face, fingerprint or screen lock; your account’s devices can’t approve it, and your console can only deny it to withdraw the request. The link works once. The approver can also decide from the "Waiting for you" list in their approver portal.

`delivery` on the call that opened the approval says how it went:

| `delivery` | Meaning |
| --- | --- |
| `{ "channel": "text", "delivered": true }` | The text was sent. |
| `{ "channel": "app_notification", "delivered": true }` | The approver got it in the Provenance app. |
| `reason: "channel_not_configured"` | No SMS sender is configured on this server (always, in the sandbox), or the approver has email only. They see it in their portal. |
| `reason: "phone_not_verified"` | The approver's phone isn't verified yet. |
| `reason: "quiet_hours"` | The approver's quiet hours apply, so it wasn't texted. It's in their portal. |
| `reason: "send_failed"` | The SMS provider refused the send. |
| `reason: "channel_excluded"` | The `channels` you passed leave no way to reach this approver now. |
| `reason: "plan_send_limit"` | Free doesn't send texts to approvers, or the trial ended; `upgrade_url` says where to choose a plan. The email goes when the approver has one, and the approver still sees it in their portal. |
| `reason: "sender_not_ready"` | Your own number isn't approved yet, so no text went. The email goes when the approver has one. |
| `reason: "no_text_consent"` | The phone has no [consent to text](https://provenanceauth.com/docs/messaging/text-consent.md#10-when-a-text-goes) on record, so no text went. The email goes when the approver has one. |

In the sandbox, verify and the route also return `approval_link_token`, so a test can open the approval page and finish the loop.

## 6. Verify again

Call verify again with the same arguments. Once the approver approves, it returns `valid` and the approval:

```json
{
  "object": "mandate_assessment",
  "valid": true,
  "payload_bound": true,
  "approval_id": "appr_01M5Q2KD3N7V4Y9W1XQ2B8R6TS",
  "approved_at": "2026-10-24T13:51:02.000Z",
  "policy": {
    "id": "pol_3F9A1C7E52B04D8E6A1F27C9B4",
    "version": 3,
    "rule": {
      "id": "rul_01JD9Q4N7C2V5X8B1M3K6T9W2R",
      "name": "Payments need a yes",
      "phase": "assess",
      "action": "challenge",
      "conditions": [
        { "fact": "action_type", "op": "eq", "value": "payment", "actual": "payment" }
      ]
    }
  }
}
```

A request nobody decided answers `approval_expired`. If the payload changed after approval, verify answers `payload_hash_mismatch`. The `mandate.approval.approved` [webhook](https://provenanceauth.com/docs/integrate/webhooks.md) also fires with `network: true`, and the decision ledger names the approver.

A decline answers `approval_denied`. When the approver picked a reason, verify carries it as `deny_reason` and the approval and its webhook as `decline_reason`:

| `deny_reason` (verify), `decline_reason` (the approval, the webhook) | The approver chose |
| --- | --- |
| `unrecognized` | I don't recognize this |
| `wrong_amount` | The amount is wrong |
| `not_now` | Not right now |

Treat `unrecognized` as a warning sign about the agent or the session that asked.

## Set the expiry

An approval expires after the server default (10 minutes in the sandbox) unless you set it. Pass `approval_expires_in` in seconds on verify or on the route, or set an account default with [`PUT /v1/mandate/settings/approvals`](https://provenanceauth.com/docs/api/account.md#put-v1-mandate-settings-approvals):

**curl**

```bash
curl -X PUT $PROVENANCE_API/v1/mandate/settings/approvals \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "default_expires_in": 1800 }'
```

**Node**

```ts
await prov.account.setApprovalSettings({ defaultExpiresIn: 1800 });
```

**Python**

```python
httpx.put(f"{api}/v1/mandate/settings/approvals", json={"default_expires_in": 1800}, headers=headers)
```

```json
{
  "object": "approval_settings",
  "default_expires_in": 1800,
  "effective_default_expires_in": 1800
}
```

The expiry is 60 seconds to 7 days, and never later than the intent token's own expiry, because verify answers `token_expired` after that. A value out of range returns `400` [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid) with the longest allowed. Send `null` to go back to the server default.

There are two clocks:

| Field | What it limits | Default |
| --- | --- | --- |
| `approval_expires_in` | How long the request stays open. Verify answers `approval_pending` for this whole window. | The account default, then the server's |
| `link_expires_in` | How long each single-use link works. At least 60 seconds, capped at the approval. | The whole approval window |

Responses return both `expires_at` (the request) and `link_expires_at` (the link), and the approval page counts down.

When a link expires while the request is still open, the page offers "Send me a new link". A fresh link goes to the same verified contact on the same channel, the old one stops working, and your agent sees no change. Each request allows 3 new links, one a minute, and each emits the `mandate.approval_link.resent` webhook.

When the request itself expired, the page offers to ask you again. That emits `mandate.approval_link.resend_requested` once, so you can route a new request if you still want one.

**Limitations:** on Free, an account can send the trial's texts to approvers in total, counting invites, approval links and new links, and nothing after the trial ends. Past that, requests are still created and reach the approver portal, but nothing is sent: `delivery` answers `reason: "plan_send_limit"` with an `upgrade_url`. Nothing counts when nothing is sent, as in the sandbox.

## Customize the messages

Set your own wording with [`PUT /v1/account/notify_template`](https://provenanceauth.com/docs/api/account.md#put-v1-account-notify-template), or in the console under **Settings → Notifications**, which shows a preview. There are two templates for people outside your account:

| Field | Used for | Default |
| --- | --- | --- |
| `approver_sms_template` | Approval texts | `{{requester}}'s agent is attempting to {{action}} and requires verification: {{link}}` |
| `invite_sms_template` | Invite texts | `{{requester}} wants to route approvals to you on Provenance. Review & accept: {{link}}` |

The slots:

- `{{requester}}`: your branding display name, or a name taken from your account email's domain.
- `{{action}}`: the action, shortened to 80 characters.
- `{{link}}`: the single-use link. It's the only place a URL can appear.

The rules for both templates:

- They contain the requester and link slots. The link always opens our domain, so the platform stays identifiable.
- They have no URL or phone number outside the link slot.
- They are 320 characters at most.

Links and phone numbers are removed from the requester name and the action. A text that says who is asking and where it comes from is harder to imitate.

**curl**

```bash
curl -X PUT $PROVENANCE_API/v1/account/notify_template \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "approver_sms_template": "Provenance: {{requester}} needs your OK to {{action}}. Review: {{link}}" }'
```

**Node**

```ts
await prov.account.setThirdPartyTemplates({
  approverSmsTemplate: "Provenance: {{requester}} needs your OK to {{action}}. Review: {{link}}",
});
```

**Python**

```python
httpx.put(
    f"{api}/v1/account/notify_template",
    json={"approver_sms_template": "Provenance: {{requester}} needs your OK to {{action}}. Review: {{link}}"},
    headers=headers,
)
```

```json
{
  "notify_template": null,
  "approver_sms_template": "Provenance: {{requester}} needs your OK to {{action}}. Review: {{link}}",
  "invite_sms_template": null
}
```

Only the fields you send change, and `null` resets one to the default. The `template` field is the text for your own team's approvals. The approver templates are on Pro and up.

### Email templates

Approval and invite emails use the same endpoint. You set the subject and a short intro; the layout, the request details, the button and the footer are fixed.

| Field | Used for | Default |
| --- | --- | --- |
| `approver_email_subject` | The approval email's subject | The request in words, `Approve Harbor Bean for $40`; `{{requester}} needs your approval` when it names no payee and amount |
| `approver_email_body` | The approval email's one sentence | `{{requester}} is asking you to approve a payment from your agent.` |
| `invite_email_subject` | The invite email's subject | `{{requester}} wants to send you approval requests` |
| `invite_email_body` | The invite email's one sentence | `{{requester}} wants to send you approval requests from their agents.` |

The slots:

- `{{requester}}`: your name, as in the texts.
- `{{action}}`: the action, shortened to 80 characters.
- `{{amount}}`: the amount, with its currency.
- `{{expires}}`: when the link expires, for example "in 15 minutes".

A subject carries the requester slot and is 120 characters at most. An intro is plain text of up to 600 characters. Neither may contain a link, URL or phone number: the button is the only link.

Every email is branded from the same settings as the approval page. It ends with "Powered by Provenance", why the approver got it, and a link to stop emails from your company.

## Say what is being approved

The page opens with one sentence: "Scout is asking you to approve a payment from your agent." When the action is a stay, a flight, an order or a booking, send `display: { "kind": "stay" }` on [`POST /v1/mandate/assessments`](https://provenanceauth.com/docs/api/intent-tokens.md#post-v1-mandate-assessments) and the page reads "Scout is asking you to approve a stay." The kind is one of stay, flight, order, payment and booking. It is kept with the approval for the page only: never a token claim or a rule fact.

## Brand the approval page

The approval page and the invite page can carry your name, logo and colours, set with [`PUT /v1/account/branding`](https://provenanceauth.com/docs/api/account.md#put-v1-account-branding) or in the console under **Settings → Branding**, which shows a preview. Branding is on Pro and up, and only owners and admins can change it.

| Field | Where it shows | Rule |
| --- | --- | --- |
| `name` | The page header, the "requested by" line, and `{{requester}}` in texts | Up to 40 characters, no link or phone number, and not "Provenance" |
| `primary` | The Approve button and the logo tile | White text on it reaches 4.5:1 |
| `secondary` | The page background | The page text on it reaches 7:1, and the primary on it 3:1 |
| `accent` | Links, icons and the countdown | 4.5:1 on white and on the secondary colour |
| `help_url` | The "Questions? Contact" link | An https link |

**curl**

```bash
curl -X PUT $PROVENANCE_API/v1/account/branding \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Quillstack", "primary": "#4F46E5", "secondary": "#EEF0FF", "accent": "#0E7490", "help_url": "https://help.quillstack.example/approvals" }'
```

**Node**

```ts
await prov.account.setBranding({ name: "Quillstack", primary: "#4F46E5", secondary: "#EEF0FF", accent: "#0E7490", helpUrl: "https://help.quillstack.example/approvals" });
```

**Python**

```python
prov.account.set_branding(name="Quillstack", primary="#4F46E5", secondary="#EEF0FF", accent="#0E7490", help_url="https://help.quillstack.example/approvals")
```

A colour that misses its contrast floor returns `400` with the measured ratio. Only the fields you send change, and `null` clears one. Upload a logo with [`PUT /v1/account/branding/logo`](https://provenanceauth.com/docs/api/account.md#put-v1-account-branding-logo): a PNG, JPEG or WebP file, base64-encoded, up to 200 KB and 1024 × 1024 px. The type is read from the file itself, and SVG isn't accepted.

Some parts stay the same on every page: the request details and amount, the button wording, the countdown in the header, the address the page is served from, and "Powered by Provenance" at the bottom of the page, its mark in your brand colour.

The link still works once and expires; the countdown shows when. A branded page is always light; without branding, the page follows the approver's system theme. Without a display name, the requester is your account email's domain, never the address.

## Send from your own domain

Approver emails come from our address, with your name followed by "via Provenance" as the sender name. To send them from your own address, add a sending domain. It's on Pro and up, for owners and admins, and an account can have 3.

1. Add the domain with [`POST /v1/account/email_domains`](https://provenanceauth.com/docs/api/account.md#post-v1-account-email-domains), or in the console under **Settings → Branding**. The response lists the DNS records to publish: a DKIM record, a return-path CNAME, and a recommended DMARC record.
2. Publish the records at your DNS host. Pending domains are checked every hour for 72 hours, or check one now with [`POST /v1/account/email_domains/{id}/verify`](https://provenanceauth.com/docs/api/account.md#post-v1-account-email-domains-id-verify). `missing_records` lists what's still missing.
3. Once the domain is `verified`, set the sender with [`PUT /v1/account/branding`](https://provenanceauth.com/docs/api/account.md#put-v1-account-branding): `email_from`, `email_from_name`, and optionally `email_reply_to` on the same domain.

**curl**

```bash norun
curl -X POST $PROVENANCE_API/v1/account/email_domains \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "domain": "quillstack.example" }'
```

**Node**

```ts
const domain = await prov.account.addEmailDomain("quillstack.example");
// Publish domain.dnsRecords, then:
await prov.account.verifyEmailDomain(domain.id);
await prov.account.setBranding({ emailFrom: "approvals@quillstack.example", emailFromName: "Quillstack" });
```

**Python**

```python
domain = prov.account.add_email_domain(domain="quillstack.example")
prov.account.verify_email_domain(domain["id"])
prov.account.set_branding(email_from="approvals@quillstack.example", email_from_name="Quillstack")
```

With your own sender, the footer adds "Sent for" your name "by Provenance", and `delivery.sender` is `custom`. Verified domains are checked every hour. If DKIM stops verifying, the domain goes `failed` and emails come from our address at once. You get an email and the `email_domain.failed` webhook; fix the records and verify again. A domain another account verified returns `409` `email_domain_taken`.

## 7. Revoke the link

Either side can revoke a link. Pending approvals on it expire at once, and routing to it fails with `link_revoked`. Revoke with [`DELETE /v1/mandate/approver_links/{id}`](https://provenanceauth.com/docs/api/approver-network.md#delete-v1-mandate-approver-links-id):

**curl**

```bash
curl -X DELETE $PROVENANCE_API/v1/mandate/approver_links/$LINK_ID \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approver_links/${link.id}`, { method: "DELETE", headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` } });
```

**Python**

```python
httpx.delete(f"{api}/v1/mandate/approver_links/{link['id']}", headers=headers)
```

```json
{
  "id": "lnk_01M5Q2H4DXP9F05T994KREYCNS",
  "object": "approver_link",
  "deleted": true
}
```

## Errors you might see

| Symptom | Cause | Fix |
| --- | --- | --- |
| `429` [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded) on invite | The daily invite limit, or this contact was invited recently | Wait and try again. |
| `409` [`invite_declined`](https://provenanceauth.com/docs/platform/errors.md#invite_declined) | The contact blocked you or declined | You can't invite them again. |
| `403` [`link_revoked`](https://provenanceauth.com/docs/platform/errors.md#link_revoked) on verify or routing | Either side revoked the link | Send a new invite. |
| `404` [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing) on verify or routing | The link isn't accepted yet, or belongs to another account | Wait for `status: "active"`. |
| `403` [`intent_token_foreign`](https://provenanceauth.com/docs/platform/errors.md#intent_token_foreign) on routing | The token was issued to another account | Route it from the account that authorized it. |
| `409` [`approval_already_open`](https://provenanceauth.com/docs/platform/errors.md#approval_already_open) on routing | Verify already opened an approval for this token, or it went to another link | Poll verify; the first routing wins. |
| `403` [`approval_routed_to_approver`](https://provenanceauth.com/docs/platform/errors.md#approval_routed_to_approver) in the console | Only the approver can approve a routed request | Wait for their decision, or deny it to withdraw it. |
| `reason: "approver_ceiling_exceeded"` on verify | The amount is above the link's ceiling | Lower the amount, or ask an approver whose grant covers it. |
| `400` [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid) on a template | It's missing `{{requester}}` or `{{link}}`, or has a URL or phone number | Fix the template; the message names the rule. |
| `409` [`email_domain_taken`](https://provenanceauth.com/docs/platform/errors.md#email_domain_taken) | Another account verified this sending domain | Use a domain you control. |
| `503` [`email_not_configured`](https://provenanceauth.com/docs/platform/errors.md#email_not_configured) on a sending domain | This server has no email provider | Approver emails need one; contact support. |
| `503` [`approver_network_disabled`](https://provenanceauth.com/docs/platform/errors.md#approver_network_disabled) | New invites are paused on this server | Retry later; existing links keep working. |

## See also

- [Step-up approval](https://provenanceauth.com/docs/mandate/guides/step-up-approval.md)
- [Biometric approval](https://provenanceauth.com/docs/mandate/guides/biometric-approval.md)
- [Embeds](https://provenanceauth.com/docs/embeds.md), to put the enrollment step inside your own product
- [Use group sign-off](https://provenanceauth.com/docs/mandate/guides/group-approvals.md)
- [Batch approvals and the inbox](https://provenanceauth.com/docs/mandate/guides/batch-approvals.md)
