HTTP 422 Unprocessable Content
Status code 422 · Class 4xx
Unprocessable Content
Also searched as: error 422, HTTP 422, 422 unprocessable entity, 422 unprocessable content
What it means
The server understood the request format but the data inside is invalid, so it could not process it. APIs and frameworks such as Rails, Laravel and FastAPI return 422 for validation errors like a missing required field or a wrong data type.
Applies to: REST APIs, Rails, Laravel, FastAPI
How to fix HTTP 422 Unprocessable Content
- Read the response body; it usually lists the fields that failed validation
- Check required fields, formats (emails, dates) and value ranges against the API documentation
- Make sure the Content-Type header matches the body (for example 'application/json' with valid JSON)
- Check for type mismatches such as sending a string where a number is expected
- For Rails and Laravel forms, an expired CSRF token can also surface as a 422 or 419 response; reload the form
- If you own the API: return structured, field-level error messages so clients can fix the input
Why it happens
Defined in RFC 9110 (formerly 'Unprocessable Entity' in WebDAV), 422 signals well-formed but semantically invalid content. It is the standard validation-failure response in many frameworks.
FAQ
What is the difference between 400 and 422?
400 means the request itself is malformed. 422 means the syntax is fine but the content does not pass validation.
Related errors
Source: IANA HTTP Status Code Registry · fixes written and reviewed by the editors (see our editorial policy)
Last updated: