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

# Introduction

> Getting started with the Leavo API

## Base URL

All API requests should be made to:

```
https://api.leavo.ai
```

## Authentication

All requests require Bearer Token authentication:

```bash theme={null}
Authorization: Bearer your_api_key_here
```

## Available Endpoints

### Leads

| Method   | Endpoint              | Description     |
| -------- | --------------------- | --------------- |
| `GET`    | `/backend/leads`      | List all leads  |
| `POST`   | `/backend/leads`      | Create new lead |
| `PUT`    | `/backend/leads/{id}` | Update lead     |
| `DELETE` | `/backend/leads/{id}` | Delete lead     |

### Tags

| Method   | Endpoint             | Description   |
| -------- | -------------------- | ------------- |
| `GET`    | `/backend/tags`      | List all tags |
| `POST`   | `/backend/tags`      | Create tag    |
| `PUT`    | `/backend/tags/{id}` | Update tag    |
| `DELETE` | `/backend/tags/{id}` | Delete tag    |

### Status

| Method   | Endpoint               | Description   |
| -------- | ---------------------- | ------------- |
| `GET`    | `/backend/status`      | List statuses |
| `POST`   | `/backend/status`      | Create status |
| `PUT`    | `/backend/status/{id}` | Update status |
| `DELETE` | `/backend/status/{id}` | Delete status |

### Webhooks

| Method   | Endpoint                 | Description    |
| -------- | ------------------------ | -------------- |
| `GET`    | `/backend/webhooks`      | List webhooks  |
| `POST`   | `/backend/webhooks`      | Create webhook |
| `PUT`    | `/backend/webhooks/{id}` | Update webhook |
| `DELETE` | `/backend/webhooks/{id}` | Delete webhook |

### AI Processing

| Method | Endpoint      | Description             |
| ------ | ------------- | ----------------------- |
| `POST` | `/ai/process` | Process message with AI |

### Conversations

| Method | Endpoint                             | Description        |
| ------ | ------------------------------------ | ------------------ |
| `GET`  | `/backend/conversations`             | List conversations |
| `GET`  | `/backend/conversations/{id}/stream` | SSE stream         |

### Messages

| Method | Endpoint                      | Description       |
| ------ | ----------------------------- | ----------------- |
| `GET`  | `/backend/messages/{lead_id}` | Get lead messages |
| `POST` | `/backend/messages/send`      | Send message      |
| `POST` | `/backend/messages/media`     | Send media        |

### Departments

| Method   | Endpoint                    | Description       |
| -------- | --------------------------- | ----------------- |
| `GET`    | `/backend/departments`      | List departments  |
| `POST`   | `/backend/departments`      | Create department |
| `PUT`    | `/backend/departments/{id}` | Update department |
| `DELETE` | `/backend/departments/{id}` | Delete department |

### File Uploads

| Method   | Endpoint                | Description   |
| -------- | ----------------------- | ------------- |
| `POST`   | `/backend/uploads`      | Upload file   |
| `GET`    | `/backend/uploads/{id}` | Get upload    |
| `DELETE` | `/backend/uploads/{id}` | Delete upload |

### Templates (Meta/Gupshup)

| Method   | Endpoint                  | Description       |
| -------- | ------------------------- | ----------------- |
| `GET`    | `/backend/templates`      | List templates    |
| `POST`   | `/backend/templates/sync` | Sync from Gupshup |
| `DELETE` | `/backend/templates/{id}` | Delete template   |

### Follow-up

| Method   | Endpoint                         | Description             |
| -------- | -------------------------------- | ----------------------- |
| `POST`   | `/backend/followup/configs`      | Create follow-up config |
| `GET`    | `/backend/followup/configs/{id}` | Get config              |
| `PUT`    | `/backend/followup/configs/{id}` | Update config           |
| `DELETE` | `/backend/followup/configs/{id}` | Delete config           |
