> ## 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.

# Channels

> Connect and manage messaging channels — WhatsApp, Gmail, Twitter, Web

All endpoints require authentication.

## Endpoints

### List Channels

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

***

### Create Channel

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

**Body**

| Field         | Type   | Required | Description                                       |
| ------------- | ------ | -------- | ------------------------------------------------- |
| `name`        | string | Yes      | Label for the channel                             |
| `type`        | string | Yes      | `whatsapp`, `gmail`, `twitter`, `web`, `telegram` |
| `apiKey`      | string | Depends  | API key from your WhatsApp provider               |
| `accessToken` | string | Depends  | OAuth access token (Gmail, Twitter)               |

***

### Get Channel

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

***

### Update Channel

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

***

### Delete Channel

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

<Warning>Deleting a channel removes it from all associated bots.</Warning>

***

## WhatsApp — Send Message

```http theme={null}
POST /api/whatsapp/send
```

**Body**

| Field       | Type   | Description                                        |
| ----------- | ------ | -------------------------------------------------- |
| `to`        | string | Recipient phone number (with country code, no `+`) |
| `message`   | string | Message text                                       |
| `channelId` | number | The WhatsApp channel to send from                  |

***

### Send Image

```http theme={null}
POST /api/whatsapp/send-image
```

| Field       | Type   | Description                   |
| ----------- | ------ | ----------------------------- |
| `to`        | string | Recipient phone number        |
| `imageUrl`  | string | Publicly accessible image URL |
| `caption`   | string | Optional caption              |
| `channelId` | number | Channel to send from          |

***

### List Templates

```http theme={null}
GET /api/whatsapp/templates
```

Returns approved WhatsApp message templates for the linked account.

***

### Health Check

```http theme={null}
GET /api/whatsapp/health
```

Returns connectivity status of the WhatsApp integration.
