400 Bad Request
The request is malformed (invalid syntax, JSON or parameters).
Common causes
- Malformed JSON / form data or missing required fields
- Invalid query string or headers, cookies too large
- Content-Type does not match the data sent
How to fix
- Check the body with a JSON formatter and compare with the API docs
- Clear the site's cookies if the browser shows 400 Bad Request – Request Header Or Cookie Too Large
- On the server: return an error message naming the invalid field
Detailed reference (MDN) ↗RFC 9110 §15.5.1 ↗
Which code should I use?
- 400 / 422: 400: the request is malformed (broken JSON, missing required parameter). 422: the syntax is fine but the data is invalid (bad email format, value out of range).
