Skip to main content
Channels

Create a channel

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

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

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>
Content-TypeYesapplication/json
Idempotency-KeyNoOptional idempotency key for unsafe requests.

Body parameters

ParameterTypeRequiredDescription
identity_idstringConditionalRequired for fixed mode; omit for pairing mode.
identity_resolution.modestringNoIdentity resolution mode: fixed (default) or pairing.
template_idstringConditionalRequired for fixed mode; omit for pairing mode.
channel_typestringYesChannel type. Currently supports wechat, wecom, feishu, and dingtalk.
namestringNoChannel display name.
channel_config.credentialsobjectConditionalChannel 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_optionsobjectNoReply visibility settings.

Example request

curl -s -X POST 'https://api.qoder.com/api/v1/forward/channels' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "identity_id": "idn_019eabc123",
    "identity_resolution": {
      "mode": "fixed"
    },
    "template_id": "tmpl_support",
    "channel_type": "feishu",
    "name": "Support Feishu channel",
    "channel_config": {
      "credentials": {
        "app_id": "...",
        "app_secret": "..."
      },
      "response_options": {
        "include_tool_calls": false,
        "include_thinking": false
      }
    }
  }'
pairing mode creates only the transport connection without specifying an Identity or Template:
{
  "identity_resolution": {
    "mode": "pairing"
  },
  "channel_type": "feishu",
  "name": "Support Feishu channel"
}

Example response

HTTP 201 Created
{
  "id": "channel_019eabc123",
  "type": "channel",
  "identity_id": "idn_019eabc123",
  "identity_resolution": {
    "mode": "fixed"
  },
  "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

FieldTypeDescription
idstringChannel ID. Example prefix is channel_.
typestringAlways channel.
identity_idstring|nullBound Forward Identity ID in fixed mode; null in pairing mode.
identity_resolution.modestringIdentity resolution mode: fixed or pairing.
template_idstring|nullBound Forward Template ID in fixed mode; null in pairing mode.
channel_typestringExternal channel type.
enabledbooleanManual enable or disable switch.
binding_statusstringunbound, bound, or expired.
channel_config.response_optionsobjectReply visibility settings.

Error codes

HTTPTypeTrigger
400invalid_request_errorChannel type is unsupported.
400invalid_request_errorIdentity resolution mode does not match identity_id/template_id combination.
400invalid_request_errorRequired credentials are missing.
401authentication_errorPAT or SAT is invalid or expired.
403permission_errorChannel quota exceeded.
404not_found_errorTemplate does not exist or is not visible.
404not_found_errorIdentity does not exist or is not visible.
409conflict_errorIdentity is disabled.
409conflict_errorCredential validation conflict.
502api_errorChannel service unavailable.

Notes

  • New channels default to enabled=true.
  • A channel can process inbound messages only when enabled=true and binding_status="bound".
  • fixed mode always uses the Identity and Template specified at creation time.
  • pairing mode means the channel is only a transport connection; Identity and Template are bound per message scope via the Pairing API.
  • identity_resolution.mode cannot be changed after creation.
  • To pause inbound processing temporarily, prefer Update Channel with enabled=false.