Client Error · 4xx

422 Unprocessable Content

The request is well-formed but contains semantically invalid data.

What 422 Unprocessable Content means

422 Unprocessable Content (formerly Unprocessable Entity) is the validation-error code. The request was syntactically valid (parseable JSON, all required fields present), but failed business-rule validation: email already exists, age must be positive, cross-field constraint violated. Many APIs use 400 for everything client-side wrong, but 422 is more specific and lets clients distinguish "your JSON is broken" (400) from "your data is logically invalid" (422).

When servers should return it: Return 422 when the request parsed successfully but failed validation. Include detailed per-field errors in the response body.

Common causes

How to fix 422 Unprocessable Content

Example response

curl -i -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","age":-5}'

HTTP/2 422
content-type: application/json
{
  "error":"validation failed",
  "details":[
    {"field":"email","reason":"already taken"},
    {"field":"age","reason":"must be positive"}
  ]
}

Related status codes

Frequently Asked Questions

400 vs 422?
400 = malformed (broken JSON, missing required field, wrong type). 422 = well-formed but invalid (email already exists, age out of range, business rule violation).
Are all clients aware of 422?
Most modern HTTP libraries are. Some older or simpler clients lump all 4xx together and may not distinguish 422 from 400.
Why was it renamed from Unprocessable Entity?
RFC 9110 renamed it for clarity. Both names refer to status code 422.
Defined in: RFC 9110 · Class: 4xx Client Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.