Unprocessable Entity
The server understands the request but cannot process it due to semantic errors.
Root Cause
The request body is syntactically valid but semantically incorrect, e.g., a required field is missing, a value is out of range, or a business rule is violated.
How to Fix
Return a 422 with a detailed error body listing each validation error. The client must fix the request before retrying.
Quick Summary
422 means the request is syntactically valid but semantically wrong. Use it for validation errors (missing fields, invalid values, business rule violations). Return a detailed error body listing each issue.
Key Takeaways
- Use 422 for validation errors, not 400
- 400 = malformed request (bad JSON, wrong Content-Type); 422 = valid format but invalid content
- Return a structured error body with field-level details
- The client must fix the request, retrying without changes will fail again
When to use it
- Missing required fields in a form submission
- Email already registered
- Age below minimum requirement
Common Mistakes
- Using 400 for all validation errors, 422 is more specific and informative
- Not returning field-level error details, clients need to know which fields failed
422 Unprocessable Entity, Frequently Asked
What is the difference between 400 and 422?
400 Bad Request: the request is malformed (invalid JSON, wrong Content-Type). 422 Unprocessable Entity: the request is well-formed but fails validation or business rules.
Still having issues?
Check your network logs or use our developer tools to inspect headers, decode tokens, or validate your requests.