View as Markdown

Mandate · Guide

Register your agent's calls

Register a call before your agent dials, so the business that answers can check which agent is calling, who operates it and what its person allowed. The agent signs a short-lived call credential with its key, and Provenance returns a 6-digit short code for the agent to speak if asked. Registering is free.

Before you begin: register the agent and publish its Ed25519 key, as in sign your agent's requests. The steps below use the sandbox account key, and calls go from +14155550100 to a business line at +14155550123.

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
  1. Your agent
    signs the call credential
  2. Provenance
    checks it and returns the short code
  3. The business
    checks the call as it rings

1. Verify the number your agent calls from

Add the number with side: caller. Provenance texts it a 6-digit code, or reads the code out on a call with channel: call for a landline or a contact-centre line. A key needs the mandate scope.

curl -s -X POST $PROVENANCE_API/v1/mandate/call_numbers \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "number": "+14155550100", "side": "caller" }' | tee number.json
export NUMBER_ID=$(jq -r .id number.json)
{
  "id": "cnum_01M6XS88KR3S50F75T14QJ6DQ4",
  "object": "call_number",
  "side": "caller",
  "last4": "0100",
  "country": "US",
  "status": "pending",
  "channel": "sms",
  "verified_at": null,
  "created_at": "2026-11-08T14:33:29.976Z",
  "delivery": { "channel": "sms", "delivered": false, "reason": "channel_not_configured" }
}

delivery says whether the code went out. Then send the code back within 10 minutes; you have 5 tries:

curl -s -X POST $PROVENANCE_API/v1/mandate/call_numbers/$NUMBER_ID/verify \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "code": "204135" }'
{
  "id": "cnum_01M6XS88KR3S50F75T14QJ6DQ4",
  "object": "call_number",
  "side": "caller",
  "status": "verified",
  "verified_at": "2026-11-08T14:33:29.990Z"
}

The number stores as a keyed hash plus its last four digits. When another account later verifies the same number, it moves to that account.

2. Give the grant a call scope

A call registers against a grant whose constraints include calls, or against a one-time approval. The call scope stays on the grant on the server and never enters the grant token.

purposesstring[]
Required. The purposes the agent may call for, from the closed list on the call credential reference.
counterpartiesstring[]
Numbers in E.164, or business names verified by the line's owner. Leave it out to allow any number.
max_amountinteger
The most the agent may commit to on a call, in minor units, with currency. A business that asks for more reaches the person.
max_calls_per_dayinteger
Calls a day under this grant, counted in the scope's time zone.
hoursobject
{ tz, schedule }: the weekly hours the agent may call, such as { "mon": [["09:00", "18:00"]] }.
curl -s -X POST $PROVENANCE_API/v1/mandate/grants \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "constraints": {
      "expires_at": "2027-06-30T00:00:00Z",
      "calls": { "purposes": ["book", "cancel"], "counterparties": ["Bistro Nine"], "max_amount": 20000, "currency": "USD", "max_calls_per_day": 5 }
    }
  }' | tee grant.json
export GRANT_ID=$(jq -r .id grant.json)
{
  "object": "grant",
  "status": "active",
  "device_id": "dev_00000000000000000000000000000001"
}

In production the grant names the agent with agent_id, so only that agent can call under it.

3. Register the call before dialing

Sign the call credential with the agent's private key and post it. The credential binds both numbers, a window of 15 minutes at most that starts within 60 seconds of now, the purpose and the grant. The format is on the call credential reference.

The registerCall helper in @provenanceauth/agent-adapters builds the claims, signs them and posts them in one call. With the SDK, signCallCredential signs and mandate.calls.register posts:

# CREDENTIAL is the compact JWS your agent signed (alg EdDSA, typ call+jws)
curl -s -X POST $PROVENANCE_API/v1/mandate/calls \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"credential\": \"$CREDENTIAL\" }"
{
  "id": "call_01M6XS88MWEMC2TK5MM9Y9MAWE",
  "object": "call",
  "status": "registered",
  "agent_id": "agt_01M6XS88KNFTWDGP2MRBSJG3WR",
  "purpose": "book",
  "short_code": "512656",
  "not_before": "2026-11-08T14:33:30.000Z",
  "expires_at": "2026-11-08T14:43:30.000Z",
  "person_approved": true,
  "grant_id": "grt_01M6XS88MSV3GBK874W606KSBA",
  "approval_id": null,
  "created_at": "2026-11-08T14:33:30.011Z"
}

