PUT /api/template-channels/{templateId}/{channelId} Update the content object for an existing template-channel record. This changes what gets delivered through this channel when the parent template is used.

Headers

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

Path parameters

templateId
string
required
The template ID.
channelId
string
required
The channel ID.

Request body

content
object
required
The updated per-channel content object. Use {{variableName}} placeholders for dynamic values.

Example request

curl -X PUT https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/template-channels/665b2c3d4e5f6a7b8c9d0e1f/664a1b2c3d4e5f6a7b8c9d0e \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": {
      "title": "Hi {{customerName}}!",
      "body": "Order {{orderId}} is on its way.",
      "actionUrl": "{{trackingUrl}}"
    }
  }'

Example response

{
  "templateId": "665b2c3d4e5f6a7b8c9d0e1f",
  "channelId": "664a1b2c3d4e5f6a7b8c9d0e",
  "channelType": "in_app",
  "content": {
    "title": "Hi {{customerName}}!",
    "body": "Order {{orderId}} is on its way.",
    "actionUrl": "{{trackingUrl}}"
  },
  "createdAt": "2024-01-15T09:30:00.000Z",
  "updatedAt": "2024-01-16T10:00:00.000Z"
}
Updating template-channel content does not affect notifications that have already been sent. Only future sends use the updated content.