4xx Client Error
HTTP 422 Unprocessable Content
The server understands the content type and syntax of the request, but it was unable to process the contained instructions. Often used for semantic validation errors where the request is well-formed but logically invalid.
Common Causes
- Validation errors on form fields (e.g., invalid email format)
- Business logic violations (e.g., end date before start date)
- Required fields present but containing invalid values
- Semantic errors in a syntactically correct request
How to Fix
- 1Check the response body for specific validation error details
- 2Fix the data according to validation rules and resubmit
- 3Validate input on the client side before sending
- 4Review API documentation for field constraints
Example
HTTP 422 Unprocessable Content
POST /api/events HTTP/1.1
{ "start": "2024-12-31", "end": "2024-01-01" }
→ 422 Unprocessable Content
→ "End date must be after start date"Related Client Error Codes
400
Bad Request
401Unauthorized
402Payment Required
403Forbidden
404Not Found
405Method Not Allowed
406Not Acceptable
407Proxy Authentication Required
408Request Timeout
409Conflict
410Gone
411Length Required
412Precondition Failed
413Content Too Large
414URI Too Long
415Unsupported Media Type
416Range Not Satisfiable
417Expectation Failed
418I'm a Teapot
421Misdirected Request
423Locked
424Failed Dependency
425Too Early
426Upgrade Required
428Precondition Required
429Too Many Requests
431Request Header Fields Too Large
451Unavailable For Legal Reasons