short_code is returned only here. Keep it for the call: when a business asks for proof, the agent speaks the digits or keys them as tones. Every attempt writes one row to your decision ledger.

A refusal is a 200 with status: refused and a reason code, and nothing is registered:

{
  "id": null,
  "object": "call",
  "status": "refused",
  "reason": "call_purpose_not_allowed",
  "message": "the grant allows book, cancel",
  "decision_id": "mas_01M6XS88P6BKRJDS6PN8EA08EM"
}

disclosure and consent are records your agent carries into the verdict and the receipt. They are designed to support disclosure and consent rules for AI-voiced calls; your agent still has to meet the rules that apply to it, such as saying it is an AI.

4. Answer a business's challenge

A business that gets a call your agent didn't register can challenge it. Its receptionist says "Please verify this call with Provenance, code 6-7-5-8-0-7." and plays the tones *675807#. The last digit is a check digit, so a misheard code is caught before anything is sent.

listenForChallenge() in @provenanceauth/sdk finds the phrase in your agent's transcript or the tones in its keypad events. Register the call with that code as challenge_code, and the business's waiting check turns verified:

curl -s -X POST $PROVENANCE_API/v1/mandate/calls \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"credential\": \"$CREDENTIAL\", \"challenge_code\": \"675807\" }"
{
  "id": "call_01M6XS88QCHCQC7EGM8KS6XV1T",
  "object": "call",
  "status": "registered",
  "short_code": "625375",
  "person_approved": true,
  "answered_check_id": "ccx_01M6XS88PYFZ9T119KKNHFF5KD"
}

A wrong code registers nothing and uses one of the challenge's 5 tries. Agents that speak MCP can use the answer_call_challenge tool in @provenanceauth/mcp-server, which signs and registers in one step.

5. Handle proof requests and revoke calls

When a business challenges a call from your verified number, your webhook endpoints subscribed to mandate.call.proof_requested get the event with proof_request_id and the last four digits of both numbers. If one of your agents is on that call, register it, and the waiting check matches. If none is, decline the request: the business's check returns no_proof, and you get mandate.call.spoof_suspected.

curl -s -X POST $PROVENANCE_API/v1/mandate/calls/proof_requests/ccx_01M6XS88R5FRAGAMTCFZBXJVT2/decline \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "not_ours" }'
{
  "id": "ccx_01M6XS88R5FRAGAMTCFZBXJVT2",
  "object": "call_proof_request",
  "status": "declined",
  "created_at": "2026-11-08T14:33:30.117Z"
}

answerProofRequest() in @provenanceauth/agent-adapters matches the event to your agent's open calls and does one or the other. To stop a registered call from verifying, revoke it with POST /v1/mandate/calls/{id}/revoke. Revoking the grant or suspending the agent revokes its open calls too.

Errors you might see

SymptomCauseFix
call_number_unverified refusalfrom isn't a caller number your account verifiedVerify it (step 1), then register again.
call_window_invalid refusalThe window is over 15 minutes, or nbf is more than 60 seconds from nowSign the credential as the agent dials, with a window of 15 minutes or less.
call_signature_invalid refusalThe signature, kid or iss doesn't match the agent's published keySign with the key you published, and set iss to the agent's directory.
call_purpose_not_allowed refusalThe grant's call scope doesn't list this purposeAsk the person for a wider grant or a one-time approval.
call_counterparty_not_allowed refusalThe number called isn't one of the grant's counterpartiesAsk the person to add the business.
call_outside_hours refusalThe call starts outside the grant's hoursCall within the hours, or ask for a one-time approval.
call_daily_limit refusalThe grant's calls for today are usedWait for tomorrow, or ask for a one-time approval.
call_challenge_invalid refusalThe challenge code is wrong, or no challenge is open for these numbersAsk the business to repeat the code.
call_number_code_invalid (400)The number's code is wrong, expired or out of triesAdd the number again for a new code.
directory_unavailable (503)An agent with its own directory: the directory didn't answerServe the keys over https and register again.
calls_not_configured (503)Verified calls aren't turned on for this deploymentTreat the call as unregistered.

See also