HTTP 422 — Unprocessable Entity
The request was well-formed but was unable to be followed due to semantic errors
When to use it
Use status 422 when this is the correct HTTP response semantic: The request was well-formed but was unable to be followed due to semantic errors
Request and response example
POST /orders HTTP/1.1
Host: api.example.com
Content-Type: application/json
{"quantity":0}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json
{"error":"quantity must be greater than zero"}