Skip to content

4xx Client error

400 Bad Request

The server can't process the request because something in it is malformed.

What 400 means

A catch-all for invalid requests: broken JSON, missing required parameters, wrong types or a malformed header. The response body usually says what's wrong.

Common causes

  • Invalid JSON in the body (a trailing comma, single quotes).
  • A missing or misspelled required parameter.
  • A wrong Content-Type, e.g. sending JSON without Content-Type: application/json.

How to fix it

If you're calling an API

  • Read the error message in the response body; most APIs say exactly which field is wrong.
  • Validate your JSON (our JSON formatter shows the exact error position).
  • Compare your request with the API's documented example.

If you run the server

  • Return a clear, machine-readable error body (e.g. RFC 9457 problem details) naming the bad field.

Should you retry?

No: fix the request first, or it will fail the same way.

Example response

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

{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "The server can't process the request because something in it is malformed."
}

Defined in: RFC 9110 (HTTP Semantics). 400 is a client error: change the request before retrying.

Debugging an API call? Convert your request with the cURL converter, check the response with the JSON formatter, or see whether the API is down on its status page.

Often confused with

HTTP 400 FAQ

What does HTTP 400 mean?

400 Bad Request: The server can't process the request because something in it is malformed. A catch-all for invalid requests: broken JSON, missing required parameters, wrong types or a malformed header. The response body usually says what's wrong.

Is 400 a client or server error?

It's a client error (4xx): something about the request needs to change before it can succeed.

How do I fix a 400 error?

Read the error message in the response body; most APIs say exactly which field is wrong. Validate your JSON (our JSON formatter shows the exact error position). Compare your request with the API's documented example.

Should I retry after a 400?

No: fix the request first, or it will fail the same way.

Other 4xx status codes

All HTTP status codes