400 Bad Request: The server could not understand the request because of invalid syntax. 400 Bad Request means the server could not understand the request. The JSON is broken, a required header is missing, or a parameter has the wrong type. It is a client error, so retrying the same request will not help. The client has to fix what it sends. That is why a useful 400 response explains what was wrong, for example "field date must be in YYYY-MM-DD format", rather than just repeating the status text.
What should you keep in mind with 400 Bad Request?
In practice, APIs use 400 for malformed requests and 422 for requests that are well-formed but fail validation. Laravel, for instance, returns 422 with a list of field errors when validation fails. Whichever you choose, document it and be consistent, so front-end developers can show the right message to the user.
Use when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like "419 Page Expired", "422 Unprocessable Content", "502 Bad Gateway" or "CORS error", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.
'Expert-level browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, capturing screenshots, analyzing network traffic, and profiling performance.'
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.