422 Unprocessable Content
4xx client errorformerly “Unprocessable Entity”
The request is well-formed, but its content fails validation.
422 says 'I understood you, and it's invalid'. The JSON parses and the Content-Type is right, but the values break the rules — an email that isn't an email, an end date before the start date.
Rails and Laravel use it for validation errors, FastAPI returns it for schema mismatches, and GitHub's API uses it widely. RFC 9110 renamed it from 'Unprocessable Entity' to 'Unprocessable Content'.
| Class | 4xx Client Error |
|---|---|
| Retry? | No — change the request first |
| Cacheable by default | No — only with explicit Cache-Control |
| Response body | Allowed |
| Defined in | RFC 9110 §15.5.21 — 422 Unprocessable Content |
HTTP/1.1 422 Unprocessable Content
Content-Type: application/json
Content-Length: 33
{"error":"Unprocessable Content"}Common causes
- Form or API validation failures.
- FastAPI / Pydantic schema mismatches: a wrong type or a missing field.
- Business-rule violations that don't fit 409.
How to fix it
- Read the error body — validation frameworks list each failing field.
- With FastAPI, compare your JSON with the endpoint's schema at
/docs. - On the server, return field-level errors (for example problem+json with an
errorsarray).
Useful here: JSON Validator
Send a 422 from your server
res.status(422).json({ error: "Unprocessable Content" });return Response.json({ error: "Unprocessable Content" }, { status: 422 });return {"error": "Unprocessable Content"}, 422http.Error(w, "Unprocessable Content", http.StatusUnprocessableEntity)
return 422;
Check what a URL returns
Print just the status line from the command line, or check a whole list of URLs at once, with their response headers, in the HTTP Status Checker.
curl -sI https://example.com/your-path | head -n 1
Frequently asked questions
422 vs 400?
400: the request is malformed — bad JSON, wrong structure. 422: well-formed but semantically invalid. Either is acceptable for validation errors if you're consistent.
Why does FastAPI return 422?
The body or query didn't match the Pydantic model. The response's detail array lists each error's location (loc), message and type.