HTTP 422 Unprocessable Entity — Validation Error Handling
Warning4xx client error
Overview
HTTP 422 Unprocessable Entity means the server understands the request format but cannot process the contained instructions due to semantic errors.
Key Details
- 422 indicates the request is syntactically correct but semantically invalid
- Originally from WebDAV (RFC 4918) but widely adopted by REST APIs
- Common for form validation errors — fields are present but values are invalid
- Different from 400 Bad Request which means the syntax itself is wrong
- Response body should contain specific validation error details
Common Causes
- Form field values failing server-side validation (invalid email, password too short)
- JSON structure is valid but business rules reject the data
- Required fields present but with invalid or out-of-range values
- Data type correct but value violates constraints (negative age, future birth date)
Steps
- 1Read the response body for specific field-level validation errors
- 2Fix the invalid field values according to the error messages
- 3Check API documentation for field format requirements and constraints
- 4Add client-side validation to catch errors before sending to the server
- 5Log 422 responses to identify common user input mistakes
Tags
http422unprocessable-entityvalidationrest-api
More in 4xx Client Error
http-400-bad-requestHTTP 400 Bad Request — What It Means & How to Fix It
Errorhttp-401-unauthorizedHTTP 401 Unauthorized — What It Means & How to Fix It
Errorhttp-402-payment-requiredHTTP 402 Payment Required — What It Means & How to Fix It
Errorhttp-403-forbiddenHTTP 403 Forbidden — What It Means & How to Fix It
Errorhttp-404-not-foundHTTP 404 Not Found — What It Means & How to Fix It
Errorhttp-405-method-not-allowedHTTP 405 Method Not Allowed — What It Means & How to Fix It
ErrorFrequently Asked Questions
Use 400 when the request is malformed (bad JSON syntax). Use 422 when the request is well-formed but the data fails validation.