Guide
Errors
Recover from API failures using stable codes, request IDs, and explicit retry rules.
Prerequisites
Log the HTTP status, stable error code, and request_id. Redact Authorization, cookies, webhook secrets, provider challenges, and customer message content before telemetry leaves your process.
Read an error
json
{
"error": {
"code": "rate_limit_exceeded",
"message": "API key request rate limit exceeded",
"request_id": "00000000-0000-4000-8000-000000000001"
}
}Treat messages as human context and codes as program logic. Use the request ID when contacting support.
Expected result
Validation and authorization failures stop immediately. Accepted asynchronous writes return a command identity whose state can be inspected independently.
Errors
- Retry
429after the reset time and transient5xxresponses with bounded jitter. - Do not retry
401,403, or422without changing credentials, entitlement, or input. - Resolve
409 idempotency_conflictby using the original input or a new key. - A
404may intentionally hide a resource outside the current project.
Next step
Add code-based handling, idempotency keys for writes, and alerts for repeated failures with the same operation.