What 400 Bad Request means
400 Bad Request means the server cannot or will not process the request because it is malformed, invalid, or violates protocol requirements. The problem is on the client side — but a poorly designed API can make legitimate requests look invalid.
When a server should return it
- The JSON body is malformed or fails schema validation.
- A required header is missing or has an invalid value.
- A query parameter has the wrong type or an out-of-range value.
- The request body exceeds a configured size limit (413 is more specific).
Example response
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json
{"type": "about:blank", "title": "Bad Request", "status": 400, "detail": "$.email: must be a valid email address"}Why you might see it unexpectedly
- A client serializing a body as form data while the server expects JSON.
- A proxy stripping or duplicating headers.
- Validation rejecting a field the API documentation does not mention.
- An encoding mismatch producing invalid UTF-8.
Related status codes
422 Unprocessable Content is often used for well-formed but semantically invalid data. 401 and 403 are about identity and permission, not syntax. 413 is specifically payload too large.