Approve pairing
Turns one pending pairing code into a standing allow entry, so that person can DM the org's bot on that transport from now on.
POST /v1/transport/pairing/approve
| Address | https://api.hanzo.ai/v1/transport/pairing/approve |
| Method | POST |
| Operation | post_transport_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 transport from now on. It requires ORG ADMIN, not merely membership. The first approval an org makes on a transport also bootstraps that sender as the transport'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 |
|---|---|---|---|---|
code | body | string | — | Code is the pairing code from GET /v1/transport/pairing. |
transport | body | string | — | Transport is the transport the request came in on: discord, slack, teams, telegram or whatsapp. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | transport.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 transport 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 transport pairing approveimport { Configuration, TransportApi } from 'hanzoai';
const api = new TransportApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postTransportPairingApprove({ code: "<code>", transport: "<transport>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TransportApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TransportApi(client).post_transport_pairing_approve(code="<code>", transport="<transport>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.TransportAPI.PostTransportPairingApprove(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, transport_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = transport_api::post_transport_pairing_approve(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TransportApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new TransportApi(client).postTransportPairingApprove();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were 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/transport/pairing/approve \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "<code>",
"transport": "<transport>"
}'MCP reaches transport through the transport 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_transports"
}
}
}'