Skip to main content
Channels

Channel のペアリング

ペアリングコードまたはペアリング待ちのレコード ID を使用して、Channel メッセージスコープに Identity と Template をバインドします。

POST /api/v1/forward/channel_pairings identity_resolution.mode=pairing の Channel にのみ適用されます。

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT または SAT>
Content-TypeYesapplication/json
Idempotency-KeyNo安全なリトライのためのクライアント生成のべき等性キー。

Body parameters

ParameterTypeRequiredDescription
codestringいずれか一方Channel メッセージに表示された有効なペアリングコード。codechannel_pairing_id のどちらか一方のみを指定します。
channel_pairing_idstringいずれか一方ペアリングの一覧で返される id。ID による認可はペアリングコードの有効期限に影響されません。
identity_idstringYesバインドする Forward Identity ID。
template_idstringYesバインドする Forward Template ID。

Example request

curl -s -X POST 'https://api.qoder.com/api/v1/forward/channel_pairings' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pairing-K7MP92" \
  -d '{
    "code": "K7MP92",
    "identity_id": "idn_019eabc123",
    "template_id": "tmpl_workspace_dev"
  }'
同じエンドポイントと認証を使用して、ID でもペアリングを完了できます:
{
  "channel_pairing_id": "pair_019eabc123",
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_workspace_dev"
}

Example response

HTTP 200 OK
{
  "id": "pair_019eabc123",
  "type": "channel_pairing",
  "channel_id": "channel_019eabc123",
  "scope_type": "direct",
  "scope_external_id": "external_user_id",
  "scope_display_name": "テストユーザー",
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_workspace_dev",
  "status": "active",
  "paired_at": "2026-07-16T10:00:00Z"
}

Response fields

FieldTypeDescription
idstringPairing ID。一覧、詳細取得、ペアリング解除に使用します。Schedule の Sink は channel_pairing_id でこの値を参照します。
typestring常に channel_pairing
channel_idstringChannel ID。
scope_typestringペアリングスコープ。direct は個人チャットのユーザー、room はグループチャット。
scope_external_idstringスコープに対応する外部ユーザー ID またはグループ ID。
scope_display_namestringユーザーのニックネームまたはグループ名。取得できない場合は空文字列です。表示専用で、認可の判断には使用しません。
identity_idstringバインドされた Forward Identity ID。
template_idstringバインドされた Forward Template ID。
statusstringペアリング成功時は active
paired_atstringペアリング完了時刻。

HTTP エラーコード

HTTPType発生条件
400invalid_request_errorパラメータの不足、形式の不正、未知のフィールド、無効なペアリングコード(使用済みを含む)や期限切れ、または Channel が pairing モードではない場合。
401authentication_errorPAT または SAT が無効または期限切れの場合。
403permission_errorAPI の呼び出し権限がない場合。
404not_found_errorPair、Channel、Identity、Template が存在しないかアクセス不可、または Channel がアーカイブ済みの場合。
409conflict_errorバインド先の競合、Pair が解除済み、Identity が無効化済み、または同時アクティブ化の競合。ID でペアリングする場合は、Channel が有効化されていないか、バインドされていない場合も該当します。

Notes

  • 再試行には channel_pairing_id を使用してください。リソースが利用可能で Pair が解除されていなければ、同じバインディングはべき等に成功します。使用済みまたは期限切れのコードで再ペアリングすることはできません。
  • バインディングの変更にはペアリングの更新を使用してください。
  • ペアリング成功前に送信したメッセージは自動的には再送されません。再度送信してください。

関連 API