Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

HTTP 422 Unprocessable Content means the server understood your request’s media type and the request syntax is valid, but it cannot carry out the instructions or values contained in that request. The status is a client error (4xx); the code alone does not identify the invalid field or the exact correction. Read the response body and compare your request with the endpoint’s documented validation rules.

What HTTP 422 means

Under RFC 9110, HTTP 422 is used when a server understands the content type and can parse the request, yet cannot process its instructions. A useful standards example is well-formed XML whose instructions are semantically wrong: the XML syntax is valid, but the requested operation cannot be performed.

That distinction matters because 422 describes a class of failure, not a universal validation schema. One API may return a field list, another may return a single message, and another may provide a machine-readable problem document. The response body, headers and endpoint documentation determine what your particular service rejected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The current standards name is Unprocessable Content. Older APIs and documentation may call the same status Unprocessable Entity, the name used by RFC 4918’s 2007 WebDAV specification.

How 422 differs from 400 and 415

Use three diagnostic questions: does the server support the media type, is the request syntactically valid, and can the server execute the valid instructions? The answers separate the nearby status codes.

Status What failed Typical direction
400 Bad Request The server cannot or will not process the request because it sees a client error, including malformed request syntax. Repair malformed JSON, XML, query syntax, or other structural problems.
415 Unsupported Media Type The server does not support the request’s declared content type. Use a media type the endpoint accepts, such as the documented JSON type.
422 Unprocessable Content The content type is understood and syntax is correct, but the represented instructions or values fail semantic or validation rules. Correct the submitted data or requested operation.

These categories can overlap in everyday API wording. A service may choose 400 for a validation failure even though 422 would describe the situation, so follow that API’s documentation and established response format.

Common reasons an API returns 422

A required value is missing

The JSON parses correctly, but a required property is absent, empty, or null. For example, an account-creation endpoint might require email and password even though both names are syntactically valid JSON.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A value has the wrong semantic form

The field exists, but its value violates a rule such as an invalid email address, an unsupported country code, a date outside the permitted format, or a number outside an allowed range.

A combination of fields is impossible

Each property can be valid by itself while the combination is not. A delivery request might contain a valid postal code and a valid country code that do not belong together, or an update might request a state transition that is not allowed from the current status.

The referenced resource cannot satisfy the instruction

An identifier may have the right type but refer to an item that cannot be used for this operation. Whether the service reports that situation as 404, 409, or 422 is implementation-specific; inspect the body and documentation rather than inferring from the number alone.

Business rules reject an otherwise valid request

Examples include exceeding a plan limit, selecting an unavailable option, or attempting an operation that is valid in general but forbidden for the current account state. Some services use 409 Conflict or 403 Forbidden for similar conditions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to diagnose and fix a 422 response

  1. Capture the complete response. Save the status, response headers and body. Do not discard the body after checking only the status line.
  2. Read the service’s error representation. Look for a field path, parameter name, rule code, or human-readable message. There is no universal errors key or JSON shape.
  3. Compare the request with the endpoint contract. Check required properties, allowed values, types, ranges, formats, relationships between fields, authentication scope, and current resource state.
  4. Verify what you actually sent. Log the final serialized payload and relevant query parameters, while redacting passwords, tokens and personal data. Client-side objects can differ from the wire representation.
  5. Correct the semantic problem. Change the offending value or instruction, then submit again when the operation is safe to repeat. Do not change the media type or rewrite valid syntax unless the response points to that problem.
  6. Retest with the smallest valid request. Remove optional fields, use documented example values, and add fields back one at a time. This isolates cross-field rules and client serialization mistakes.

A 422 is not automatically transient. Retrying the identical payload usually produces the identical result and can create duplicate side effects when the server accepts some requests but rejects others. Correct the request first; use an API-specific retry policy for rate limits or server failures instead.

Rank #3
Sale
HTTP: The Definitive Guide
  • Used Book in Good Condition

Runnable request examples

cURL

curl -i -X POST "https://api.example.com/v1/users" 
  -H "Content-Type: application/json" 
  -H "Authorization: Bearer YOUR_TOKEN" 
  --data '{"email":"not-an-email","password":"short"}'

The -i flag keeps the status and headers visible. If the server returns 422, inspect the body printed after the headers for the service’s validation details.

Python

import requests

