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

# Errors

> Error codes and how to handle them

The Reel25 API uses standard HTTP status codes and returns structured error responses.

## Error response format

```json theme={null}
{
  "code": "ERROR_CODE",
  "message": "Human-readable description of the error"
}
```

## HTTP status codes

| Status | Description |
| - | - |
| `200` | Request succeeded |
| `201` | Resource created successfully |
| `400` | Bad request — invalid parameters or URL |
| `401` | Unauthorized — missing or invalid API key |
| `404` | Resource not found |
| `409` | Conflict — resource already exists |
| `429` | Rate limit exceeded |
| `500` | Internal server error |

## Error codes

| Code | HTTP Status | Description |
| - | - | - |
| `INVALID_API_KEY` | 401 | API key is missing, malformed, or revoked |
| `INVALID_URL` | 400 | URL is not a supported TikTok, Instagram, or YouTube link |
| `NOT_FOUND` | 404 | The requested video, account, or search was not found |
| `ALREADY_TRACKED` | 409 | This video is already tracked in your workspace |
| `RATE_LIMIT_EXCEEDED` | 429 | You've exceeded 60 requests per minute |
| `MAX_API_KEYS_REACHED` | 400 | Maximum of 5 active API keys per workspace |
| `INSUFFICIENT_CREDITS` | 402 | Not enough credits for this operation |

## Handling errors

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.reel25.com/api/v1/videos', {
    headers: { 'Authorization': 'Bearer reel25_sk_...' },
  });

  if (!response.ok) {
    const error = await response.json();
    console.error(`Error ${response.status}: ${error.code} — ${error.message}`);
  }
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.reel25.com/api/v1/videos',
      headers={'Authorization': 'Bearer reel25_sk_...'}
  )

  if not response.ok:
      error = response.json()
      print(f"Error {response.status_code}: {error['code']} — {error['message']}")
  ```
</CodeGroup>


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