Home
/
API Response Examples
/
422 Unprocessable
422 Unprocessable Entity JSON response example
Last updated 2026-05-20
When to use this
Use this when the request parsed correctly but failed business validation. The body is identical in spirit to the validation-error page but tied to the 422 status semantics specifically.
Example JSON
Same body as validation-error, but always returned with HTTP 422.
{
"status": 422,
"error": "Unprocessable Entity",
"message": "Cart cannot be checked out",
"code": "cart_invalid",
"errors": [
{
"field": "items[0].quantity",
"message": "Quantity exceeds stock"
},
{
"field": "shippingAddress",
"message": "Shipping address is required"
}
]
}
Request examples
fetch()
cURL
Python
Copy
const res = await fetch('https://jsonexamples.com/http/422/Unprocessable+entity');
if (!res.ok) {
const err = await res.json();
console.error(res.status, err.message);
}
Copy
curl -i https://jsonexamples.com/http/422/Unprocessable+entity
Copy
import requests
r = requests.get('https://jsonexamples.com/http/422/Unprocessable+entity')
if r.status_code >= 400:
print(r.status_code, r.json())
Try the live endpoint
Click below to call /http/422/Unprocessable+entity from your browser.
Call /http/422/Unprocessable+entity
// click the button to populate this block
Common variations
Single business-rule violation
{
"status": 422,
"error": "Unprocessable Entity",
"message": "Email already in use",
"code": "email_taken"
}
Convert this JSON
Generated starting points for TypeScript, JSON Schema, and Zod. Refine before shipping to production.
TypeScript
JSON Schema
Zod
Copy
export interface 422Unprocessable {
"status": number;
"error": string;
"message": string;
"code": string;
"errors": {
"field": string;
"message": string;
}[];
}
Copy
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "422Unprocessable",
"type": "object",
"properties": {
"status": {
"type": "integer"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"code": {
"type": "string"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"field",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"status",
"error",
"message",
"code",
"errors"
],
"additionalProperties": false
}
Copy
import { z } from 'zod';
export const 422UnprocessableSchema = z.object({
status: z.number(),
error: z.string(),
message: z.string(),
code: z.string(),
errors: z.array(z.object({
field: z.string(),
message: z.string()
}))
});
export type 422Unprocessable = z.infer<typeof 422UnprocessableSchema>;
Copy link to this example
https://jsonexamples.com/api-response-examples/422-unprocessable