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
| Header | Value | Needed for |
|---|---|---|
Authorization | Bearer av_live_… | Every /v1/orders and /v1/recordings request |
Content-Type | application/json | POST /v1/orders |
Idempotency-Key | 1 to 200 visible ASCII characters (optional) | POST /v1/orders. See Idempotency |
Authorization: Bearer av_live_9a3f…
Content-Type: application/json
API keys
- A key looks like
av_live_followed by 16 to 128 letters, digits,_or-. - A key belongs to one workspace. It can create orders for any agent in that workspace and read that workspace's orders and recordings. There are no per-key scopes.
- A workspace can have more than one key, so you can rotate a key without downtime: add the new one, switch your systems, then revoke the old one.
- We store only a SHA-256 hash of the key, its first 12 characters and its last 4. A key is shown once, when it is created. If you lose it, make a new one.
- A revoked key stops working at once and gets
401 unauthorized.
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.
- Create: pick Live (
av_live_…) or Test (av_test_…) and give the key a name, such as the system that will use it. The full key is shown once. Copy it then; it cannot be shown again. - List: each key shows its name, live or test, a hint such as
av_live_9a3f…x7Qe(first 12 and last 4 characters), who made it, when, and when it was last used (updated at most once a minute). The full key is never shown again. - Revoke: the key stops working on the next request (
401 unauthorized). Revoking cannot be undone. - A workspace can have at most 20 active keys. Revoke one to make room. At most 20 keys can be created per workspace per hour (
429 rate_limited). - Creating, renaming and revoking a key is recorded in the workspace audit log with who did it.
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.
- The request is checked exactly like a live one:
consentis required, the number must be a US number, the agent must exist, be switched on and be published, and the do-not-contact list is checked. Only the wallet balance and the lead's calling hours are skipped. - The reply to
POST /v1/orderscarries"test": true, and so doesGET /v1/orders/{order_id}. - Test webhooks never go to your production default webhook URL. They go to the order's
webhook_url, else your workspace's test webhook URL (set by an owner or admin). With neither, nothing is sent. - Billed minutes and charged cents are always 0.
- At most 500 test orders per workspace in any 24 hours; after that
429 rate_limited. - An
Idempotency-Keybelongs to one mode: reusing a test order's key with a live key (or the reverse) is409 idempotency_key_conflict, never the other order.
Pick the outcome with the last four digits of lead.phone:
| Last 4 digits | What happens | Webhooks |
|---|---|---|
0001 (and any number not listed here) | A person answers and books: BOOKED, with an appointment tomorrow at 17:00 UTC. | order.completed |
0002 | Voicemail: 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 |
0003 | A 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
- Call the API from your server. The API answers browser CORS requests, but a key placed in web page code can be read by anyone.
- Keep keys in environment variables or a secrets manager, never in source control.
- Use a separate key per system (CRM, website, Zapier) so you can revoke one without breaking the others.
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.