The syntax is fine and the server understood the request, but the content is semantically wrong — a valid date in the past where a future one is required, a transfer that would overdraw an account.
Defined in RFC 9110 §15.5.21 — 422 Unprocessable Content · MDN reference
Defined for WebDAV in RFC 4918 §11.2 as "Unprocessable Entity", then generalised and renamed by RFC 9110.
Validation failures: an email that is not an email, an end date before a start date, a quantity of zero on an order line, a field that is fine in isolation and wrong in context.
The distinction from 400 is the point: 400 means "I could not read this", 422 means "I read it, and no". Clients should surface them to users differently.
Do not retry. Map the per-field errors onto the form the user is looking at — this is the one error class where the API can tell the client exactly what to fix, and a client that flattens it to "invalid input" throws that away.
23 endpoints in this playground answer with 422. Every one is free, needs no signup, and can be called from the browser or with curl.
POST https://funapi.dev/api/bank/v1/accounts — Negative opening deposit (Bank API) Open & run this endpointPOST https://funapi.dev/api/bank/v1/transfers — Amount is not a positive number (Bank API) Open & run this endpointPOST https://funapi.dev/api/shop/v1/carts/{id}/checkout — Coupon invalid or expired (Shop API) Open & run this endpointPOST https://funapi.dev/api/worldcup/v1/matches/{id}/simulate — Knockout pairing not decided (World Cup 2026 API) Open & run this endpointGET https://funapi.dev/api/worldcup/v1/players/top-scorers — Invalid limit (World Cup 2026 API) Open & run this endpointPOST https://funapi.dev/api/worldcup/v1/tickets — Invalid category or quantity (World Cup 2026 API) Open & run this endpointPOST https://funapi.dev/api/worldcup/v1/predictions — Unknown team (World Cup 2026 API) Open & run this endpointPUT https://funapi.dev/api/fiba/v1/teams/{id}/staff — Missing coach, or a captain from another squad (FIBA World Cup API) Open & run this endpointPOST https://funapi.dev/api/fiba/v1/games/{id}/simulate — Knockout pairing not decided yet (FIBA World Cup API) Open & run this endpointPOST https://funapi.dev/api/fiba/v1/games/{id}/challenge — team must be home or away (FIBA World Cup API) Open & run this endpointPOST https://funapi.dev/api/fiba/v1/games/{id}/highlights — seconds must be 60, 120 or 300 (FIBA World Cup API) Open & run this endpointGET https://funapi.dev/api/fiba/v1/players/leaders — Unknown stat, or limit outside 1–20 (FIBA World Cup API) Open & run this endpointPOST https://funapi.dev/api/fiba/v1/tickets — Invalid tier or quantity (FIBA World Cup API) Open & run this endpointPOST https://funapi.dev/api/gta/v1/vehicles/{id}/respray — Missing color (GTA API) Open & run this endpointPOST https://funapi.dev/api/gta/v1/missions/{id}/start — Prerequisite not completed (GTA API) Open & run this endpointPOST https://funapi.dev/api/gta/v1/heists — Invalid approach or crew size (GTA API) Open & run this endpointPOST https://funapi.dev/api/dragonball/v1/fighters/{id}/power-up — Invalid amount (Dragon Ball API) Open & run this endpointPOST https://funapi.dev/api/formula1/v1/races/{id}/pit-stops — Invalid pit stop (Formula 1 API) Open & run this endpointPOST https://funapi.dev/api/anime/v1/fighters/{id}/transform — Invalid multiplier (Anime Tournament API) Open & run this endpointPUT https://funapi.dev/api/storage/v1/objects/{key} — Invalid base64 (Object Storage API) Open & run this endpointPUT https://funapi.dev/api/faults/v1/config — Invalid profile (Fault Injection API) Open & run this endpointPOST https://funapi.dev/api/data/v1/generate — Invalid schema (Fun Data Bridge API) Open & run this endpointPOST https://funapi.dev/api/data/v1/jobs — Invalid job (Fun Data Bridge API) Open & run this endpointAll HTTP status codes · All 39 mock REST APIs · Getting started guide
Last updated