@http · HTTP status codes, explained HTTP/1.1 422 Unprocessable Content ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4xx · Client error Well-formed, but the content fails validation. WHAT IT MEANS ──────────────────────────────────────────────────────────── The server understands the content type and the syntax is valid, but it can't process what the request says, typically because it fails validation. Compared with 400: the JSON parses fine, but the values don't make sense. WHY YOU'RE SEEING IT ───────────────────────────────────────────────────── → A required field is empty, or an email or date is in the wrong format. → Business rules, such as an end date before the start date. → Frameworks like Rails, Laravel and FastAPI use 422 for validation errors by default. HOW TO FIX IT ──────────────────────────────────────────────────────────── → Return field-level errors that a client can show next to each input. → On the client, validate before sending, but keep the server checks. EXAMPLE RESPONSE ───────────────────────────────────────────────────────── HTTP/1.1 422 Unprocessable Content Content-Type: application/json  {"errors": {"email": ["is not a valid address"]}} related 400 Bad Request   409 Conflict   415 Unsupported Media Type spec RFC 9110 §15.5.21 https://www.rfc-editor.org/rfc/rfc9110#section-15.5.21 web https://athttp.com/422 ← curl athttp.com/421 curl athttp.com/423 →