400 Bad Request

All status codes
4xx · Client errorterminal

400Bad Request

The server cannot process the request because the client sent invalid syntax, malformed JSON, missing fields, or headers the endpoint cannot accept.

What this code obliges you to do

Retry

Do not retry automatically

Repeating the same request produces the same result. A retry loop here just multiplies load and hides the real fault.

Caching

Not cacheable by default

Caches will not store this response unless you send explicit freshness headers saying they may.

Response body

Body allowed

You may return a payload explaining the outcome — for an error, a machine-readable problem document is worth the effort.

What usually causes it

5
1

Invalid JSON body or wrong Content-Type header

2

Missing required query parameters or form fields

3

Malformed URI strings, unencoded spaces, or invalid characters

4

Request body exceeds validation rules before application logic runs

5

API schema mismatch after a client or backend deploy

Effect on search

Negative if encountered by crawlers. HTTP 400 can signal malformed internal links, invalid URL encoding, broken faceted navigation, or server rules rejecting Googlebot requests.

How to send it

4
curl
curl -i -X POST https://api.example.com/users \
  -H 'Content-Type: application/json' \
  --data '{"email":"test@example.com"}'
Node.js (Express)
app.post('/users', express.json(), (req, res) => {
  if (!req.body.email) {
    return res.status(400).json({ error: 'email is required' });
  }
  res.status(201).json({ ok: true });
});
Next.js Route Handler
export async function POST(request: Request) {
  const body = await request.json().catch(() => null);
  if (!body?.email) {
    return Response.json({ error: 'email is required' }, { status: 400 });
  }
  return Response.json({ ok: true });
}
Nginx
client_max_body_size 10m;
large_client_header_buffers 4 16k;

Codes people confuse with this one

2
Class4xx
RetryNo
CacheNo
BodyAllowed