429 Too Many Requests and doesn’t process the request.
How requests are counted
- Per client address, not per key. The count is tied to the network address your requests come from. Two keys used from the same server share one count, and so do several systems that leave your network through the same address.
- One count for all endpoints. Every request from your address adds 1 to the same count, whatever the endpoint.
- A limit per endpoint. Each request is checked against the limit of the endpoint it calls. So after 300 requests in the window, organization requests by ID start to fail while Get call requests still succeed.
- The window restarts with each request. The one-minute window starts again every time a request arrives. The count only goes back to zero after a full minute with no requests from your address. A steady flow that never pauses for a minute keeps adding to the same count, even at a low rate.
- Rejected requests count too. A request that gets
429still adds to the count and restarts the window.
Limits by endpoint
The call-completed callback goes from AlloMia to your server, so it doesn’t count.
Rate-limit headers
Responses that pass the limit check carry these headers, and so does a429:
The 429 response
retryAfter in the body is the same number of seconds as Retry-After.
Handling limits
- On a
429, pause everything that calls the API from that address for at leastRetry-Afterseconds. Requests sent during the pause are counted and restart the window, so they keep you blocked. - Then resume gradually. If you get another
429, wait longer each time, for example 60, 120 and then 240 seconds, and add a little random delay so several workers don’t restart together. - It is safe to resend. AlloMia didn’t process a request that got
429, so you can send it again after the pause, includingPOSTrequests. - Watch
X-RateLimit-Remaining. In long jobs, such as paging through every call, pause for just over a minute before it runs out. The pause lets the count go back to zero. - Ask for less. Use
limit=50on List calls andlimit=100on List organizations to fetch more per request. Use the callback instead of polling Get outbound call status.