Core concepts

Rate limits

Each API key can make 120 requests a minute by default. Above that, Flux answers 429 and tells you how long to wait.

Limits#

  • 120 requests a minute per API key by default. Flux can set a different limit for a key.
  • The limit applies to each key separately, so one system's batch sync doesn't slow another system down.

When you're over the limit#

Response headers
HTTP/1.1 429 Too Many Requests
Retry-After: 18
Content-Type: application/json
429 body
{
  "code": "rate_limited",
  "message": "Too many requests for this API key. Retry after the indicated seconds.",
  "details": null
}

Wait the Retry-After seconds, then retry. See the retry example.

Staying under the limit#

  • Use limit=100 when you read lists, and filter (customerId, status, externalRef) instead of reading everything.
  • React to webhooks instead of polling. If you must poll an invoice, do it every minute or so, not every second.
  • Spread large syncs out, or run them through a queue with a fixed rate.