# invalid_request — Postify API error

HTTP 400 · Invalid request

This page is the resolution of the problem `type` URI `https://usepostify.com/docs/api/problems/invalid-request`.

The request was structurally wrong before validation even ran — malformed JSON, a missing request body where one is required, an unusable query parameter, or a malformed Idempotency-Key header.

## Common causes

- The request body is not valid JSON (trailing comma, unquoted key, truncated payload).
- The Content-Type header is missing or not application/json on a body-carrying request.
- A query parameter has an unusable value — e.g. limit outside 1–100, or an unparseable cursor.

## How to fix

- Serialize the body with a JSON library rather than string concatenation.
- Send Content-Type: application/json on every POST/PATCH.
- Read the `detail` field — it names what was malformed.

## Example response

```json
{
  "type": "https://usepostify.com/docs/api/problems/invalid-request",
  "title": "Invalid request",
  "status": 400,
  "code": "invalid_request",
  "detail": "Request body is not valid JSON.",
  "request_id": "req_6f1f8a2b40d34cd2a6f1e2c9b8d7a601"
}
```

## Related

- [API quickstart](https://usepostify.com/docs/api)
- [validation_failed (schema-level errors)](https://usepostify.com/docs/api/problems/validation-failed)
