> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lasscyber.com/llms.txt
> Use this file to discover all available pages before exploring further.

# bad_request

> HTTP 400 — the request was malformed in a way that could not be expressed as a Pydantic validation error.

|                 |                                    |
| --------------- | ---------------------------------- |
| **HTTP status** | `400 Bad Request`                  |
| **Code**        | `bad_request`                      |
| **Retry?**      | No — fix the request and re-issue. |

## When this happens

The server received the request but could not process it. Typical
causes:

* The body is not valid JSON.
* The `Content-Type` header is missing or wrong.
* A required path parameter is malformed (e.g. a non-UUID where one is
  expected).
* A schema constraint outside Pydantic's type system was violated
  (e.g. mutually exclusive fields).

If the failure is a *typed* schema violation (missing fields, wrong
type), the server returns
[`validation_error`](/errors/validation_error) (422) instead.

## Example response

```json theme={null}
{
  "detail": "Request body is not valid JSON.",
  "code": "bad_request",
  "request_id": "5b3f6c7e-7d24-4d40-9b12-3a59c01c6e91",
  "doc_url": "https://docs.lasscyber.com/errors/bad_request"
}
```

## How to fix

1. Confirm the request body parses as JSON.
2. Confirm `Content-Type: application/json`.
3. Compare the body to the auto-generated schema in the
   [API reference](/api-reference/overview).
4. If you are using an SDK, upgrade to the latest minor and re-run.
   Most `bad_request`s in the wild are misuse of low-level escape
   hatches.

## SDK behaviour

| SDK        | Exception                                              |
| ---------- | ------------------------------------------------------ |
| Python     | `agnes.ValidationError` (with `code == "bad_request"`) |
| TypeScript | `ValidationError` (with `code === "bad_request"`)      |

Quote `request_id` when filing a support ticket.
