curl --request POST \
--url https://api.otpiq.com/api/whatsapp/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Summer promo",
"templateId": "664abc123def456789012345",
"phoneNumberId": "664def456abc789012345678",
"scheduleType": "now"
}
'{
"success": true,
"data": {
"_id": "<string>",
"campaignId": "<string>",
"name": "<string>",
"status": "draft",
"category": "MARKETING",
"template": "<string>",
"phoneNumber": "<string>",
"scheduleType": "now",
"scheduledFor": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"totalRecipients": 123,
"sentCount": 123,
"deliveredCount": 123,
"failedCount": 123,
"estimatedTotalCost": 123,
"reservedAmount": 123,
"reconciledAmount": 123,
"billingStatus": "none",
"isSampleCampaign": true,
"sampleOfCampaign": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Recipients cannot exceed 1000 per request"
}{
"message": "Unauthorized, please use your project api key"
}{
"success": false,
"error": "<string>",
"unsupportedPhoneNumbers": [
"<string>"
]
}{
"success": false,
"error": "Campaign not found"
}WhatsApp Campaigns Endpoints
Create Campaign
Create a new WhatsApp campaign shell without recipients
POST
/
whatsapp
/
campaigns
curl --request POST \
--url https://api.otpiq.com/api/whatsapp/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Summer promo",
"templateId": "664abc123def456789012345",
"phoneNumberId": "664def456abc789012345678",
"scheduleType": "now"
}
'{
"success": true,
"data": {
"_id": "<string>",
"campaignId": "<string>",
"name": "<string>",
"status": "draft",
"category": "MARKETING",
"template": "<string>",
"phoneNumber": "<string>",
"scheduleType": "now",
"scheduledFor": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"totalRecipients": 123,
"sentCount": 123,
"deliveredCount": 123,
"failedCount": 123,
"estimatedTotalCost": 123,
"reservedAmount": 123,
"reconciledAmount": 123,
"billingStatus": "none",
"isSampleCampaign": true,
"sampleOfCampaign": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Recipients cannot exceed 1000 per request"
}{
"message": "Unauthorized, please use your project api key"
}{
"success": false,
"error": "<string>",
"unsupportedPhoneNumbers": [
"<string>"
]
}{
"success": false,
"error": "Campaign not found"
}This endpoint creates the campaign shell. You must add recipients using the Attach Recipients endpoint before starting the campaign.
Authorizations
Body
application/json
Does not include recipients. Add them via
POST /api/whatsapp/campaigns/{_id}/recipients.
Category is always taken from the linked template.