422 Unprocessable Entity
The server could read your request but the data in it doesn't pass its checks, such as a missing required field or a value in the wrong format.
Quick checks
- Read the response body: APIs usually list which field failed and why.
- Check required fields, formats (dates, emails) and value ranges.
If you’re visiting the site
Fix the form
- Look for highlighted fields and messages; correct them and submit again.
- If nothing is highlighted, the site has a bug; report it.
If you run the site
Debug the request
- Log the validation errors and return them in the body, field by field.
- Reproduce with curl:
curl -i -X POST -H 'Content-Type: application/json' -d '{…}' https://api.example.com/items.
Common causes
- Sending form data where JSON is expected (or the reverse) can parse into empty fields.
- Wrong types: a number as a string, a date in the wrong format.
- Rails apps also return 422 when the CSRF token is missing or invalid.
Still not working?
If the API's documentation and the error body disagree, contact the API provider with the exact request and response.
See what’s happening
LightAtom's connections view confirms which API host your app actually calls, a quick check when requests go to the wrong environment.
Frequently asked questions
What is the difference between 400 and 422?
400 means the request is malformed: the server can't parse it. 422 means it parsed fine but the data is invalid. Many APIs use one or the other for validation errors.
Is 422 Unprocessable Entity a client error?
Yes, it's in the 4xx range: the client should change the request. Retrying the same data gives the same result.
What is the new name for 422?
RFC 9110 (2022) renamed it 422 Unprocessable Content. The meaning didn't change.