Skip to content
Docs

Authentication

The order and recording endpoints take an API key in the Authorization header. The trigger URL uses the secret token in its path instead.

Headers

HeaderValueNeeded for
AuthorizationBearer av_live_…Every /v1/orders and /v1/recordings request
Content-Typeapplication/jsonPOST /v1/orders
Idempotency-Key1 to 200 visible ASCII characters (optional)POST /v1/orders. See Idempotency
Authorization: Bearer av_live_9a3f…
Content-Type: application/json

API keys

Managing keys

Keys are managed in the dashboard under Developer. Every member of the workspace can see the list; only an owner or admin can create, rename or revoke a key.

Test keys

A key that starts with av_test_ creates test orders. A test order never rings a phone, never sends a text, never holds or charges your wallet, and does not count toward your live-call limit. A simulated call plays out within about a minute and you get the normal signed webhooks, with "test": true in every payload.

Pick the outcome with the last four digits of lead.phone:

Last 4 digitsWhat happensWebhooks
0001 (and any number not listed here)A person answers and books: BOOKED, with an appointment tomorrow at 17:00 UTC.order.completed
0002Voicemail: the fallback text is simulated (when send_sms_on_voicemail is on), the order goes to VOICEMAIL_SMS_SENT then RETRY_SCHEDULED one minute later; the second attempt answers and books (BOOKED). With max_attempts: 1 it ends at VOICEMAIL_SMS_SENT (or FAILED when texts are off).order.updated, then order.completed
0003A person answers and is not interested: DISQUALIFIED.order.completed

For example +14155550002 plays the voicemail path. Use real US area codes (mainland, Alaska, Hawaii): a Canadian, Caribbean or US territory number is refused with 422 unsupported_destination, as in live mode.

When authentication fails

A missing, malformed, unknown or revoked key returns:

HTTP/1.1 401 Unauthorized

{
  "success": false,
  "error": "unauthorized",
  "message": "A valid API key is required: Authorization: Bearer av_live_..."
}

Order of checks on POST /v1/orders: the body is read and the consent object is checked before the API key. A request with a bad or missing consent object gets 400 consent_required even when the key is also wrong. Fix consent first, then the key.

Keeping keys safe

Trigger URL

The no-code trigger URL (/v1/hooks/lead/{token}) does not use an API key. The long random token in the URL is the credential. Treat the whole URL like a password. See Trigger URL.