Skip to main content
POST
/
notifications
/
messages
Send a notification using a template
curl --request POST \
  --url https://{appId}.api-{region}.cometchat.io/v3/campaigns/notifications/messages \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'appid: <appid>' \
  --data '
{
  "templateId": "order_update",
  "receivers": [
    "<string>"
  ],
  "variables": {
    "user_42": {
      "user_name": "John",
      "order_id": "12345"
    },
    "user_43": {
      "user_name": "Sarah",
      "order_id": "12346"
    }
  },
  "tag": "<string>"
}
'

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
templateId
string
required

Template CUID or templateId slug. Template must be in approved status.

Example:

"order_update"

receivers
string[]
required

Array of target user IDs. 1–10 = realtime (synchronous, returns notificationId immediately). 11–10,000 = batch (asynchronous, returns batchId; processing happens via queue).

Required array length: 1 - 10000 elements
variables
object

Per-user variables. Keyed by userId; values are { variableName: value } objects. Variables are applied to the template content at delivery time.

Example:
{
"user_42": { "user_name": "John", "order_id": "12345" },
"user_43": { "user_name": "Sarah", "order_id": "12346" }
}
tag
string

Optional analytics tag attached to the send (passes through to delivery records).

Response

Realtime: { notificationId, channels[], mode: "realtime" }. Batch: { batchId, total, channels[], mode: "batch" }.