HTTP/4xx (Client Error)
422 Unprocessable Content
The request was well-formed but was unable to be followed due to semantic errors.
❓ Why does this happen?
Common in modern REST APIs when input validation fails (e.g. Zod or Pydantic validation error).
✅ How to fix it
Review API response error details to identify and fix invalid parameter fields.
Return or handle 422 in your stack
// app/api/resource/route.ts
export function GET() {
return Response.json(
{ error: "Unprocessable Content", status: 422 },
{
status: 422
}
);
}Live 422 mock endpoint
Point your app, tests, or retry logic at this free public URL to reproduce a real 422 response (CORS enabled, optional ?delay=ms up to 5000).
https://castov.com/api/mock/422422 vs similar status codes
Frequently Asked Questions
What does HTTP Status 422 mean?
Why am I getting a 422 status code?
How do I fix a 422 Unprocessable Content error?
What is the difference between 422 Unprocessable Content and 400 Bad Request?
How can I test how my app handles a 422 response?
Other 4xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.