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
| Where | Applies to | Limit |
|---|---|---|
| Gateway | Every request, per client address | 600 requests per minute |
| Services | Every request, per signed-in person or system | 600 requests per minute |
| Services | Sign-in and token endpoints (sign-in, /platform/tokens, /oauth/token, one-time codes) | 30 per minute per client; 600 per minute in total |
| Services | Public forms (join application, account recovery, enrolment, USSD) | 30 per minute per client; 600 per minute in total |
| Services | Share links, exports and shares | 120 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-Afterseconds. Without it, back off exponentially with jitter (the SDKs start at 250 ms and cap at 8 s, 3 retries). - Retry only
429and503. Other4xxanswers will not succeed on retry. - Reuse the same
Idempotency-Keywhen you retry a write: if the first attempt did reach the network, you get its original answer (markedIdempotent-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.