Throttling contract
When a request exceeds policy limits, the API returns:
- HTTP
429 Too Many Requests Retry-Afterresponse header- structured body with
errorCodeandtraceId
Example response
HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json
{
"type": "https://api.uselamba.com/problems/rate-limit",
"title": "Too Many Requests",
"status": 429,
"detail": "Rate limit exceeded for this tenant and route.",
"errorCode": "RATE_LIMIT_EXCEEDED",
"traceId": "00-8a5f0f..."
}
Client handling
- Parse
Retry-Afteras seconds. - Back off with jitter (
retry = retryAfter + random(0..2s)). - Retry only idempotent operations automatically.
- Surface user-facing messaging for non-idempotent failures.
Server-side recommendations
- Keep per-tenant and per-route controls observable.
- Emit logs with
errorCode, route, tenant, andtraceId. - Avoid retry storms by bounding total retry attempts.