Turns one pending pairing code into a standing allow entry, so that person can…
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/channels/pairing/approve
| Address | https://api.hanzo.ai/v1/channels/pairing/approve |
| Method | POST |
| Operation | post_channels_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 or telegram. |
code | body | string | — | Code is the pairing code from GET /v1/channels/pairing. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | pairingApproved | ok |
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 channels pairing approveimport { Configuration, ChannelsApi } from 'hanzoai';
const api = new ChannelsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postChannelsPairingApprove({ channel: "<channel>", code: "<code>" });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_pairing_approve(channel="<channel>", code="<code>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ChannelsAPI.PostChannelsPairingApprove(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_pairing_approve(&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).postChannelsPairingApprove();curl -X POST https://api.hanzo.ai/v1/channels/pairing/approve \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "<channel>",
"code": "<code>"
}'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?