Send a message from your org's bot to one chat room
Delivers text, attachments and actions to one room on a connected chat transport — discord, slack, teams or telegram — and answers that transport's own…
POST /v1/channels/{channel}/send
| Address | https://api.hanzo.ai/v1/channels/{channel}/send |
| Method | POST |
| Operation | post_channels_by_channel_send |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Delivers text, attachments and actions to one room on a connected chat transport — discord, slack, teams or telegram — and answers that transport's own receipt, the messageId it assigned and the Unix second it landed. An unknown channel is a 404.
The body is the envelope's NARROW outbound projection: room, text, attachments, actions, replyTo and idempotency, and nothing else. Identity is not a field — the channel is the path segment and the sender is the caller's validated org — so a body carrying sender, account or channel is refused with 400 rather than having it silently dropped. room.id is required, and so is something to say: text, or at least one attachment.
Requires a validated principal; 403 without one. The room must already belong to the caller's org — each transport verifies the binding itself, so a room this org has not bound is 403 and a room whose route the bot has never learned is 409, meaning someone has to message the bot there first. A transport that fails answers 502 carrying status and shape only, never a token.
Sending is at-most-once only if you ask for it: pass an idempotency string and a replay answers 200 with the PRIOR receipt instead of sending twice, while a send that fails releases the key so the caller can re-attempt. Bodies over 1 MiB are refused. All four transports currently render text only, so attachments and actions are flattened deterministically to one line each after the text rather than dropped.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
channel | path | string | yes |
Response
The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.
Examples
hanzo channels send <channel>import { Configuration, ChannelsApi } from 'hanzoai';
const api = new ChannelsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postChannelsByChannelSend({ channel: 'channel' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ChannelsApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ChannelsApi(client).post_channels_by_channel_send(channel='channel')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ChannelsAPI.PostChannelsByChannelSend(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, channels_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = channels_api::post_channels_by_channel_send(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ChannelsApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new ChannelsApi(client).postChannelsByChannelSend();curl -X POST https://api.hanzo.ai/v1/channels/<channel>/send \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches channels through the channels tool, which names its 7 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
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"
}
}
}'How is this guide?