What 422 means
Formerly "Unprocessable Entity" (from WebDAV). The server parsed the request fine but the content fails validation: an end date before a start date, a negative quantity, a reference to an id that does not exist.
Rails, Django REST Framework and many API styles return 422 for validation errors with a body listing each field problem.
Common causes
- Business-rule validation failures.
- Well-formed JSON with wrong types or missing required fields, depending on API convention.
How to fix it
- Return a structured error body with field paths and messages.
- Clients should show the messages to the user rather than retrying.
What it looks like
A typical response:
HTTP/1.1 422 Unprocessable Content
Content-Type: application/json
{"errors":[{"field":"end_date","message":"must be after start_date"}]}
The same event in an nginx access log (the status is the number after the request line):
203.0.113.7 - - [10/Sep/2026:10:12:01 +0000] "POST /api/orders HTTP/1.1" 422 153 "-" "Mozilla/5.0"
Check it with curl
-i prints the status line and headers, and -w '%{http_code}' prints only the number, which is handy in scripts and health checks. Replace the URL with yours:
curl -i -X POST -H 'Content-Type: application/json' -d '{"a":1}' https://example.com/api/orders
Compare what curl sees with what the browser sees. A different status from the same URL usually means a cache, a CDN edge or a cookie is in the way.
Investigating a run of 422s? Paste the log excerpt into Log Share to get line numbers, highlighting and an expiring link for whoever is on call with you.
Related status codes
400Bad Request: The server could not understand the request because it is malformed.409Conflict: The request conflicts with the current state of the resource.415Unsupported Media Type: The request body is in a format the server does not accept.
FAQ
Is 422 only for WebDAV?
Not any more. RFC 9110 moved it into core HTTP semantics, and it is widely used for validation errors in JSON APIs.