What Are Campaigns?
Campaigns enable bulk message delivery to multiple recipients with centralized tracking and management.
Creating a Campaign
curl -X POST https://api-message.nativehub.live/api/v1/campaigns \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Spring Promotion",
"template_id": "tmpl_abc123",
"sender_id": "sender_xyz789",
"schedule_at": "2026-03-01T09:00:00Z"
}'
Importing Recipients
CSV must include a phone column. Additional columns map to template variables:
phone,name,code
+1234567890,John,SAVE20
+9876543210,Jane,SAVE20
Upload Recipients
curl -X POST https://api-message.nativehub.live/api/v1/campaigns/cmp_abc123/recipients \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "[email protected]"
Duplicates and DNC numbers are automatically filtered during import.
Campaign Lifecycle
| Status | Description |
|---|
draft | Created, not started |
running | Actively sending |
paused | Temporarily stopped |
completed | All messages sent |
cancelled | Manually stopped |
Managing Campaigns
Start Campaign
curl -X POST https://api-message.nativehub.live/api/v1/campaigns/cmp_abc123/start \
-H "Authorization: Bearer YOUR_TOKEN"
Pause Campaign
curl -X POST https://api-message.nativehub.live/api/v1/campaigns/cmp_abc123/pause \
-H "Authorization: Bearer YOUR_TOKEN"
Cancel Campaign
curl -X POST https://api-message.nativehub.live/api/v1/campaigns/cmp_abc123/cancel \
-H "Authorization: Bearer YOUR_TOKEN"
Cancelled campaigns cannot be restarted. Messages already queued may still send.
Monitoring Progress
curl https://api-message.nativehub.live/api/v1/campaigns/cmp_abc123 \
-H "Authorization: Bearer YOUR_TOKEN"
Response includes delivery counts:
{
"id": "cmp_abc123",
"name": "Spring Promotion",
"status": "running",
"stats": {
"total": 10000,
"sent": 7500,
"delivered": 7200,
"failed": 150,
"pending": 2500
}
}
Viewing Recipients
curl "https://api-message.nativehub.live/api/v1/campaigns/cmp_abc123/recipients?page=1&per_page=20" \
-H "Authorization: Bearer YOUR_TOKEN"
Response format:
{
"data": [
{
"phone": "+1234567890",
"variables": {"name": "John", "code": "SAVE20"},
"status": "delivered",
"sent_at": "2026-03-01T09:05:00Z"
}
],
"total": 10000,
"page": 1,
"per_page": 20
}