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. Authorization by ID is unaffected 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 listing, retrieval, and unpairing. Schedule sinks reference this value 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, never 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. |
HTTP error codes
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Parameters are missing, malformed, or include unknown fields; the pairing code is invalid (including already used) or expired; or the Channel is not in pairing mode. |
| 401 | authentication_error | PAT or SAT is invalid or expired. |
| 403 | permission_error | The caller does not have permission to invoke the API. |
| 404 | not_found_error | Pair, Channel, Identity, or Template does not exist or is inaccessible, or the Channel is archived. |
| 409 | conflict_error | The binding target conflicts, the Pair has been unpaired, the Identity is disabled, or concurrent activation conflicts. When pairing by ID, the Channel is not enabled or not bound. |
Notes
- Use
channel_pairing_idfor retries. The same binding succeeds idempotently when the resources are available and the Pair has not been unpaired. Used or expired pairing codes cannot be used to pair again. - To change a binding, use Update a channel pairing.
- Messages sent before pairing succeeds are not replayed automatically. Send them again.

