HTTP 400 Bad Request
The server cannot process the request due to a client error.
4xx Client Error
400
Bad Request
Description
The 400 Bad Request status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). The client should not repeat the request without modifications. This is a generic client-side error status that is used when no other 4xx error code is appropriate. It can indicate issues like invalid JSON in the request body, missing required parameters, invalid query string formatting, request headers that are too large, or any other violation of the expected request format.
When Is It Used?
Returned when the client sends a request the server cannot understand. Common causes include malformed JSON in the request body, missing required fields, invalid data types (string where number expected), or badly formatted query parameters.
Example Response
HTTP/1.1 400 Bad Request
Content-Type: application/json
{"error": "Invalid JSON", "message": "Unexpected token at position 15"}Related Status Codes
401
Unauthorized
Authentication is required and has failed or has not been provided.
403
Forbidden
The server understood the request but refuses to authorize it.
404
Not Found
The server cannot find the requested resource.
422
Unprocessable Entity
The server understands the request but cannot process the contained instructions.