# bad_request

> The bad_request Problem Details code: The request is malformed, such as invalid JSON or a bad Idempotency-Key header.

Source: https://docs.nexafone.so/v1/errors/bad_request/

| | |
| --- | --- |
| HTTP status | `400` |
| Area | General |
| Problem `type` | `https://docs.nexafone.so/errors/bad_request` |

The request is malformed, such as invalid JSON or a bad `Idempotency-Key` header.

## What the `detail` says

The `detail` explains the occurrence; it can read, for example:

- The Idempotency-Key header must be 1 to 255 visible ASCII characters.
- The callback could not be read.
- The request body could not be read.

## Handling it

Fix the request before retrying.

## Example

```json
{
  "type": "https://docs.nexafone.so/errors/bad_request",
  "title": "Bad Request",
  "status": 400,
  "code": "bad_request",
  "detail": "The Idempotency-Key header must be 1 to 255 visible ASCII characters.",
  "requestId": "01J9Z8Q4TQ3W6M5V2X7Y8Z9A0B"
}
```

Match on `code`, never on `detail`: the wording may change. See [Problem Details](/v1/errors/).
