How Avox API keys work: named live (avx_live_) and test (avx_test_) keys for one WhatsApp number, the Authorization header, emailed codes for creating, rotating and revoking, rotation that keeps limits, and keeping keys safe.
Every request to the Avox API is authenticated with an Avox API key sent in the
Authorization header. There's nothing else to set up - no OAuth, no signing, no Meta token.
avx_live_8f2a…) so you can tell keys apart.Avox-Test-Mode: true header.Admins - and Managers an Admin has given Manage API keys - can create, rotate or revoke keys. Each of those three actions also needs a 6-digit code emailed to the person doing it: it works once, for 10 minutes, only for that one action on that one key (or number), and stops working after 5 wrong tries. See Confirmation codes.
Open Settings > API Keys and click Create a key
This tab lists every key across every connection in the Switchboard. You can also use Create a key for this number in the Outbound API keys section on a connection's own page.
Pick the Switchboard and the WhatsApp number
The Switchboard you're in is picked to start with. If it has more than one number, choose one - each shows its name, the number partly hidden, and its status. Avox never guesses the number. If you have no connected number yet, the tab shows "Connect a WhatsApp number first - a key always sends from one number."
Choose Live key or Test key, and name the key
Live key "Sends real WhatsApp messages from this number"; Test key "Never sends anything". The Key name is suggested for you (for example "Sales line live key"); add What it's for if you like.
Click Email me a code, and type the code
The key is created as soon as the last digit is in, and Your new API key opens with the full key and a copy button.
Copy it, then click Done
This is the only time the full key is shown. If you close the dialog without copying it, rotate that key (or revoke it and create another).
The step-by-step guide with every button on both screens is on API keys.
API access depends on your plan. On a plan without it, both screens read "API access isn't
included in your plan" in place of the create form, with a link to the plans that include it. Your
keys stay listed, but new keys can't be created or rotated, and existing keys stop sending with
api_not_in_plan until your plan includes API access again. A
paused plan has no API access either. See
API access and your plan.
If API keys are switched off for your account, both screens say so in place of the create form
("API keys have been turned off for your account"). Existing keys stop sending too, with
api_access_disabled. Contact Support if you
need them.
Put the key in the Authorization header with the Bearer scheme, on every request:
Authorization: Bearer avx_live_your_key_here
curl -X POST https://api.avox.com/api/messages/send \
-H "Authorization: Bearer $AVOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"15551234567","type":"text","text":{"body":"Hi!"}}'
const res = await fetch("https://api.avox.com/api/messages/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AVOX_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ to: "15551234567", type: "text", text: { body: "Hi!" } }),
});
import os
import requests
res = requests.post(
"https://api.avox.com/api/messages/send",
headers={"Authorization": f"Bearer {os.environ['AVOX_API_KEY']}"},
json={"to": "15551234567", "type": "text", "text": {"body": "Hi!"}},
timeout=30,
)
Bearer can be any case, followed by one or more spaces and the key.A key carries its connection with it. That's why the URL has no phone number id, and why nothing in the request body can point a send at a different number or a different account.
connection_paused until it's resumed.connection_not_found.connection_not_ready.Use Test in Settings > API Keys to see which number a key sends from - a working key shows "Working - routes to" followed by the connection's name.
Rotate swaps a key for a new one with no downtime. The new key keeps the old one's name, number, mode (a test key rotates into a new test key), description and limits, and the old key keeps working for the grace period you pick.
Rotating never resets anything. The new key gets the limits the old key has at that moment (allowed IPs, per-minute limit, daily allowance), and the counts carry on: requests made with the old key today count toward the new key's daily allowance, and both keys share the per-minute limit while both work. A rotation can't be used to get a fresh allowance.
Click Rotate
Pick the grace period
Confirm with the emailed code
Deploy the new key
Check the old key is idle
After the grace period the old key fails with key_expired. Full details:
Rotate a key.
Idempotency-Key values
belong to one API key, so a retry sent with the new key runs as a new request. Finish any
retries in flight before you switch, or accept that one message could go out twice.Click the bin button (Revoke this key) next to the key in Settings > API Keys or on the
connection's page, then Email me a code to revoke and type the 6-digit code. A revoked key stops
working on the very next request, with
key_revoked, and moves to Revoked and expired keys in Settings >
API Keys. Revoking can't
be undone - create a new key if you need one again. Its past requests stay on the API logs.
If a key may have leaked, rotate it with Immediately (or revoke it). It fails with
key_expired or key_revoked on the very
next request.
Last updated