GET /api/template-channels?templateId=xxx Returns all template-channel records for a given template. Each record contains the per-channel content that gets delivered through that channel.

Headers

appid
string
required
Your CometChat App ID.
apikey
string
required
Your CometChat API Key.

Query parameters

templateId
string
required
The template ID to list channels for.

Example request

curl "https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/template-channels?templateId=665b2c3d4e5f6a7b8c9d0e1f" \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY"

Example response

[
  {
    "templateId": "665b2c3d4e5f6a7b8c9d0e1f",
    "channelId": "664a1b2c3d4e5f6a7b8c9d0e",
    "channelType": "in_app",
    "content": {
      "title": "Hello {{customerName}}",
      "body": "Your order {{orderId}} has been confirmed."
    },
    "createdAt": "2024-01-15T09:30:00.000Z",
    "updatedAt": "2024-01-15T09:30:00.000Z"
  }
]

Response fields

templateId
string
The parent template ID.
channelId
string
The linked channel ID.
channelType
string
Channel type: in_app, push, sms, email, whatsapp, or custom.
content
object
The per-channel content object. Structure varies by channel type.
createdAt
string
ISO 8601 creation timestamp.
updatedAt
string
ISO 8601 last update timestamp.