Skip to content
4xx · client errorSent by App

422Unprocessable Content

The request is well formed and understood, but its contents do not make sense to act on.

How you get a 422

The body is valid JSON and the app parses it. Then it checks the values: the end date is before the start date. The instructions cannot be carried out, so the app sends 422.

Who sends itApp

  1. Browser
  2. CDN
  3. Proxy
  4. App
  5. DB

Typically the application, because judging the contents needs knowledge of the business rules. Proxies and CDNs do not look inside the body.

In short

What a 422 Unprocessable Content means

A 422 Unprocessable Content means the server could read the request perfectly well and still cannot act on it. The JSON is valid and the content type is right, but the values break a rule: an end date before the start date, a quantity of minus three, a reference to a product that does not exist. The application sends it, since only the application knows those rules. A good 422 response lists each field and what is wrong with it, so the client can show the errors next to the form. The code started in WebDAV and became part of core HTTP in RFC 9110. Usage is not uniform: several popular frameworks use 422 for all validation errors, while many APIs report the same thing as 400.

Common causes of a 422

  1. 1A field fails validation: wrong format, out of range, too long, required but empty.

    How to check: Read the response body. It usually lists each field and the rule it broke.

    {"errors": {"end_date": ["must be after start_date"]}}
  2. 2The request refers to something that does not exist, such as an unknown product ID.

    How to check: Look the referenced ID up in the same environment.

  3. 3A business rule forbids it: not enough stock, a discount that has expired.

    How to check: The error message names the rule. The same request may be valid later or with other values.

  4. 4The client and server disagree about the shape of the data after an API change.

    How to check: Compare the request with the current API documentation, field by field.

Retry or not?

Retry only after fixing the request

The values are the problem. Correct the fields the response lists, then send the request again. Resending it unchanged gets the same answer.

Headers that matter

Content-Type
On the response, often application/problem+json, a standard format for describing API errors.

In the real world

RFC vs real deployments

RFC 9110 defines 422 for content that is syntactically correct and of an understood type, but whose instructions cannot be processed. Where the line with 400 falls is left to the API. Rails and FastAPI use 422 for validation failures; many other APIs use 400 for every kind of bad input. Older documents call it Unprocessable Entity, its original WebDAV name.

Seen in a real outage

Validation is what stands between odd input and a crash. In June 2025 a Google Cloud policy change with blank fields was accepted, and the service that read it crashed in every region within the same minute.

Your turn

Which code is it?

A booking API receives valid JSON with a check-out date earlier than the check-in date. Following the standard closely, which response fits best?

Often confused with

422 questions

What is the difference between 400 and 422?
A 400 means the server could not understand the request at all. A 422 means it understood the request, but the values in it are not acceptable.
Who sends a 422?
Typically the application, because checking the contents requires knowing the business rules. Proxies and CDNs do not inspect bodies this way.
How do I fix a 422?
Read the response body. It normally lists each invalid field and why. Correct those values and send the request again.

Sources: RFC 9110: 422 Unprocessable Content (section 15.5.21) ↗ · RFC 9457: Problem Details for HTTP APIs ↗ · Report a problem

Diagrams are our own simulations. All wording is original and paraphrases the linked sources.

Practise this in the DNS / HTTP track

Two-minute animated lessons, then boss fights from real outages. Free, no account needed.

Start the track