Skip to main content
Channels

チャネルの作成

Identity と Template に紐づく外部 IM チャネルを作成します。

POST /api/v1/forward/channels 外部メッセージングプラットフォーム向けのチャネルインスタンスを作成します。チャネルは受信 IM メッセージを受け取り、設定されたプロバイダーを通じて返信を送信します。

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT または SAT>
Content-TypeYesapplication/json
Idempotency-KeyNo安全でないリクエスト向けの任意のべき等性キー。

Body parameters

ParameterTypeRequiredDescription
identity_idstring条件必須fixed モードでは必須;pairing モードでは不要。
identity_resolution.modestringいいえIdentity 解決モード:fixed(デフォルト)または pairing
template_idstring条件必須fixed モードでは必須;pairing モードでは不要。
channel_typestringYesチャネルタイプ。wechatwecomfeishudingtalk をサポートし、Global では teams も利用できます。
namestringNoチャネルの表示名。
channel_config.credentialsobjectConditionalチャネルの実行時認証情報。QR 認可チャネルでは省略できます。直接認証情報を使うチャネルはプロバイダー固有のフィールドを使用します。feishuapp_id/app_secretdingtalkclient_id/client_secretwecombot_id/secretteamsapp_id/tenant_id/client_secret を使用します。認証情報は平文では返されません。
channel_config.response_optionsobjectNo返信の表示設定。

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 モードではトランスポート接続のみを作成し、Identity や 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
idstringチャネル ID。プレフィックスの例は channel_ です。
typestring常に channel
identity_idstring|nullfixed モードではバインドされた Forward Identity ID;pairing モードでは null
identity_resolution.modestringIdentity 解決モード:fixed または pairing
template_idstring|nullfixed モードではバインドされた Forward Template ID;pairing モードでは null
channel_typestring外部チャネルタイプ。
enabledboolean手動での有効化・無効化スイッチ。
binding_statusstringunboundbound、または expired
channel_config.response_optionsobject返信の表示設定。

Error codes

HTTPTypeTrigger
400invalid_request_errorチャネルタイプがサポートされていません。
400invalid_request_error必要な認証情報が不足しています。
400invalid_request_errorIdentity 解決モードと identity_id/template_id の組み合わせが一致しません。
401authentication_errorPAT または SAT が無効または期限切れです。
403permission_errorチャネル数がクォータの上限を超えています。
404not_found_errorTemplate が存在しないか、参照できません。
404not_found_errorIdentity が存在しないか、参照できません。
409conflict_errorIdentity が無効になっています。
409conflict_error認証情報の検証に失敗しました(競合)。
502api_errorチャネルサービスが利用できません。

Notes

  • 新規チャネルはデフォルトで enabled=true になります。
  • チャネルが受信メッセージを処理できるのは、enabled=true かつ binding_status="bound" の場合のみです。
  • 受信処理を一時的に停止するには、Update Channel で enabled=false を指定することをおすすめします。
  • fixed モードでは作成時に指定した Identity と Template を常に使用します。
  • pairing モードでは Channel はトランスポート接続のみを表し、Identity と Template は Pairing API によってメッセージスコープごとにバインドされます。
  • Identity 解決モードは作成後に変更できません。