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.

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)

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 4918.

View the IANA HTTP Status Code Registry →