422 Unprocessable Entity
The request parsed fine — syntax is valid — but the content fails semantic validation: a missing required field, an email that isn't one, a date range that ends before it starts. The conventional split: 400 for 'could not parse', 422 for 'parsed but invalid'.
What usually causes it
- Field validation failures (required, format, range)
- Business-rule rejections that map to input problems
- Type mismatches after parsing (string where number expected)
How to debug and fix it
- Return (and read) structured error details: which field, which rule, what was received.
- Client-side, surface field errors next to inputs — a 422 is user-fixable by design.
- Keep 422 out of authentication/permission flows; those are 401/403 regardless of payload validity.
Worth knowing: 422 came from WebDAV and was adopted by REST convention (Rails popularized it). As of RFC 9110 it is part of core HTTP semantics.
Easily confused with
Debugging an API? Build and inspect requests, check response headers, or read the full status-code debugging guide.