DD
DevDash

HTTP 422 Unprocessable Content: What It Means and When You See It

Quick Answer

HTTP 422 Unprocessable Content means the request was well-formed but contains semantic errors — for example, validation failures on form fields.

HTTP 422 vs 400

HTTP 400 Bad Request means the request is malformed - the syntax is wrong (invalid JSON, missing brackets). HTTP 422 Unprocessable Content means the request is syntactically correct but fails validation - the JSON parsed fine but a field value is invalid (email format wrong, age is negative, required field missing). FastAPI returns 422 automatically for Pydantic validation failures. Django REST Framework returns 400 for both. REST APIs increasingly prefer 422 for validation errors.

Returning 422 in APIs

FastAPI: Pydantic validation failures automatically return 422 with a detailed errors array. Express.js with express-validator: const errors = validationResult(req); if (!errors.isEmpty()) return res.status(422).json({ errors: errors.array() }). The response body should identify which fields failed and why: { "errors": [{ "field": "email", "message": "Invalid email format" }] }. Clients should display these errors next to the relevant form fields.

Try the interactive tool

Convert any value instantly — no sign-up required

Open tool →

Frequently Asked Questions

Related Values

Want API access + no ads? Pro coming soon.