POST /api/v1/forward/channels
Creates a channel instance for an external messaging platform. The channel receives inbound IM messages and sends replies through the configured provider.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> |
Content-Type | Yes | application/json |
Idempotency-Key | No | Optional idempotency key for unsafe requests. |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
identity_id | string | Yes | Forward Identity ID. Must belong to the caller and be enabled. |
template_id | string | Yes | Forward Template ID used when the channel creates sessions. |
channel_type | string | Yes | Channel type. Currently supports wechat, wecom, feishu, and dingtalk. |
name | string | No | Channel display name. |
channel_config.credentials | object | Conditional | Channel runtime credentials. QR authorization channels may omit it. Direct credential channels use provider-specific fields: feishu uses app_id/app_secret, dingtalk uses client_id/client_secret, and wecom uses bot_id/secret. Credentials are not returned in plaintext. |
channel_config.response_options | object | No | Reply visibility settings. |
Example request
Example response
HTTP 201 CreatedResponse fields
| Field | Type | Description |
|---|---|---|
id | string | Channel ID. Example prefix is channel_. |
type | string | Always channel. |
identity_id | string | Bound Forward Identity ID. |
template_id | string | Bound Forward Template ID. |
channel_type | string | External channel type. |
enabled | boolean | Manual enable or disable switch. |
binding_status | string | unbound, bound, or expired. |
channel_config.response_options | object | Reply visibility settings. |
Errors
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 400 | invalid_request_error | channel_type_unsupported | Channel type is unsupported. |
| 404 | not_found_error | channel_template_not_found | Template does not exist or is not visible. |
| 404 | not_found_error | channel_identity_not_found | Identity does not exist or is not visible. |
| 409 | conflict_error | channel_identity_disabled | Identity is disabled. |
| 409 | conflict_error | channel_auth_required | Required credentials or QR authorization are missing. |
| 502 | api_error | channel_auth_failed | Underlying channel authorization failed. |
Notes
- New channels default to
enabled=true. - A channel can process inbound messages only when
enabled=trueandbinding_status="bound". - To pause inbound processing temporarily, prefer Update Channel with
enabled=false.