Skip to the 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

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

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 RequestThe request can't even be read: broken syntax.
409 ConflictThe values are fine, but they clash with the current state.
415 Unsupported Media TypeThe 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.

See all 12