payload = {"email": "not-an-email", "password": "short"}
response = requests.post(
    "https://api.example.com/v1/users",
    json=payload,
    headers={"Authorization": "Bearer YOUR_TOKEN"},
    timeout=30,
)

print(response.status_code)
print(response.headers)
try:
    print(response.json())
except ValueError:
    print(response.text)

if response.status_code == 422:
    print("The server understood the request but rejected its values or instructions.")

Node.js

const payload = { email: 'not-an-email', password: 'short' };

const response = await fetch('https://api.example.com/v1/users', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  body: JSON.stringify(payload)
});

const text = await response.text();
console.log(response.status, response.headers);
try {
  console.log(JSON.parse(text));
} catch {
  console.log(text);
}

if (response.status === 422) {
  console.log('Inspect the response details and endpoint validation rules.');
}

Replace the example host, path, authentication and payload with the target API’s documented values. The snippets intentionally do not assume a particular error-body schema.

What not to assume from 422

  • It does not prove that the request body is JSON; any understood media type can be involved.
  • It does not guarantee a JSON response, a particular message property, or an errors object.
  • It does not identify which field failed without service-provided details.
  • It does not establish a universal retry rule. Determine whether the operation is safe to repeat and follow the API’s guidance.
  • It does not always mean the server is free of bugs. A faulty validation rule or inconsistent deployment can also produce an inappropriate 422; provide the request ID, payload shape and response when escalating.

Framework and client handling

Keep the HTTP status available to callers instead of converting every 4xx response into a generic exception. Parse structured details when the service documents them, but retain a fallback path for plain text or HTML. Map field-level errors to the relevant form controls, show a general message for non-field failures, and log a correlation or request identifier if the response supplies one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Validate obvious constraints locally to improve feedback, but treat server validation as authoritative: server-side rules can depend on current inventory, account permissions, uniqueness, or other state your client cannot know reliably.

Rank #4
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting branches

The body says “invalid JSON”

That points toward a syntax problem and is more consistent with 400 than 422. Confirm that the client sent the serialized body you intended, that quotes and commas are valid, and that the request is not double-encoded.

The body says “unsupported media type”

Check the Content-Type header and the endpoint’s accepted types. This is the 415 distinction, not the semantic condition represented by 422.

The body has no useful details

Check the endpoint documentation, response headers, server logs and request identifier. Reproduce the call with a minimal documented example and compare the wire payload byte for byte. Avoid assuming that a missing message means the request was accepted.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Your values look valid but 422 persists

Check case sensitivity, timezone and date serialization, numeric strings versus numbers, enum spelling, hidden whitespace, mutually dependent fields, account state and API version. Confirm that you are calling the intended environment and endpoint.

A previously valid request now fails

Compare API-version changes, schema or business-rule updates, account configuration and resource state. Preserve the failing response and a redacted request so the service owner can reproduce it.

Or skip the browser setup

If you need a rendered page image while investigating an API or documenting an error screen, ScreenshotNeo provides a direct screenshot request instead of maintaining browser automation. It removes cookie banners, newsletter popups and chat widgets before capture; bot checks, blank pages and failed loads are not billed; and its MCP server lets AI agents take screenshots.

One call is enough:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for options and response headers. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Historical terminology

When searching older documentation, include both names: “422 Unprocessable Content” and “422 Unprocessable Entity.” RFC 9110 (IETF, June 2022) uses the current wording; RFC 4918 (IETF, June 2007) used the older WebDAV wording for the same core condition. A legacy library or API may still expose the older label while sending the numeric status 422.

Frequently Asked Questions

Is HTTP 422 the same as a validation error?

Often, but not universally. It indicates that valid, understood content could not be processed; the API decides which validation and business-rule failures it reports as 422.

Should a client retry a 422 response?

Not unchanged. First correct the semantic or validation problem. Retry only after an appropriate change and only when repeating the operation is safe.

Why does one API use 400 where another uses 422?

HTTP defines the status semantics, but services choose their error taxonomy. Follow the target API’s documented conventions.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 3
HTTP: The Definitive Guide
HTTP: The Definitive Guide
Used Book in Good Condition
$26.04
SaleBestseller No. 4
HTTP Pocket Reference: Hypertext Transfer Protocol
HTTP Pocket Reference: Hypertext Transfer Protocol
Used Book in Good Condition
$6.94
Bestseller No. 5

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.