HTTP 422 Unprocessable Entity

Validation failures and semantic request errors

What the 422 Status Code Means

The HTTP 422 Unprocessable Entity status code indicates that the server understands the request syntax and content type, but cannot process the request because the instructions contained within it are semantically invalid.

Unlike a 400 Bad Request, which usually indicates malformed syntax, a 422 response occurs when the request is structurally correct but fails application-level validation rules.

Common Causes of HTTP 422 Errors

Example of a 422 Response

HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json

Many APIs return structured validation responses describing which fields failed validation and why the request cannot be processed.

Common API Scenario

A typical example of a 422 error occurs when submitting invalid form data to an API.

POST /users

{
  "email": "invalid-email",
  "password": "123"
}

Although the JSON structure is valid, the email format or password length may violate validation rules, causing the server to return a 422 Unprocessable Entity response.

422 vs 400 Bad Request

The difference between 400 and 422 is important in API design.

How Developers Diagnose 422 Errors

Related HTTP Status Codes

Summary

The HTTP 422 Unprocessable Entity status code indicates that a request is syntactically valid but fails semantic validation rules defined by the application.

It is widely used in modern web APIs to communicate detailed validation errors and guide clients toward submitting correct data.