Cloudflare-generated 5xx error responses now return structured JSON and Markdown when agents request them, matching the format already available for 1xxx errors. Responses follow RFC 9457 (Problem Details for HTTP APIs) and include a Retry-After HTTP header on retryable codes.
Changes
5xx coverage. Ten Cloudflare-generated error codes (500, 502, 504, 520-526) now serve structured responses. These are errors Cloudflare itself generates when it cannot reach or understand the origin server. Origin-generated 5xx responses that Cloudflare passes through are not affected.
Fault attribution. The error_category field tells agents where the fault lies:
origin(502, 504, 520-524) — the origin server is responsible. Transient; retry with the backoff inretry_after.cloudflare(500) — Cloudflare’s fault, not the website or the request. Short retry.ssl(525, 526) — the origin’s TLS configuration is broken. Do not retry.
Retry-After header. Retryable codes (500, 502, 504, 520-524) include a Retry-After HTTP header matching the retry_after body field. Non-retryable codes (525, 526) do not include the header.
Negotiation behavior
| Request header sent | Response format |
|---|---|
Accept: application/json | JSON (application/json content type) |
Accept: application/problem+json | JSON (application/problem+json content type) |
Accept: application/json, text/markdown;q=0.9 | JSON |
Accept: text/markdown | Markdown |
Accept: text/markdown, application/json | Markdown (equal q, first-listed wins) |
Accept: */* | HTML (default) |
Availability
Available now for all zones on all plans.
Get started
Get JSON response for error 522:
curl -s --compressed -H "Accept: application/json" -A "TestAgent/1.0" -H "Accept-Encoding: gzip, deflate" "<YOUR_DOMAIN>/cdn-cgi/error/522" | jq .Check presence of the Retry-After HTTP header associated with the JSON response for error 521:
curl -s --compressed -D - -o /dev/null -H "Accept: application/json" -A "TestAgent/1.0" -H "Accept-Encoding: gzip, deflate" "<YOUR_DOMAIN>/cdn-cgi/error/521" | grep -i retry-afterReferences:
Source: Cloudflare
Latest Posts
- (Updated) Security Detection Report in Teams Admin Center [MC1311977]
![(Updated) Security Detection Report in Teams Admin Center [MC1311977] 2 steel 4856024 1920](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Power Automate – Review Firewall Configuration for Upcoming Platform Infrastructure Updates [MC1409123]
![Power Automate – Review Firewall Configuration for Upcoming Platform Infrastructure Updates [MC1409123] 3 pexels nickcollins 1293006](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Enabling group support for M365 Copilot Release preferences experience [MC1409102]
![Enabling group support for M365 Copilot Release preferences experience [MC1409102] 4 street art 9614300 1920](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Microsoft OneNote: Copilot notebook available in OneNote on Mac [MC1409042]
![Microsoft OneNote: Copilot notebook available in OneNote on Mac [MC1409042] 5 pexels yankrukov 8866797](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)

![(Updated) Security Detection Report in Teams Admin Center [MC1311977] 2 steel 4856024 1920](https://mwpro.co.uk/wp-content/uploads/2025/06/steel-4856024_1920-150x150.webp)
![Power Automate – Review Firewall Configuration for Upcoming Platform Infrastructure Updates [MC1409123] 3 pexels nickcollins 1293006](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-nickcollins-1293006-150x150.webp)
![Enabling group support for M365 Copilot Release preferences experience [MC1409102] 4 street art 9614300 1920](https://mwpro.co.uk/wp-content/uploads/2025/06/street-art-9614300_1920-150x150.webp)
![Microsoft OneNote: Copilot notebook available in OneNote on Mac [MC1409042] 5 pexels yankrukov 8866797](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-yankrukov-8866797-150x150.webp)
![(Updated) Microsoft 365 Copilot app: Branded footer customization [MC1238432] 7 (Updated) Microsoft 365 Copilot app: Branded footer customization [MC1238432]](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-rquiros-2330137-150x150.webp)