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

# Errors

> Handle the error format and the error codes.

Every error uses the same JSON format.

```json theme={null}
{
  "error": {
    "code": "not_found",
    "message": "The requested resource was not found.",
    "request_id": "3c9a8b7d-2e1f-4a6b-9c8d-7e6f5a4b3c21"
  }
}
```

Use `code` in your logic. The `message` text can change.

| Status | Code | Action |
| - | - | - |
| 400 | `invalid_request` | Fix the request. |
| 401 | `unauthorized` | Send a valid API key. |
| 403 | `forbidden` | Use a key with write access, or ask ClipStake to let your agency create campaigns. |
| 404 | `not_found` | Check the ID. |
| 409 | `conflict` | Use a different campaign name. |
| 429 | `rate_limited` | Wait, then send the request again. |
| 500 | `internal_error` | Send the request again later. |
| 503 | `unavailable` | ClipStake is in maintenance. Send the request again later. |

Only `POST /campaigns` returns `403`, `409` and `503`.

If many requests return a `5xx` status, check
[status.clipstake.com](https://status.clipstake.com). It shows the current
status of each ClipStake service.

## Not found

An ID that your API key cannot read returns `404`. This includes an ID from
another agency, an ID with the wrong prefix and an ID that does not exist. The
response does not tell you which one applies.

The `brand_id` filter of `GET /campaigns` works the same way. A brand ID that
your API key cannot read returns `404`, not an empty list.

## Forbidden

`POST /campaigns` returns `403` for two causes:

* The API key does not have write access. Create a key with write access.
* Your agency cannot create campaigns yet. Book a call with ClipStake to turn
  this on.

The `message` tells you which cause applies. A brand that your API key cannot
read returns `404`, not `403`.

## Request IDs

Each response has an `X-Request-Id` header. The error body also contains
`request_id`. Give this value to ClipStake support when you report a problem.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.