Each call counts toward one or more limits, and each limit runs over a
minute. Once you are over a limit, a call answers 429 rate_limited
until that minute passes. Every answer carries headers that show how close
you are, so your client can slow down before we refuse it.
The limits
| Limit | What it counts | Per minute |
|---|---|---|
| Every call | Each API key. An OAuth app has its own limit for each account it is connected to. | 120 |
| Every call | Your account, all its keys together. More keys do not buy more calls. | 600 |
| Carrier-reaching writes | Your account | 30 |
| Webhook sends | Your account | 10 |
| Verifying an end-user portal domain | Your account | 5 |
POST /end-users/lookup |
Each API key | 20 |
POST /oauth/token |
Each client_id from one address |
30 |
POST /oauth/token |
One address, whatever the client_id |
120 |
A call counts toward every limit that covers it. A carrier write, for example, counts toward its key’s 120, its account’s 600 and the account’s 30.
Carrier-reaching writes are the calls that can place or change a real
carrier order. They are placing, answering, changing or cancelling an
order, reserving, changing or cancelling a technician appointment, the
carrier service tests and health reports, and Opticomm’s static IP call. A
replay of a stored answer under the same Idempotency-Key does not count.
Webhook sends are the calls that send traffic to your endpoint. They are
Send Test, redeliver, Replay All Dead, and sending an event again with
POST /events/{eventId}/deliveries. The keys for one end user share a
separate 10 for that end user. They never use up yours or another end
user’s.
A call with a limit of its own says so in its description in the reference, for example “Limit: 30 per minute for the account (carrier write)”.
If you need more than 600 a minute across your account, ask Support. We can raise your account’s figure.
The token endpoint
The token endpoint’s limit is per client_id from one address. Systems
behind one NAT or cloud address each keep their own budget. A token lasts
one hour. Request one and reuse it until it runs out, and you will never
come near the limit. A client that requests a new token for every call will
hit it.
Daily allowances
Two calls also have an allowance, because each one reaches outside our platform.
Qualification batches (POST /data/sq/batches) are limited to ten batches
an hour. They also share a daily number of rows with batches uploaded in
the portal. Over the allowance, the batch answers 409
sq_batch_allowance_exceeded, with remainingRows.
Number lookups (POST /numbers/lookup) have a daily number of numbers for
your account. Over it, the call answers 429 rate_limited. Its
allowance says how many numbers your account may look up, how many it
has looked up, and how many the call asked for. The allowance resets at
midnight Brisbane time, and Retry-After gives the seconds until then.
Where you stand
Every answer shows where you stand against the limit that will stop you first, whichever one that is:
| Header | What it says |
|---|---|
X-RateLimit-Limit |
The calls that limit allows in its minute. |
X-RateLimit-Remaining |
The calls you have left in that minute. |
X-RateLimit-Reset |
When the limit starts again, as a Unix time in seconds. |
Retry-After |
On a 429 only: the seconds to wait before retrying. |
For example, a read with 117 of its key’s 120 left:
HTTP/1.1 200 OK
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 117
X-RateLimit-Reset: 1795741260
On a carrier write, the headers switch to the account’s 30 once you have fewer of those left than of the others.
Backing off
On a 429, wait the Retry-After seconds, then send the same request
again. If the write carries an Idempotency-Key, send it again under the
same key, and nothing runs twice.
To stay under the limit instead of hitting it, slow down as
X-RateLimit-Remaining nears 0, and wait for X-RateLimit-Reset.
In Python:
import time
import requests
def call(method, url, **kwargs):
while True:
response = requests.request(method, url, **kwargs)
if response.status_code != 429:
return response
time.sleep(int(response.headers.get("Retry-After", "60")))
Retry a 503 the same way. Don’t retry any other 4xx unchanged, because
it tells you something is wrong with the request. See
API errors.
Caps on what you hold
A cap on what you hold is not a rate, so going over it answers 409, and
waiting does not help. For example, an account may hold 5 open install
reservations. To reserve another, attach one to an order or cancel it
first. reason says which cap you reached.
Testing
In production every call runs against your real account, and a carrier write places a real order. Build and test against the sandbox instead. It is a separate copy of the platform where nothing reaches a carrier.