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

# API Reference

> Animam REST API

The Animam API allows you to manage your chatbot programmatically.

## Base URL

```
https://api.animam.ai
```

## Authentication

The API supports 3 authentication methods:

| Method           | Header                         | Usage                  |
| ---------------- | ------------------------------ | ---------------------- |
| **Bearer Token** | `Authorization: Bearer ak_...` | Recommended for API    |
| Session Cookie   | `animam_session`               | Dashboard only         |
| Legacy API Key   | `X-API-Key: ...`               | Backward compatibility |

<Note>
  Create your API tokens in **Dashboard > API Tokens**.
</Note>

## Scopes

Each token has specific permissions:

| Scope                | Description        |
| -------------------- | ------------------ |
| `corpus:read`        | Read corpus        |
| `corpus:write`       | Modify corpus      |
| `conversations:read` | View conversations |
| `settings:read`      | Read settings      |
| `settings:write`     | Modify settings    |
| `*`                  | Full access        |

## Response format

All responses are in JSON.

```json theme={null}
{
  "corpus": [...],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 42
  }
}
```

## Errors

| Code  | Description                   |
| ----- | ----------------------------- |
| `400` | Invalid request               |
| `401` | Not authenticated             |
| `403` | Access denied (missing scope) |
| `404` | Resource not found            |
| `429` | Rate limit exceeded           |
| `500` | Server error                  |

```json theme={null}
{
  "error": "Missing required scope: corpus:write"
}
```

## Rate Limits

* **Standard**: 1000 requests/minute
* **Enterprise**: Unlimited

## Endpoints

<CardGroup cols={2}>
  <Card title="Tenant" icon="building" href="/api-reference/endpoints/tenant">
    Tenant info and settings
  </Card>

  <Card title="Corpus" icon="book" href="/api-reference/endpoints/corpus">
    Manage the knowledge base
  </Card>

  <Card title="Conversations" icon="messages" href="/api-reference/endpoints/conversations">
    Conversation history
  </Card>

  <Card title="Chat" icon="message" href="/api-reference/endpoints/chat">
    Send messages
  </Card>
</CardGroup>
