What is recorded
- Every
4xxanswer toPOST /v2/calls, on every channel. Two answers are left out because neither means a call was lost:409 duplicate_call(a request with the sameIdempotency-Keyis still in flight) and the replay of an answer we already gave for a key. - Every row in
contacts_rejectedfromPOST /v2/campaigns/{id}/contacts, and from contacts you send withPOST /v2/campaigns. Each is recorded with status400, codecontact_rejected, the row’sreasonas its message, and the routePOST /v2/campaigns/{id}/contacts. Only rejected rows are recorded on these routes. A request we refuse as a whole, such as one with more than 1000 rows, is answered with its error and not recorded, so check those answers in your code.
count: 750.
We keep only what tells you what went wrong. Before a message is stored, every
phone number and email address in it becomes •••. That is any run of six or
more digits, with or without a leading +, and also when spaces, hyphens or
brackets split the digits. The message is then cut at 300 characters. We never
store the request body, its variables or the phone number. The record is kept
for 30 days.
Read them with the API
Refusals are counted by the hour (UTC), so the window starts at the top of its
first hour. At 10:20 UTC,
hours=1 covers everything since 09:00 UTC, a little
more than the last 60 minutes.
Send your secret key, as you do for POST /v2/calls. For a
sub-workspace, add its Mirai-Workspace header to read
that brand’s refusals.
- cURL
- Python
- Node.js
200 OK
503 refusals_unavailable means we couldn’t read the record just then. Try
again shortly.
See them in the console
Open Developers → Refused requests in the sandbox or live console. Each row is one group: when it was last seen, the route, the status, the count, the message, the fix, and the agent’s name when we know it. Whenalert is true, the console shows a banner with how many API calls were
refused in the last 24 hours, the message and fix of the largest group, and a
See refused requests link. If you dismiss it, it stays hidden for the rest of
the day.
Email when a refusal repeats
When one kind of refusal happens 10 times within an hour, we email your company’s owners and billing contacts. The email says what was refused and how many times, quotes the message with numbers masked, says how to fix it, and links to Refused requests in the console and to this page.- Only companies that have gone live get these emails. A sandbox sees the same record in the API and the console, but gets no email.
- One email a day at most for each kind of refusal. The day runs on India time.
- At most 3 refusal emails a day for one workspace.
- Our support team gets an alert at the same time.
Alert on refusals in your own code
The email reaches people and comes at most once a day per kind. Your own code sees every refusal the moment it happens, so alert there too:- Log
error.codeanderror.messagefor every4xxfromPOST /v2/calls, with your own record id. - Alert when
4xxanswers pass a small rate, for example 5 in 10 minutes. A400,402,403,404or422keeps coming back until someone changes the request, the wallet or the agent, so retrying never clears it. - Treat a non-empty
contacts_rejectedfrom a campaign the same way. - From your monitoring, you can also read
GET /v2/account/refusals?hours=1every few minutes and alert whentotalgoes up oralertistrue.
- Python
- Node.js
RetryLater and alert_ops (alertOps in Node.js) stand for your own job queue and alerting.
Common refusals
Every error code, with its fix, is on Errors.
Related
Calls
Every error
POST /v2/calls can answer, and how long a variable can be.Direct calls or campaigns
When a steady flow of calls belongs in an always-on campaign.
Errors
The error envelope, every code, and the retry rules.
Campaigns
How a campaign reports rejected rows.