The server could not understand the request — malformed JSON, a missing required field, or a parameter of the wrong type.
Defined in RFC 9110 §15.5.1 — 400 Bad Request · MDN reference
Malformed JSON, a query parameter of the wrong type, a missing required field, a payload the parser cannot make sense of at all.
The baseline negative test. It is also the code most often used where 422 would be more accurate, so check which one your API actually sends.
Never retry a 400 unchanged — the request is wrong and will be wrong the second time. Surface the server's error detail rather than a generic failure message; the whole value of a 400 is that it says what it did not understand.
105 endpoints in this playground answer with 400. Every one is free, needs no signup, and can be called from the browser or with curl.
GET https://funapi.dev/api/friends/v1/characters — Invalid page parameter, or an unknown query parameter (strict mode) (Friends API) Open & run this endpointGET https://funapi.dev/api/friends/v1/characters/{id} — Invalid id (Friends API) Open & run this endpointPOST https://funapi.dev/api/friends/v1/characters — Missing name / invalid JSON (Friends API) Open & run this endpointPOST https://funapi.dev/api/friends/v1/characters/bulk — Body is not a JSON array (Friends API) Open & run this endpointPUT https://funapi.dev/api/friends/v1/characters/{id} — Empty body / invalid JSON (Friends API) Open & run this endpointPOST https://funapi.dev/api/friends/v1/characters/bulk-delete — "ids" is missing, empty, or not an array of integers (Friends API) Open & run this endpointGET https://funapi.dev/api/friends/v1/episodes — Non-integer season (Friends API) Open & run this endpointGET https://funapi.dev/api/friends/v2/characters — Invalid page parameter (Friends API) Open & run this endpointPOST https://funapi.dev/api/friends/v1/graphql — Missing "query" string, or completely unrecognized syntax (Friends API) Open & run this endpointGET https://funapi.dev/api/superheroes/v1/heroes — Invalid page (Superhero API) Open & run this endpointPOST https://funapi.dev/api/superheroes/v1/heroes — Missing name or power (Superhero API) Open & run this endpointPOST https://funapi.dev/api/superheroes/v1/heroes/versus — Same hero twice or unknown id (Superhero API) Open & run this endpointGET https://funapi.dev/api/pizza/v1/menu — Invalid vegetarian value (Pizza Orders API) Open & run this endpointPOST https://funapi.dev/api/pizza/v1/orders — Unknown pizzaId, bad size, or missing address (Pizza Orders API) Open & run this endpointPUT https://funapi.dev/api/pizza/v1/orders/{id}/status — Invalid status value (Pizza Orders API) Open & run this endpointPATCH https://funapi.dev/api/pizza/v1/orders/{id} — Empty body, invalid JSON, or bad size (Pizza Orders API) Open & run this endpointGET https://funapi.dev/api/coffee/v1/drinks — Invalid type (Coffee Shop API) Open & run this endpointPOST https://funapi.dev/api/coffee/v1/orders — Unknown drinkId or missing name (Coffee Shop API) Open & run this endpointGET https://funapi.dev/api/football/v1/teams — Invalid page (Football API) Open & run this endpointPOST https://funapi.dev/api/football/v1/matches — Same team twice or unknown team (Football API) Open & run this endpointGET https://funapi.dev/api/movies/v1/movies — Invalid sort or page, or an unknown query parameter (strict mode) (Movies API) Open & run this endpointGET https://funapi.dev/api/movies/v1/search/fuzzy — Missing "q" or invalid maxDistance (Movies API) Open & run this endpointPOST https://funapi.dev/api/movies/v1/movies — Missing title (Movies API) Open & run this endpointPUT https://funapi.dev/api/movies/v1/movies/{id}/rating — Rating outside the inclusive 0–10 range (Movies API) Open & run this endpointPOST https://funapi.dev/api/movies/v1/movies/{id}/poster — Missing filename or sizeBytes (Movies API) Open & run this endpoint…and 80 more endpoints across the catalog.
All HTTP status codes · All 39 mock REST APIs · Getting started guide
Last updated