Use a pairing code or pending pairing record ID to bind an Identity and Template to a Channel message scope.
POST /api/v1/forward/channel_pairings
Only applicable to Channels with identity_resolution.mode=pairing.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Content-Type | Yes | application/json |
Idempotency-Key | No | Client-generated unique idempotency key for safe retries. |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | One of two | Valid pairing code displayed in the Channel message. Provide exactly one of code and channel_pairing_id. |
channel_pairing_id | string | One of two | The id returned by List channel pairings. ID-based authorization is not affected by pairing code expiration. |
identity_id | string | Yes | Forward Identity ID to bind. |
template_id | string | Yes | Forward Template ID to bind. |
Example request
Example response
HTTP 200 OK
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Pairing ID, used for list, detail, and unpair operations. Schedule sinks reference it through channel_pairing_id. |
type | string | Always channel_pairing. |
channel_id | string | Channel ID. |
scope_type | string | Pairing scope: direct for a private-chat user, or room for a group chat. |
scope_external_id | string | External user or group ID for the scope. |
scope_display_name | string | User nickname or group name; an empty string if unavailable. For display only, not for authorization. |
identity_id | string | Bound Forward Identity ID. |
template_id | string | Bound Forward Template ID. |
status | string | active on successful pairing. |
paired_at | string | Pairing completion time. |
Error codes
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | The request does not provide exactly one of code and channel_pairing_id, the code is invalid or expired, or the Channel is not in pairing mode. |
| 401 | authentication_error | PAT or SAT is invalid or expired. |
| 404 | not_found_error | Pair, Channel, Identity, or Template does not exist or is not visible to the caller. |
| 409 | conflict_error | Pair is already bound to a different Identity or Template, or has been unpaired. |
Notes
- The caller must have management permissions for the corresponding Channel.
- Rebinding the same Identity and Template succeeds. To modify an existing binding, use Update a channel pairing.
- If the pairing code has been used but binding has not completed, retrieve the Pair ID from List channel pairings and retry.
- Messages sent before pairing succeeds are not replayed automatically. Send them again.

