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
Do not retry automatically
Repeating the same request produces the same result. A retry loop here just multiplies load and hides the real fault.
Not cacheable by default
Caches will not store this response unless you send explicit freshness headers saying they may.
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
5Invalid JSON body or wrong Content-Type header
Missing required query parameters or form fields
Malformed URI strings, unencoded spaces, or invalid characters
Request body exceeds validation rules before application logic runs
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
4curl -i -X POST https://api.example.com/users \
-H 'Content-Type: application/json' \
--data '{"email":"test@example.com"}'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 });
});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 });
}client_max_body_size 10m;
large_client_header_buffers 4 16k;