POST /api/campaigns Create a new campaign in draft status. Link it to a template and configure the delivery mode. Add recipients separately after creation.

Headers

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

Request body

name
string
required
Display name for the campaign.
templateId
string
required
The template ID to use for this campaign.
deliveryMode
string
required
Delivery mode: realtime or batch.
tag
string
Optional tag for categorizing campaigns.

Example request

curl -X POST https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/campaigns \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "January Promo",
    "templateId": "665b2c3d4e5f6a7b8c9d0e1f",
    "deliveryMode": "batch",
    "tag": "promo"
  }'

Example response

{
  "id": "666c3d4e5f6a7b8c9d0e1f2a",
  "appId": "YOUR_APP_ID",
  "name": "January Promo",
  "templateId": "665b2c3d4e5f6a7b8c9d0e1f",
  "status": "draft",
  "deliveryMode": "batch",
  "tag": "promo",
  "createdAt": "2024-01-15T09:30:00.000Z",
  "updatedAt": "2024-01-15T09:30:00.000Z"
}
After creating a campaign, add recipients via the add recipients or CSV upload endpoints, then trigger delivery with send campaign.