What should a retryable HTTP error include?
“Try again later” is not enough. A client needs to know whether the condition is temporary, when to retry, and whether the first attempt had an effect. Use the status and Retry-After with API-specific Problem Details extensions.
“Try again later” is not enough. A client needs to know whether the condition is temporary, when to retry, and whether the first attempt had an effect. Use the status and Retry-After with API-specific Problem Details extensions.
HTTP/1.1 503 Service Unavailable
Retry-After: 5
Content-Type: application/problem+json
{
"type": "https://api.example.com/problems/temporarily-unavailable",
"title": "Service temporarily unavailable",
"status": 503,
"detail": "The request was not accepted. Retry after the indicated delay.",
"instance": "urn:request:01JEXAMPLE",
"retryable": true,
"operation_result": "not_applied",
"request_id": "01JEXAMPLE"
}Recommended fields and retry safety
503 signals temporary unavailability; 429 signals rate limiting. Retry-After gives seconds or an HTTP date to wait. Branch on a stable type or documented code, not free-form detail. The example’s retryable and operation_result fields are API-defined extensions, not RFC standard members.
Sources
[RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html)
[RFC 6585](https://www.rfc-editor.org/rfc/rfc6585.html)
[RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html)