Skip to main content
POST
/
templates
Create a new template (admin only)
curl --request POST \
  --url https://{appId}.api-{region}.cometchat.io/v3/campaigns/templates \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --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": [
    "<string>"
  ],
  "config": {}
}
'

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-docs-campaigns-service-rest-api.mintlify.app/llms.txt

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

Authorizations

Authorization
string
header
required

Service-to-service basic auth

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
string[]

Variable schema definitions

config
object

Additional configuration

Response

Template created