4xx

400 Bad Request

The server cannot process the request due to a client-side error in the request.

What is HTTP 400?

This status code indicates that the server cannot or will not process the request because something in the request is perceived as a client error. This could be malformed syntax, invalid request framing, or deceptive request routing. It is a generic catch-all for requests that do not meet the server's expectations. The server should include details about what was wrong with the request in the response body.

Defined in RFC 9110

Common Causes

  • Malformed JSON, XML, or form data in the request body
  • Missing or invalid required parameters or headers
  • URL encoding errors or characters that the server cannot parse
  • Request size exceeding server limits or corrupted request data

How to Fix

  • Review the request format and ensure it matches the API specification or expected schema
  • Validate all required parameters are present and correctly formatted before sending
  • Check the response body for specific error details about what was malformed
  • Ensure Content-Type header matches the actual format of the request body