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

# Channels

> Connect your agent to Telegram, Discord, Slack, WhatsApp, and more. One API call per channel.

# Channels

Channels are messaging platforms wired into your agent. Connect Telegram, and people can DM your bot. Connect Discord, and it joins your server. Connect WhatsApp, and it shows up on someone's phone.

One instance can have multiple channels running simultaneously. Your agent on Telegram, Discord, and Slack — all at once, all from the same instance.

## How channels work

The flow is straightforward:

<Steps>
  <Step title="You call the connect endpoint">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    curl -X POST https://api.chowder.dev/v1/instances/{id}/channels/telegram/connect \
      -H "Authorization: Bearer $CHOWDER_KEY" \
      -H "Content-Type: application/json" \
      -d '{"config": {"token": "123456:ABC-DEF..."}}'
    ```
  </Step>

  <Step title="Chowder writes the config">
    Your credentials are written into the OpenClaw configuration file inside the sandbox. The channel is marked as enabled with a default DM policy.
  </Step>

  <Step title="Gateway restarts">
    The gateway process restarts to pick up the new channel config. This takes a few seconds.
  </Step>

  <Step title="Channel is live">
    Your agent is now reachable on that platform. People can message it and get responses.
  </Step>
</Steps>

## Two types of channels

<Tabs>
  <Tab title="Token-based">
    Most channels are token-based. You create a bot on the platform, get a token (or set of tokens), and pass them to Chowder. That's it.

    **Token-based channels:** Telegram, Discord, Slack, Google Chat, Signal, Matrix, Microsoft Teams, Mattermost, Nostr, LINE

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    # Example: Discord
    curl -X POST https://api.chowder.dev/v1/instances/{id}/channels/discord/connect \
      -H "Authorization: Bearer $CHOWDER_KEY" \
      -H "Content-Type: application/json" \
      -d '{"config": {"token": "your-discord-bot-token"}}'
    ```
  </Tab>

  <Tab title="Interactive">
    Some channels require an interactive setup — like scanning a QR code. You call the connect endpoint, and instead of an immediate "connected" response, you get back a QR code to scan.

    **Interactive channels:** WhatsApp

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    # WhatsApp returns a QR code
    curl -X POST https://api.chowder.dev/v1/instances/{id}/channels/whatsapp/connect \
      -H "Authorization: Bearer $CHOWDER_KEY"

    # Response:
    # {
    #   "channel": "whatsapp",
    #   "status": "awaiting_scan",
    #   "qr_data": "2@abc...",
    #   "qr_image_base64": "iVBOR..."
    # }
    ```

    Scan the QR with your phone, and the channel goes live.
  </Tab>
</Tabs>

## Supported channels

Here's the full list, with what you need for each one:

| Channel         | Type        | Required fields                                |
| --------------- | ----------- | ---------------------------------------------- |
| **Telegram**    | Token       | `token` — bot token from BotFather             |
| **Discord**     | Token       | `token` — Discord bot token                    |
| **Slack**       | Token       | `bot_token` (xoxb-...), `app_token` (xapp-...) |
| **WhatsApp**    | Interactive | None — scan the QR code                        |
| **Google Chat** | Token       | `audience_type`, `audience`                    |
| **Signal**      | Token       | `account` — phone number in E.164 format       |
| **Matrix**      | Token       | `homeserver`, `user_id`, `access_token`        |
| **MS Teams**    | Token       | `app_id`, `app_password`, `tenant_id`          |
| **Mattermost**  | Token       | `bot_token`, `base_url`                        |
| **Nostr**       | Token       | None — uses auto-generated keys                |
| **LINE**        | Token       | `channel_access_token`, `channel_secret`       |

## DM policy and pairing

By default, channels use a **pairing** DM policy. This means unknown users who message your bot get a pairing code, and you have to approve them before they can chat.

This is a security feature — it prevents random people from using your agent (and burning your API credits).

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
# Approve a pairing code
curl -X POST https://api.chowder.dev/v1/instances/{id}/channels/telegram/pair \
  -H "Authorization: Bearer $CHOWDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code": "ABC123"}'
```

<Tip>
  The pairing code is shown to the user when they first message the bot. They send it to you (or your admin panel), you approve it, and they're in.
</Tip>

## Managing channels

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
# List all channels and their status
curl https://api.chowder.dev/v1/instances/{id}/channels \
  -H "Authorization: Bearer $CHOWDER_KEY"

# Check a specific channel
curl https://api.chowder.dev/v1/instances/{id}/channels/telegram/status \
  -H "Authorization: Bearer $CHOWDER_KEY"

# Disconnect a channel
curl -X POST https://api.chowder.dev/v1/instances/{id}/channels/telegram/disconnect \
  -H "Authorization: Bearer $CHOWDER_KEY"
```

Disconnecting disables the channel in the config and restarts the gateway. The bot goes offline on that platform but your credentials are preserved (just marked as disabled).

<Accordion title="Can I connect the same platform twice?">
  No. Each channel type can only be connected once per instance. If you need two Telegram bots, create two instances.
</Accordion>

<Accordion title="What happens to channels when I stop an instance?">
  Channels go offline when the instance stops (the gateway shuts down). When you start it again, channels reconnect automatically — assuming your tokens haven't been revoked on the platform side.
</Accordion>

<Accordion title="Can I change the DM policy?">
  Yes. You can pass additional config when connecting a channel, or update the instance's OpenClaw config directly via `PATCH /v1/instances/{id}` with the appropriate `openclaw_config` values. Supported policies depend on the OpenClaw version.
</Accordion>
