Approve pairing
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.
POST /v1/channel/pairing/approve
| Address | https://api.hanzo.ai/v1/channel/pairing/approve |
| Method | POST |
| Operation | post_channel_pairing_approve |
| Auth | Authorization: Bearer $HANZO_API_KEY |
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. It requires ORG ADMIN, not merely membership. The first approval an org makes on a channel also bootstraps that sender as the channel's owner, which the answer reports. An unknown or expired code is a 404, and a code always belongs to exactly one org, so it can never approve someone into another tenant.
Request
2 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
channel | body | string | — | Channel is the transport the request came in on: discord, slack, teams, telegram or whatsapp. |
code | body | string | — | Code is the pairing code from GET /v1/channel/pairing. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | channel.pairingApproved | ok |
default | problem-details | refused |
200 body — 2 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
ownerBootstrapped | body | boolean | — | OwnerBootstrapped is true when this approval was the org's FIRST on the channel and therefore also made the sender its owner. |
sender | body | string | — | Sender is the external chat identity that is now allowed to DM the org's bot. |
Failure carries the platform error shape — see Errors.
Examples
hanzo channel pairing approveimport { Configuration, ChannelApi } from 'hanzoai';
const api = new ChannelApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postChannelPairingApprove({ channel: "<channel>", code: "<code>" });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_pairing_approve(channel="<channel>", code="<code>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.ChannelAPI.PostChannelPairingApprove(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_pairing_approve(&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).postChannelPairingApprove();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/pairing/approve \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "<channel>",
"code": "<code>"
}'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?