Skip to content

Campaigns

Campaigns allow you to send bulk WhatsApp messages to multiple contacts using approved templates. The API handles rate limiting and delivery tracking automatically.

Retrieve all campaigns.

Terminal window
GET /api/campaigns
ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20)
statusstringFilter by status
account_idstringFilter by WhatsApp account
{
"status": "success",
"data": {
"items": [
{
"id": "uuid",
"name": "Holiday Promotion",
"template_id": "uuid",
"status": "completed",
"total_recipients": 1000,
"sent_count": 1000,
"delivered_count": 950,
"read_count": 500,
"failed_count": 50,
"scheduled_at": "2024-01-01T10:00:00Z",
"started_at": "2024-01-01T10:00:05Z",
"completed_at": "2024-01-01T10:30:00Z"
}
],
"total": 25,
"page": 1,
"limit": 20
}
}

Retrieve a single campaign with detailed progress.

Terminal window
GET /api/campaigns/{id}
{
"status": "success",
"data": {
"id": "uuid",
"name": "Holiday Promotion",
"template_id": "uuid",
"template_name": "holiday_offer",
"account_id": "uuid",
"status": "sending",
"total_recipients": 1000,
"sent_count": 450,
"delivered_count": 400,
"read_count": 100,
"failed_count": 10,
"variable_mapping": {
"1": "name",
"2": "discount_code"
},
"scheduled_at": null,
"started_at": "2024-01-01T10:00:05Z",
"created_at": "2024-01-01T09:00:00Z"
}
}

Create a new campaign.

Terminal window
POST /api/campaigns
{
"name": "New Year Sale",
"account_id": "uuid",
"template_id": "uuid",
"variable_mapping": {
"1": "name",
"2": "discount_code"
},
"scheduled_at": "2024-01-01T00:00:00Z"
}
{
"status": "success",
"data": {
"id": "uuid",
"name": "New Year Sale",
"status": "draft",
"created_at": "2024-01-01T00:00:00Z"
}
}

Update a draft campaign.

Terminal window
PUT /api/campaigns/{id}

Delete a campaign.

Terminal window
DELETE /api/campaigns/{id}

Import recipients from a CSV or JSON file.

Terminal window
POST /api/campaigns/{id}/recipients/import
{
"recipients": [
{
"phone_number": "+1234567890",
"name": "John Doe",
"discount_code": "SAVE20"
},
{
"phone_number": "+0987654321",
"name": "Jane Smith",
"discount_code": "SAVE15"
}
]
}
{
"status": "success",
"data": {
"imported": 2,
"duplicates": 0,
"invalid": 0
}
}

Get campaign recipients with their delivery status.

Terminal window
GET /api/campaigns/{id}/recipients
ParameterTypeDescription
pageintegerPage number
limitintegerItems per page
statusstringFilter by status
{
"status": "success",
"data": {
"items": [
{
"id": "uuid",
"phone_number": "+1234567890",
"name": "John Doe",
"status": "delivered",
"sent_at": "2024-01-01T10:00:10Z",
"delivered_at": "2024-01-01T10:00:15Z"
}
],
"total": 1000,
"page": 1,
"limit": 50
}
}

Begin sending messages.

Terminal window
POST /api/campaigns/{id}/start

Pause a running campaign.

Terminal window
POST /api/campaigns/{id}/pause

Cancel a campaign (cannot be resumed).

Terminal window
POST /api/campaigns/{id}/cancel
StatusDescription
draftCampaign created, not yet started
scheduledCampaign scheduled for future sending
sendingCampaign is actively sending messages
pausedCampaign is paused
completedAll messages have been processed
cancelledCampaign was cancelled

Campaigns automatically respect WhatsApp’s rate limits:

TierMessages per second
TIER_1K~10 msg/sec
TIER_10K~30 msg/sec
TIER_100K~80 msg/sec
TIER_UNLIMITEDNo limit