> ## 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": "submission_refused",
    "message": "This is an invite-only campaign. Accept your invite before submitting.",
    "request_id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a"
  }
}
```

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. |
| 404 | `not_found` | Check the ID. |
| 409 | `conflict` | The post is already a clip, or the account needs attention. Read the message. |
| 422 | `submission_refused` | The campaign does not accept this clip. Read the message. |
| 429 | `rate_limited` | Wait for the time in `Retry-After`, then send the request again. |
| 500 | `internal_error` | Send the request again later. |
| 503 | `unavailable` | Send the request again later. |

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 use returns `404`. This includes a campaign
that ClipStake did not open to your key, an account that is not yours, an ID
with the wrong prefix and an ID that does not exist. The response does not
tell you which one applies.

## Instagram rate limits

Each Instagram account has a rate limit. ClipStake uses the same limit to
count the views of your clips. When an account is near its limit,
`GET /accounts/{account_id}/media` and `POST /clips` for that account return
`429` with a `Retry-After` header in seconds. Wait that long before you send
another request for the account. Other accounts are not affected.

## Account problems

`409 conflict` on an account means one of these:

* Instagram access expired. Connect the account again in ClipStake.
* Instagram put a security check on the account. Log in at instagram.com
  and follow the steps there.
* The account was disconnected while the clip was being submitted.

## 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.