Send channel
Delivers text, attachments and actions to one room on a connected chat transport — discord, github, linear, slack, teams, telegram or whatsapp — and…
POST /v1/channel/{channel}/send
| Address | https://api.hanzo.ai/v1/channel/{channel}/send |
| Method | POST |
| Operation | post_channel_by_channel_send |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Delivers text, attachments and actions to one room on a connected chat transport — discord, github, linear, slack, teams, telegram or whatsapp — 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; 401 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 route learned only so a pairing reply could be delivered lasts exactly as long as that pairing request does, so a room whose sender was never approved goes back to 409 within the hour. 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. Every transport currently renders 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 channel send <channel>import { Configuration, ChannelApi } from 'hanzoai';
const api = new ChannelApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postChannelByChannelSend({ channel: 'channel' });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).post_channel_by_channel_send(channel='channel')cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.ChannelAPI.PostChannelByChannelSend(context.Background()).Execute()
if err != nil {
return err
}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::post_channel_by_channel_send(&cfg, Default::default()).await?;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).postChannelByChannelSend();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X POST https://api.hanzo.ai/v1/channel/<channel>/send \
-H "Authorization: Bearer $HANZO_API_KEY"MCP reaches channel through the channels tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP 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?