HTTP 422 Unprocessable Entity — What It Means & How to Fix It
Error4xx client error
Overview
The HTTP 422 Unprocessable Entity status code indicates the server understands the request content type and syntax but cannot process the contained instructions.
Key Details
- Originally defined in WebDAV (RFC 4918) but widely adopted by REST APIs.
- The request is syntactically correct but semantically invalid.
- Common for validation errors where the data format is correct but the values are invalid.
- The response should include details about which fields failed validation.
- Preferred over 400 for semantic validation errors by many API design guidelines.
Common Causes
- Form data passes format validation but fails business logic validation.
- An email field contains a properly formatted but non-existent email address.
- A date field contains a valid date format but is in the past when a future date is required.
- Related fields are individually valid but inconsistent with each other.
Steps
- 1Read the response body for specific validation error details.
- 2Fix the data values based on the validation feedback.
- 3Check the API documentation for field-level validation rules.
- 4Distinguish between format errors (400) and semantic errors (422) in your error handling.
Tags
httpclient-errorvalidationunprocessablewebdav
Related Items
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
It means the request is well-formed but contains invalid data that the server cannot process. The values fail semantic validation even though the format is correct.