HTTPError.net

The fastest way to diagnose, understand, and fix any HTTP status code

422 Unprocessable Content

Fault: Client
TL;DR

Request syntax is correct but semantically invalid.

The request was well-formed but contains semantic errors.

Specification note

RFC 9110 moved 422 from WebDAV (RFC 4918, where it was called "Unprocessable Entity") into core HTTP and renamed it "Unprocessable Content".

What HTTP 422 Unprocessable Content Means

The request was well-formed but contains semantic errors.

Request syntax is correct but semantically invalid.

Common Causes

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

400 vs 422

Use 400 when the request cannot be parsed (broken JSON, wrong framing) and 422 when it parses fine but the values are invalid - an email without "@", an end date before the start date, a missing required field. Several frameworks return 422 for validation errors by default, including Laravel and FastAPI, and Rails scaffolds use :unprocessable_entity.

A good 422 response lists every failing field so the client can fix them in one go:

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

{"errors": {"email": ["must be a valid email address"]}}

Returning a 422 Unprocessable Content (Code Examples)

If you build APIs or web apps, here is how to send an HTTP 422 response and how to test for it:

Node.js (Express)

app.get('/resource', (req, res) => {
  res.status(422).json({ error: 'Unprocessable Content' });
});

Python (Flask)

@app.route('/resource')
def resource():
    return jsonify(error='Unprocessable Content'), 422

PHP

<?php
http_response_code(422);
header('Content-Type: application/json');
echo json_encode(['error' => 'Unprocessable Content']);

Check the status with curl

curl -I https://example.com/resource
# Look for: HTTP/1.1 422 Unprocessable Content

Frequently Asked Questions

What does HTTP 422 Unprocessable Content mean?

Request syntax is correct but semantically invalid. In short: The request was well-formed but contains semantic errors.

Is 422 Unprocessable Content a client or server error?

422 is a 4xx client-error code, so the request itself needs to change. The server is running normally and is rejecting the request as it was sent by the browser, app, or API client.

How do I fix a 422 Unprocessable Content error?

Validate request data. Check business rules. Return detailed validation errors.

Official Specification

The 422 Unprocessable Content status code is defined in RFC 9110 Section 15.5.21 (originally RFC 4918).

View the IANA HTTP Status Code Registry →