HTTP 400 — Bad Request

The server cannot process the request due to a client error

When to use it

Use status 400 when this is the correct HTTP response semantic: The server cannot process the request due to a client error

Request and response example

POST /users HTTP/1.1
Host: api.example.com
Content-Type: application/json

{"name":

HTTP/1.1 400 Bad Request
Content-Type: application/json

{"error":"Invalid JSON"}

Related status codes

401, 402, 403, 404

References

MDN · RFC 9110