Skip to main content

Rate limits

Each API key can make 120 requests a minute. That's plenty for normal use, and it stops one runaway script from slowing things down for everyone.

Go over it and you get 429 Too Many Requests with the code rate_limited and a Retry-After header saying how many seconds to wait:

HTTP/1.1 429 Too Many Requests
Retry-After: 23
Content-Type: application/problem+json

Staying under it​

  • Use webhooks instead of polling. One webhook replaces dozens of "is it done yet?" requests. See Webhooks.
  • Ask for bigger pages. pageSize=100 fetches 100 SIMs in one request instead of 50.
  • Filter on the server. GET /sims?status=suspended beats fetching everything and filtering yourself.
  • Use the estate-wide endpoints. GET /usage/summary and the reports give totals in one request.
  • Give each system its own key. Each key has its own limit, and you can tell them apart.
  • Pace bulk changes. Acting on hundreds of SIMs is fine; send them at a steady rate (one or two a second) rather than all at once.

Handling a 429​

async function axisFetch(url, options = {}, attempts = 3) {
for (let i = 1; ; i++) {
const res = await fetch(url, options);
if (res.status !== 429 || i >= attempts) return res;
const wait = Number(res.headers.get('Retry-After') ?? 5);
await new Promise((r) => setTimeout(r, wait * 1000));
}
}

Need more for a particular job? Email support@zentarinetworks.com and tell us what you're building.