Developers

Errors, rate limits and retries

What an API error looks like, every status and error code, how many requests each plan may make a minute, and how to retry without doing anything twice.

Developers

Before you start

  • Log the X-Request-Id of every answer. It is the fastest way for us to find a request when you ask.

What does an error look like?

Every error is JSON with a detail (a sentence to show or log; for 422 it may be a list of the fields at fault), a code to branch on, and the request_id. Every answer, error or not, carries the same id in its X-Request-Id header, and the request is in your Developers page logs under it: quote it when you ask us about a request.

An error
{
  "detail": "This token does not have the 'contacts:write' scope.",
  "code": "forbidden",
  "request_id": "5f2c9a1e7b3d4c6a8e0f"
}

Which status codes and error codes can I get?

Status codes and their code
StatuscodeWhen
400bad_requestThe request cannot be read: a malformed body or header.
401unauthorizedThe token is missing, unknown or revoked, or its workspace was deleted.
402plan_requiredThe plan does not include API access (the token is paused, not revoked), or has no calls left for this voice tier.
403forbiddenThe token lacks the endpoint's scope, is a sandbox token, the workspace is suspended, the address is not on the IP allowlist, or the person cannot be called or messaged (Do-Not-Call, no consent, outside the calling window).
404not_foundThe thing named is not there, or is switched off.
405method_not_allowedThe path exists, with another method.
409conflictIt cannot happen now: a calls-at-once limit, calling hours, a paused agent. Also idempotency_in_progress, while the first request with the same Idempotency-Key is still running.
413too_largeThe body or file is bigger than the endpoint takes.
422invalid_requestA field is missing or in the wrong form; detail lists them. Also idempotency_key_reused, when a key comes back with a different body.
428idempotency_key_requiredSending a message needs an Idempotency-Key header. Nothing was sent.
429rate_limitedMore requests this minute than the plan allows. Wait the seconds in Retry-After.
500server_errorOur fault. Not kept for idempotency, so the same key can be tried again.
502upstream_unavailableSomething the request depends on did not answer, so nothing was done. Try again.
503unavailableThe service is briefly unavailable. Try again shortly.

Each endpoint in the API reference lists its own reasons for each status.

How many requests can I make?

Each token may make a set number of requests a minute, across every endpoint, by plan. The next one answers 429 with a Retry-After header in seconds. A plan without its own figure gets 60 requests a minute. Some endpoints have a limit of their own as well, stated on the endpoint.

Requests a minute, per token
PlanRequests a minute
Starter60
Growth60
Professional120
Enterprise300

How do I retry without calling someone twice?

Send an Idempotency-Key header, any unique text up to 255 characters such as a UUID, with every write (every post, patch and delete). The same key again within 24 hours gets the first answer back, with Idempotent-Replayed: true, and nothing is done twice: no second call, no second contact. The same key with a different body answers 422; while the first is still running, 409. An answer of 500 or above is not kept, so the key can be tried again. With the scope messages:send the header is required: without it the request answers 428 and nothing is sent.

How do I page through a list?

Lists answer {data, next_cursor}. Pass next_cursor as cursor for the next page; it is null on the last page.

What should my code retry?

Retry 429 after the seconds in Retry-After, and 500, 502 and 503 after a short wait, with the same Idempotency-Key, so nothing is done twice. Do not retry 400, 401, 402, 403, 404 or 422 unchanged: the same request gets the same answer. A 409 may succeed later, once the reason in its detail has passed.

Costs and what to watch

  • A write sent again without an Idempotency-Key is a new request: a retried call without one can ring the person twice.
FAQ

Questions, answered.

What is the AI Call Studio API rate limit?
A set number of requests a minute per key, across every endpoint, by plan: the table on this page is read from the API itself. The next request answers 429 with a Retry-After header in seconds.

Put AI Call Studio on your phone lines.

Book a 30-minute walkthrough, or call us right now: +91 922 222 1378