HTTP 422 Unprocessable Entity — What It Means and How to Fix It

The HTTP 422 (Unprocessable Entity) status code indicates that the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions. This typically occurs when the server cannot process the request due to semantic errors in the request body, such as invalid data values or missing required fields, even though the JSON or XML format itself is valid.

Last updated: 2026-06-11

RECOMMENDED

Essential Reading: Designing Data-Intensive Applications

The system design bible for software engineers. Learn to build reliable, scalable, and maintainable systems.

View on Amazon →
Status Code 422
Name Unprocessable Entity

Common Causes

  • Missing required fields in the request body (e.g., a 'name' field is mandatory but not provided).
  • Invalid data types for fields (e.g., sending a string when an integer is expected).
  • Data validation rules failed (e.g., a password not meeting complexity requirements, an email address not being in a valid format).
  • Semantic errors where the data is syntactically correct but logically impossible or disallowed by business rules (e.g., trying to set an 'end_date' before a 'start_date').

Code Examples to Handle HTTP 422

curl -I https://httpbin.org/status/422

How to Fix It

  1. Examine the server's response body for specific error messages. Servers often provide details about which fields are invalid or what validation failed.
  2. Review the API documentation for the endpoint you are calling to understand the expected request body structure, data types, and validation rules.
  3. Validate your request payload against the expected schema (e.g., using JSON Schema) before sending it to the server.
  4. Use a debugging proxy (like Fiddler, Charles Proxy, or browser developer tools) to inspect the exact request body being sent and compare it with the expected format.
💡 Example: A user tries to register on a website. They submit a registration form via an API call, but they leave the 'email' field blank. The server receives the request, parses the JSON successfully, but its validation logic determines that the 'email' field is mandatory and thus returns a 422 status code with a message like 'Email address is required'.
🛠️ Developer Tip: Always provide clear, machine-readable error messages in the 422 response body, ideally with specific field-level errors. This significantly aids client-side developers in quickly identifying and correcting issues.

Related Status Codes

Frequently Asked Questions

What causes HTTP 422?

HTTP 422 is caused by semantic errors in the request body. This means the data itself is invalid according to the server's business rules or validation logic, even if the request's format (like JSON or XML) is syntactically correct. Common causes include missing required fields, invalid data types, or data failing specific validation rules.

How do I fix HTTP 422?

To fix HTTP 422, you need to correct the data in your request body. Start by checking the server's response for detailed error messages. Consult the API documentation to understand the expected payload structure and validation rules. Ensure all required fields are present, data types are correct, and values adhere to any specified constraints.