# Channel

URL: https://docs.hanzo.ai/docs/openapi/channel

> One inbox for the chat apps you connect — Discord, Slack, Teams, Telegram.

Also for this capability: **API** · [CLI](https://docs.hanzo.ai/docs/cli/channel) · [MCP](https://docs.hanzo.ai/docs/mcp-tools/channel) · [SDKs](https://docs.hanzo.ai/docs/sdks)

One inbox for the chat apps you connect — Discord, Slack, Teams, Telegram.

> [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|                |                                        |
| -------------- | -------------------------------------- |
| **Base URL**   | `https://api.hanzo.ai`                 |
| **Operations** | 9                                      |
| **Auth**       | `Authorization: Bearer $HANZO_API_KEY` |

## Specification

Specification pending — no HIP in [hanzoai/hips](https://github.com/hanzoai/hips) declares `capability: channel` yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

## Four surfaces

| Surface  | Reaches this capability as                      | Coverage                                                                  |
| -------- | ----------------------------------------------- | ------------------------------------------------------------------------- |
| **REST** | `channel` at its own prefix                     | 9 operations                                                              |
| **CLI**  | `hanzo channel …`                               | 9 of 9                                                                    |
| **SDK**  | `ChannelApi` in every published client          | 9 methods                                                                 |
| **MCP**  | tool `channel` on `https://api.hanzo.ai/v1/mcp` | 8 operations, 4 under the document's own id — ask `describe` for the rest |

## Quickstart

```bash
export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys
```

Then the first call — a read that needs nothing but the key. `GET /v1/channel`, operation `get_channel`:

**CLI**

```bash
hanzo channel list
```

**SDK**

**.ts**

```ts
import { Configuration, ChannelApi } from 'hanzoai';

const api = new ChannelApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getChannel();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ChannelApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ChannelApi(client).get_channel()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ChannelAPI.GetChannel(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, channel_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = channel_api::get_channel(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ChannelApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ChannelApi(client).getChannel();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/channel \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **channel** through the `channel` tool, which names its 8 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_channels"
         }
       }
     }'
```

Answers `200` with `object` — ok.

## Endpoints

| Endpoint                                                                                                      | What it does                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`POST /v1/channel/{channel}/send`](https://docs.hanzo.ai/docs/openapi/channel/post-channel-by-channel-send)  | Send a message from your org's bot to one chat room                                                                                                                                                                                                                                                         |
| [`GET /v1/channel/agent`](https://docs.hanzo.ai/docs/openapi/channel/get-channel-agent)                       | Returns which agent answers the caller org's channel: the default and every room bound to another agent.                                                                                                                                                                                                    |
| [`PUT /v1/channel/agent`](https://docs.hanzo.ai/docs/openapi/channel/put-channel-agent)                       | Binds agents to the caller org's channel and answers the bindings as GET would.                                                                                                                                                                                                                             |
| [`GET /v1/channel/allowlist`](https://docs.hanzo.ai/docs/openapi/channel/get-channel-allowlist)               | Returns the caller org's access policy for one channel: whether DMs are pairing-gated, allowlisted or open, whether group rooms are open, allowlisted or disabled, the config-managed DM and group allow entries, the senders approved through PAIRING (read-only here), and the org's named access groups. |
| [`PUT /v1/channel/allowlist`](https://docs.hanzo.ai/docs/openapi/channel/put-channel-allowlist)               | Edits the caller org's access policy for one channel and answers the policy as GET would, so both verbs return ONE shape.                                                                                                                                                                                   |
| [`GET /v1/channel/inbox`](https://docs.hanzo.ai/docs/openapi/channel/get-channel-inbox)                       | Returns the messages people have sent to the caller org's connected chat bots, oldest first, in the portable envelope shape every transport normalises into.                                                                                                                                                |
| [`POST /v1/channel/pairing/approve`](https://docs.hanzo.ai/docs/openapi/channel/post-channel-pairing-approve) | Turns one pending pairing code into a standing allow entry, so that person can DM the org's bot on that channel from now on.                                                                                                                                                                                |
| [`GET /v1/channel/pairing`](https://docs.hanzo.ai/docs/openapi/channel/get-channel-pairing)                   | Returns the pairing requests waiting for the caller org to approve — one per person who messaged a connected bot on a channel whose DM policy is "pairing" and who is not allowed yet.                                                                                                                      |
| [`GET /v1/channel`](https://docs.hanzo.ai/docs/openapi/channel/get-channel)                                   | Reports every chat channel this org can send through, and whether it can send through it right now.                                                                                                                                                                                                         |

---

[All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
