PUT /api/campaigns/{id} Update an existing campaign. Only campaigns in draft status can be modified.

Headers

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

Path parameters

id
string
required
The campaign ID.

Request body

name
string
Updated campaign name.
tag
string
Updated campaign tag.
deliveryMode
string
Updated delivery mode: realtime or batch.

Example request

curl -X PUT https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/campaigns/666c3d4e5f6a7b8c9d0e1f2a \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "February Promo",
    "tag": "february"
  }'

Example response

{
  "id": "666c3d4e5f6a7b8c9d0e1f2a",
  "appId": "YOUR_APP_ID",
  "name": "February Promo",
  "templateId": "665b2c3d4e5f6a7b8c9d0e1f",
  "status": "draft",
  "deliveryMode": "batch",
  "tag": "february",
  "createdAt": "2024-01-15T09:30:00.000Z",
  "updatedAt": "2024-01-16T10:00:00.000Z"
}
Campaigns can only be updated while in draft status. Once a campaign is scheduled or sent, it is locked.