What does HTTP 422 mean?
The request is well-formed but contains semantic errors. Popular in REST APIs (Rails, Laravel, FastAPI) for validation errors: the JSON is valid, but a required field is missing, an email is invalid or a value is out of range. The body should list the field errors.
4xx Client error: The request has a problem the client can fix: wrong URL, missing credentials, bad data or too many requests.
Common causes of a 422 error
- Validation failed for one or more fields.
How to fix 422 Unprocessable Content
- Read the error body and fix the listed fields.
422 and SEO
Not relevant for web pages.
Example response
HTTP/1.1 422 Unprocessable Content
How to return a 422 response
Node.js (Express)
res.status(422).json({ error: 'Unprocessable Content' });PHP
http_response_code(422);Python (Flask)
return {'error': 'Unprocessable Content'}, 422Go (net/http)
w.WriteHeader(422)nginx
return 422;
Related status codes
- 400 Bad Request — The server cannot process the request because it is malformed.
- 409 Conflict — The request conflicts with the current state of the resource.
- 415 Unsupported Media Type — The server does not support the format of the request body.
Check which status code a URL returns with the HTTP header checker.