Skip to content Use Monity from Claude, ChatGPT or Codex: set up monitors and ask what changed, from a chat. Use Monity from Claude, ChatGPT or Codex Connect yours
Tutorial 3 min read

HTTP 422 Unprocessable Content: read the field errors, fix the data

A 422 Unprocessable Content means the server read the request but its values failed validation. How 422 differs from 400 and 415, where FastAPI, Laravel, GitHub and Kubernetes put the field errors, the usual mistakes, and how to design validation errors.

Alex Lead Product Designer
UpdatedNovember 23, 2026 Read time3 min AudienceSite owners and developers

A 422 Unprocessable Content means the server could read your request, because its format was fine, but the data in it broke the server’s rules: a required field is missing, a value has the wrong type, an email address isn’t one. It’s the usual answer to a validation error in APIs and forms, and the response body normally names the field. Sending the same request again won’t help; changing the data will.

400, 415 or 422?

  • 400: the request can’t be read, such as invalid JSON.
  • 415: the body is in a format the endpoint doesn’t accept.
  • 422: the body parses, but its values are wrong. RFC 9110: the server “understands the content type” and the syntax “is correct, but it was unable to process the contained instructions”.

The code began in WebDAV as 422 Unprocessable Entity (RFC 4918), which is why many frameworks still print the old name. It’s the same code.

Read the error your framework sent

Each framework puts the failed fields in a different place. What to look for:

Where What a 422 contains
FastAPI A detail list, one entry per error, each with the field’s location and the problem. Sending "size": "XL" where an integer is expected is enough.
Laravel A JSON response with every validation error, for an XHR or JSON request; a normal form post is redirected back instead (Laravel docs).
GitHub’s REST API “Validation Failed” and an errors array with codes such as missing_field, invalid and already_exists.
Kubernetes 422 for a create or update with invalid data; its API conventions say not to retry, but to fix the request.

An excerpt of FastAPI’s answer to "size": "XL": it names the field and the problem exactly.

{"detail": [{"loc": ["body", "size"],
             "msg": "Input should be a valid integer, unable to parse string as an integer",
             …}]}

The usual mistakes

  • A field renamed on one side, so the back end finds the required field missing.
  • The wrong type: a number sent as a string, one value where a list is expected, "true" instead of true.
  • A value outside the rules: too long, out of range, a date or phone number in the wrong format, a choice not on the list.
  • A duplicate, in APIs that report it as a validation error (others answer 409).
  • Bad encoding inside a field, such as file content that isn’t valid Base64: MDN’s own example.
  • A new API version with a new required field or a stricter rule.

Log the payload as it was sent, after serialization, and compare it field by field with the documentation.

If you build the API

Return a message per field, keep 400 for requests you can’t parse and 422 for values that fail validation, and document both. A client can then show the person which field to fix, instead of a generic “something went wrong”.

A form that suddenly rejects valid input after a deploy is easy to miss. A browser test in Monity fills it in and checks the result after each deploy, and stops at the step that failed.

A failed Monity browser test run: failed at step 4, check the address contains /inventory.html, with the likely cause that the check did not match and a Fix this step button
A browser test that failed at step 4: after the form was sent, the page wasn’t the one the test expects, with the likely cause beside it.

More: 400 Bad Request, 409 Conflict and all HTTP status codes.

FAQ

Questions people ask

What’s the difference between 400 and 422?

A 400 means the request couldn’t be read: broken syntax, invalid JSON. A 422 means it was read fine but the values failed validation. GitHub’s API answers 400 for unparseable JSON and 422 for wrong values.

Is 422 Unprocessable Entity the same as 422 Unprocessable Content?

Yes. WebDAV named it Unprocessable Entity; RFC 9110 renamed it Unprocessable Content when it moved into core HTTP. The meaning didn’t change.

Why does FastAPI return 422?

The request data didn’t match your model: a missing field, a wrong type or a failed constraint. FastAPI answers 422 with a detail list of every error.

Should I retry a request that got a 422?

No, not unchanged. The same data fails again. Fix the fields the error names, then send it.

Why does Laravel return 422 instead of redirecting back?

For a request that expects JSON, Laravel answers validation failures with 422 and the errors as JSON; a normal form post is redirected back with the errors instead.

Written by

Alex

Alex leads product design at Monity. From the plain-English setup to the way an alert is laid out, her work is about making website monitoring something anyone can use, technical or not. She writes here about product design and usability.

More by author
Kamil, Alex and Martyna A person replies within two working days

Have a question?

Pricing, security or scoping: pick one and your message goes to a person on the team.