Skip to content

Rate limits

The limits the gateway and the services apply, what a 429 answer looks like, and how to retry.

Limits protect the network for everyone, including facilities on slow connections. They are applied at two levels.

Limits

WhereApplies toLimit
GatewayEvery request, per client address600 requests per minute
ServicesEvery request, per signed-in person or system600 requests per minute
ServicesSign-in and token endpoints (sign-in, /platform/tokens, /oauth/token, one-time codes)30 per minute per client; 600 per minute in total
ServicesPublic forms (join application, account recovery, enrolment, USSD)30 per minute per client; 600 per minute in total
ServicesShare links, exports and shares120 per minute per client; 3,000 per minute in total

Operators can scale these values for a deployment, so treat them as an upper bound, not a promise. Limits are currently counted per service instance.

When you are limited

The answer is 429 with an application/problem+json body whose error is rate_limited, and a Retry-After header in seconds.

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

{ "type": "https://errors.ohn.opes.org/rate_limited", "title": "Too many requests", "status": 429, "error": "rate_limited", "trace_id": "…" }

Retrying well

  • Wait at least Retry-After seconds. Without it, back off exponentially with jitter (the SDKs start at 250 ms and cap at 8 s, 3 retries).
  • Retry only 429 and 503. Other 4xx answers will not succeed on retry.
  • Reuse the same Idempotency-Key when you retry a write: if the first attempt did reach the network, you get its original answer (marked Idempotent-Replay: true) instead of a duplicate order, prescription or claim.
  • Prefer events to polling. If you must poll, do it no more often than every 30 seconds.