Every call counts toward one or more limits, each over a minute. Over a
limit, a call answers 429 rate_limited until its minute passes. The
headers on every answer say how close you are, so a client can slow down
before it is refused.
The limits
| Limit | What it counts | Per minute |
|---|---|---|
| Every call | Each API key. An OAuth app has its own for each account it is connected to. | 120 requests per minute |
| Every call | Your account, all its keys together, so more keys do not buy more calls | 600 per minute |
| Carrier-reaching writes | Your account | 30 per minute |
| Webhook sends | Your account | 10 per minute |
| Verifying an end-user portal domain | Your account | 5 per minute |
POST /end-users/lookup |
Each API key | 20 per minute |
POST /oauth/token |
Each client_id from one address |
30 per minute |
POST /oauth/token |
One address, whatever the client_id |
120 per minute |
A call counts toward every limit that covers it. A carrier write 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: 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-Keydoes not count. - Webhook sends are the calls that send traffic to your endpoint: Send
Test, redeliver, Replay All Dead, and sending an event again with
POST /events/{eventId}/deliveries. - Each call with a limit of its own says so in its description in the reference, such as “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, so systems
behind one NAT or cloud address each keep their own budget. A token lasts
one hour. Request one, reuse it until it runs out, and you never come near
the limit. A client that requests a new token for every call will hit it.
Daily allowances
Two calls are counted by the day as well, because each one reaches outside our platform:
- Qualification batches,
POST /data/sq/batches: ten batches an hour, and a number of rows a day shared with batches uploaded in the portal. Over it, the batch answers409sq_batch_allowance_exceeded, withremainingRows. - Number lookups,
POST /numbers/lookup: a number of numbers a day for your account. Over it, the call answers429rate_limited, withallowancesaying how many your account may look up, how many it has, and how many the call asked for. It resets at midnight Brisbane time, andRetry-Aftergives the seconds until then.
Where you stand
Every answer says where you stand against the limit that will stop you first, whichever one it 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 it. |
X-RateLimit-Reset |
When it 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 same headers describe the account’s 30 once fewer of those are left than of the others.
Backing off
On a 429, wait for the Retry-After seconds, then send the same request
again. A write sent with an Idempotency-Key can be sent again under the
same key, and nothing runs twice. To stay under the limit rather than meet
it, slow down as X-RateLimit-Remaining nears 0, until
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 other 4xx answers unchanged. They
say what is wrong with the request. See API errors.
Caps on what you hold
A cap on what you hold is not a rate, so it answers 409 instead, and
waiting does not change it. For example, an account may hold 5 open
install reservations. Attach one to an order or cancel it before reserving
another. 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.