POST /api/campaigns/{id}/recipients Add one or more recipients to a campaign by providing an array of user IDs. Recipients can only be added while the campaign is in draft status.

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

userIds
string[]
required
Array of user IDs to add as recipients.

Example request

curl -X POST https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/campaigns/666c3d4e5f6a7b8c9d0e1f2a/recipients \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "userIds": ["user-001", "user-002", "user-003"]
  }'

Example response

{
  "added": 3,
  "total": 1503
}

Response fields

added
integer
Number of recipients added in this request.
total
integer
Total number of recipients in the campaign after this addition.
For large recipient lists with per-user variable values, use the CSV upload endpoint instead.