All Products
Search
Document Center

Qoder CN Series:Create a channel

Last Updated:Jul 15, 2026

Create an external IM channel bound to an Identity and Template.

Request headers

Header

Required

Description

Authorization

Yes

Bearer <PAT>

Content-Type

Yes

application/json

Idempotency-Key

No

Optional idempotency key for unsafe requests.

Request body

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. Supported values: wechat, wecom, feishu, and dingtalk.

name

string

No

Channel display name.

channel_config.credentials

object

Conditional

Required for token or app-credential channels. QR authorization channels may omit it and activate later.

channel_config.response_options

object

No

Reply visibility settings.

Example request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/channels' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "identity_id": "idn_019eabc123",
    "template_id": "tmpl_support",
    "channel_type": "feishu",
    "name": "Support Feishu channel",
    "channel_config": {
      "credentials": {
        "app_key": "...",
        "app_secret": "..."
      },
      "response_options": {
        "include_tool_calls": false,
        "include_thinking": false
      }
    }
  }'

Example response

HTTP 201 Created

{
  "id": "ci_019eabc123",
  "type": "channel",
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_support",
  "channel_type": "feishu",
  "name": "Support Feishu channel",
  "enabled": true,
  "binding_status": "bound",
  "channel_config": {
    "response_options": {
      "include_tool_calls": false,
      "include_thinking": false
    }
  },
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:00:00Z"
}

Response fields

Field

Type

Description

id

string

Channel ID. Example prefix is ci_.

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.

401

authentication_error

TOKEN_INVALID

PAT is invalid or expired.

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

  • user_id is derived internally from authentication and is never exposed.

  • New channels default to enabled=true.

  • A channel can process inbound messages only when enabled=true and binding_status="bound".

  • Deleting or archiving channels is not supported. Disable a channel via Update channel instead.