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

# Bots

> Create and manage AI bots, attach channels, tools, and knowledge base files

All endpoints require authentication. See [Auth](/mahalaxmi/api/auth).

## Endpoints

### List Bots

```http theme={null}
GET /api/bots
```

Returns all bots for the authenticated user.

***

### Create Bot

```http theme={null}
POST /api/bots
```

**Body**

| Field          | Type    | Required | Description                                                    |
| -------------- | ------- | -------- | -------------------------------------------------------------- |
| `name`         | string  | Yes      | Min. 3 characters                                              |
| `description`  | string  | Yes      | Min. 10 characters                                             |
| `systemPrompt` | string  | Yes      | Instructions for the bot                                       |
| `colorTheme`   | string  | No       | `blue`, `indigo`, `purple`, `green`, `red`, `orange`, `yellow` |
| `active`       | boolean | No       | Default `true`                                                 |

***

### Get Bot

```http theme={null}
GET /api/bots/:id
```

***

### Update Bot

```http theme={null}
PATCH /api/bots/:id
```

Partial update — send only the fields you want to change.

***

### Delete Bot

```http theme={null}
DELETE /api/bots/:id
```

***

## Bot Knowledge Base — Files

### List Files

```http theme={null}
GET /api/bots/:id/files
```

### Upload File

```http theme={null}
POST /api/bots/:id/files
Content-Type: multipart/form-data
```

| Field  | Type | Description                       |
| ------ | ---- | --------------------------------- |
| `file` | file | PDF or text file for RAG training |

### Delete File

```http theme={null}
DELETE /api/bots/:id/files/:fileId
```

***

## Bot Knowledge Base — URLs

### List URLs

```http theme={null}
GET /api/bots/:id/urls
```

### Add URL

```http theme={null}
POST /api/bots/:id/urls
```

| Field | Type   | Description             |
| ----- | ------ | ----------------------- |
| `url` | string | URL to scrape and embed |

### Delete URL

```http theme={null}
DELETE /api/bots/:id/urls/:urlId
```

***

## Bot Tools

### List Tools

```http theme={null}
GET /api/bots/:id/tools
```

### Attach Tool

```http theme={null}
POST /api/bots/:id/tools
```

| Field    | Type   | Description              |
| -------- | ------ | ------------------------ |
| `toolId` | number | ID of the tool to attach |

### Remove Tool

```http theme={null}
DELETE /api/bots/:botId/tools/:toolId
```

***

## Bot Webhooks

### List Webhooks

```http theme={null}
GET /api/bots/:id/webhooks
```

### Add Webhook

```http theme={null}
POST /api/bots/:id/webhooks
```

### Update Webhook

```http theme={null}
PATCH /api/bots/:id/webhooks/:webhookId
```
