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

# lua channels

> The agent's channels and phone numbers: list them non-interactively, link five channel types and manage numbers from the menu

`lua channels` lists the [channels](/concepts/channels) an agent answers on and, from its menu, links new ones or manages the organization's phone numbers. Linking a channel changes where end users can reach the agent right away.

*Verified against lua-cli 3.33.0.*

## Synopsis

```bash theme={null}
lua channels [list]
lua channels
```

## Description

`list` is the only non-interactive action and the command's only argument; the command takes no flags. Run bare, it offers four menu items: **List channels** (pick one for its type-specific details), **Link new channel**, **Manage phone numbers**, and **Link on admin dashboard**, which opens the [admin dashboard](/get-started/for-operators) for the agent.

The CLI creates five channel types: WhatsApp, Facebook Messenger, email, Slack (private, by bot token) and Slack (public, an OAuth app). Every other channel, Instagram and Microsoft Teams among them, is set up outside the CLI; the [channel guides](/channels/overview) say where. The web widget needs no channel record at all.

The menu and every creation flow prompt for each value, and tokens are masked as you type. They are not usable under `--ci`: only `list` is. A channel that is already linked is refused with `✖ http_400: Channel already exists` (exit 10) and a hint naming the channel.

## Arguments

| Argument | Values                     | Description                                                                                  |
| -------- | -------------------------- | -------------------------------------------------------------------------------------------- |
| `action` | `list` (aliases `ls`, `l`) | Print every channel with its type, label, identifier and creation date. Omit it for the menu |

### Menu items

The menu items and what each asks for.

| Menu item                            | Description                                                                                                                                                                                                                                                         |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| List channels                        | Pick a channel to see its details: phone number, WABA id, verified name, status and quality for WhatsApp; page name, id and category for Messenger; bot name, workspace, team, app and bot ids for Slack; from address, name, template id and active flag for email |
| Link new channel: WhatsApp           | Phone number ID, WhatsApp Business Account ID, access token. Prints the number, identifier, status and the webhook URL to set in Meta                                                                                                                               |
| Link new channel: Facebook Messenger | Page access token, page ID. Prints page name, identifier, category and webhook URL                                                                                                                                                                                  |
| Link new channel: Email              | Mode `Generate new inbox` (a display name; prints the generated address) or `Use existing email` (display name and sender address; prints the address to forward your mail to)                                                                                      |
| Link new channel: Slack (Private)    | Bot token starting `xoxb-`. Prints bot name, workspace, bot id and an example app manifest                                                                                                                                                                          |
| Link new channel: Slack (Public)     | App ID, client ID, client secret. Prints the redirect URI, webhook URL, install URL `https://auth.heylua.ai/slack/install/<appId>` and an example manifest                                                                                                          |
| Manage phone numbers                 | The phone-number sub-menu in the next table; needs `orgId` in the project config                                                                                                                                                                                    |
| Link on admin dashboard              | Opens the admin dashboard in the browser and prints the agent and organization ids                                                                                                                                                                                  |

### Phone number menu

Numbers belong to the organization and are bound to one agent together with the [voice](/concepts/voice) that answers. Binding needs a pushed, active voice; without one the flow stops with `This agent has no LuaVoice.`

| Choice                          | Description                                                                                                                                                                            |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Search available numbers        | Country (ISO code, default `US`), whether end users may text the number (otherwise voice only), an optional digit pattern. Lists up to 50 numbers with type, modality and monthly cost |
| Purchase a number               | The same search, pick a number, confirm (`charges may apply`), then optionally bind it to this agent                                                                                   |
| Bind a number to this agent     | The number and the voice that answers. Prints `📞 Your agent (<agentId>) is now reachable at +<number> via voice "<name>"`                                                             |
| Unbind a number from this agent | Confirms, then detaches the number; the organization keeps it                                                                                                                          |
| List my numbers                 | Table: MSISDN, Country, Status, Modality (`voice + SMS` or `voice only`), Agent, Voice                                                                                                 |
| Release a number                | Confirms, then gives the number up. Irreversible: the organization loses ownership                                                                                                     |

## Options

None beyond the global `--ci` and `-h, --help`. Every value is entered in the menu.

## Examples

List the agent's channels in a script.

```bash theme={null}
lua channels list --ci
```

```text Output theme={null}
📡 Fetching channels for agent: baseAgent_agent_…

============================================================
📡 Agent Channels
============================================================

ℹ️  No channels configured for this agent.
💡 Use 'lua channels' (interactive) to add channels.
```

Open the menu to link a channel or manage numbers.

```bash theme={null}
lua channels
```

Call the agent on a bound number from the terminal to check the binding.

```bash theme={null}
lua voice --phone +15551234567
```

## Exit codes

| Code | Meaning                                                                         |
| ---- | ------------------------------------------------------------------------------- |
| `0`  | Success                                                                         |
| `1`  | The channel list could not be fetched (`Operation failed`)                      |
| `2`  | Unknown action                                                                  |
| `3`  | Not found (404)                                                                 |
| `9`  | Not signed in (401)                                                             |
| `10` | Forbidden (403), or a refused create such as `http_400: Channel already exists` |
| `11` | Unavailable: 5xx, connection refused, timeout                                   |
| `12` | The model provider refused the request (424)                                    |

## See also

* [Channels overview](/channels/overview) — which channel is set up where
* [WhatsApp](/channels/whatsapp), [Messenger](/channels/messenger), [Email](/channels/email), [Slack](/channels/slack) — the provider-side steps before you link
* [SMS and phone numbers](/channels/sms-and-phone-numbers) and [Voice calls](/channels/voice-calls)
* [`lua voice`](/reference/cli/voice) — test a bound number
* [`Channels`](/reference/sdk/channels) — send on a channel from code
