- Home
- Tools
- Developer Tools
- HTTP Status Codes
- 422 Unprocessable Content
422 Unprocessable Content
The request is well-formed and understood, but what it asks can't be done with these values. Many APIs use it for validation errors.
- Class
- 4xx Client error. The request is the problem: a wrong address, missing credentials, data the server can't accept.
- Defined in
- RFC 9110
- Also known as
- Unprocessable Entity
What causes it
When the body can be read without trouble and still breaks a rule: a required field is empty, an e-mail address has no @, the end date lies before the start date. The code came from WebDAV and was taken up by web frameworks. Rails and Laravel answer 422 when validation fails, and FastAPI does for input that doesn't fit the declared types.
What to do about it
Read the body: it normally lists the fields that were refused and why. Correct them and send the request again. Repeating it unchanged gives the same answer.
If you build an API, name each field and its problem, so that a form can show the message next to the right box. The code was called Unprocessable Entity until 2022, and much software still prints that name.
Not to be confused with
| 400 Bad Request | The request can't even be read: broken syntax. |
|---|---|
| 409 Conflict | The values are fine, but they clash with the current state. |
| 415 Unsupported Media Type | The format of the body is not accepted. |
All codes are on the list of HTTP status codes, which can be searched by number and by word.
Other 4xx codes
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 423 Locked
- 424 Failed Dependency
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons