Skip to main content
POST
/
templates
Create a new template
curl --request POST \
  --url https://{appId}.api-{region}.cometchat.io/v3/campaigns/templates \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --header 'appid: <appid>' \
  --data '
{
  "name": "<string>",
  "channels": [
    {
      "channelType": "<string>",
      "channelId": "<string>",
      "content": {},
      "categoryFilterEnabled": true,
      "templateLabelEnabled": true,
      "messageRetentionHours": 123,
      "sequenceOrder": 123,
      "stopCondition": "<string>"
    }
  ],
  "templateId": "<string>",
  "label": "<string>",
  "alternativeText": "<string>",
  "tags": [
    "<string>"
  ],
  "variableSchema": [
    {}
  ],
  "config": {}
}
'

Documentation Index

Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

apikey
string
header
required

Your CometChat REST API Key.

Headers

appid
string
required

Tenant application ID

Body

application/json
name
string
required

Template name

channels
object[]
required

Channel configurations

templateId
string

Human-readable slug (auto-generated from name if omitted)

templateCategory
enum<string>

Template category

Available options:
Onboarding,
Transactional,
Marketing,
Product_Showcase,
Alerts,
Polls,
Custom
label
string

Display label shown on notification (e.g. Promo, Alert)

alternativeText
string

Plain-text fallback when push is suppressed or rich content cannot render. Sendbird-parity field.

tags
string[]

First-class tags for filtering/segmentation

status
enum<string>

Template status

Available options:
draft,
approved,
archived
variableSchema
object[]

Variable schema definitions

config
object

Additional configuration

Response

Template created