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

Addresshttps://api.hanzo.ai/v1/channel/pairing/approve
MethodPOST
Operationpost_channel_pairing_approve
AuthAuthorization: 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).

FieldInTypeRequiredDescription
channelbodystring—Channel is the transport the request came in on: discord, slack, teams, telegram or whatsapp.
codebodystring—Code is the pairing code from GET /v1/channel/pairing.

Response

StatusBodyMeaning
200channel.pairingApprovedok
defaultproblem-detailsrefused

200 body — 2 fields.

FieldInTypeAlwaysDescription
ownerBootstrappedbodyboolean—OwnerBootstrapped is true when this approval was the org's FIRST on the channel and therefore also made the sender its owner.
senderbodystring—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 approve
import { 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();
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 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:

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"
         }
       }
     }'

Channel API · All Hanzo APIs · Interactive reference

Was this page useful?