# Errors

> Every Klupt API error has an HTTP status and a stable error.code. Failed calls and rate-limit answers are never charged. Full list of codes and how to retry.

Errors use HTTP status codes and a stable `error.code`. **Failed calls are never charged**, and neither are our own `429` answers. Quote the `request_id` when you contact us.

```json
{
  "error": {
    "code": "private_account",
    "message": "This account is private. The API only covers public accounts.",
    "request_id": "req_4kd9…",
    "docs": "https://api.klupt.io/docs/errors"
  }
}
```

| Status | Code | Meaning |
|---|---|---|
| 401 | `missing_api_key` | Send your API key in the X-Api-Key header. |
| 401 | `invalid_api_key` | This API key is not valid or has been revoked. |
| 429 | `too_many_bad_keys` | Too many requests with invalid API keys from this address. Wait a minute. |
| 403 | `account_suspended` | This account is suspended. Contact api@klupt.io. |
| 403 | `account_rejected` | This account was not approved. Contact api@klupt.io if you think this is a mistake. |
| 403 | `account_not_approved` | Your account is waiting for review. Sandbox (kd_test_) keys work now; live keys open once the account is approved. |
| 402 | `promo_limit` | Free test calls are limited to 1 request per second and the first 5 pages of a list. Buy a credit pack to go further. |
| 402 | `insufficient_credits` | Your account is out of credits. Buy a credit pack in the dashboard to continue. |
| 429 | `key_quota_exceeded` | This key reached its monthly credit cap. Raise the cap in the dashboard or wait for next month. |
| 429 | `rate_limited` | Too many requests per second. Slow down and retry after the Retry-After delay. |
| 429 | `concurrency_limited` | Too many requests in flight at once. Wait for one to finish, then retry. |
| 403 | `ip_not_allowed` | This API key cannot be used from your IP address. Check the key's IP allowlist. |
| 403 | `purchase_locked` | New accounts can buy the two smallest packs first. Larger packs and plans unlock after you use some credits. |
| 400 | `invalid_request` | The request is not valid. |
| 400 | `invalid_cursor` | This cursor is not valid for this endpoint. Start again without a cursor. |
| 404 | `user_not_found` | No Instagram account with this username or id. |
| 403 | `private_account` | This account is private. The API only covers public accounts. |
| 503 | `order_unavailable` | A newest-first list is not available right now. Retry shortly, or call without strict_order. |
| 502 | `upstream_unavailable` | Instagram data is temporarily unavailable. Retry in a moment; failed calls are free. |
| 504 | `upstream_timeout` | Fetching this data took too long. Retry in a moment; failed calls are free. |
| 503 | `service_busy` | We are at capacity right now. Retry in a minute; failed calls are free. |
| 500 | `internal_error` | Something went wrong on our side. Retry in a moment. |

## Retrying

Retry `429`, `502`, `503` and `504` with exponential backoff and jitter, honouring `Retry-After` when present. Do not retry `400`, `401`, `402`, `403` or `404`: the answer will not change.
