4xx · Client errorterminal
422Unprocessable Entity
The request was well-formed but was unable to be followed due to semantic errors. Very common in robust REST APIs for payload validation errors.
What this code obliges you to do
Retry
Do not retry automatically
Repeating the same request produces the same result. A retry loop here just multiplies load and hides the real fault.
Caching
Not cacheable by default
Caches will not store this response unless you send explicit freshness headers saying they may.
Response body
Body allowed
You may return a payload explaining the outcome — for an error, a machine-readable problem document is worth the effort.
What usually causes it
21
Schema validation fails (e.g., age<0 in JSON payload)
2
Zod/Joi validation boundaries triggered
Effect on search
Neutral. API specific.
How to send it
1Ruby (Rails)
render json: @user.errors, status: :unprocessable_entityCodes people confuse with this one
1Class4xx
RetryNo
CacheNo
BodyAllowed