Skip to main content
POST
/
whatsapp
/
campaigns
/
{_id}
/
sample
Send a sample campaign
curl --request POST \
  --url https://api.otpiq.com/api/whatsapp/campaigns/{_id}/sample \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "recipients": [
    {
      "phoneNumber": "9647712345678",
      "templateParameters": {
        "body": {},
        "header": {},
        "buttons": {}
      }
    }
  ]
}
'
{
  "success": true,
  "data": {
    "_id": "<string>",
    "campaignId": "<string>",
    "name": "<string>",
    "template": "<string>",
    "phoneNumber": "<string>",
    "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,
    "isSampleCampaign": true,
    "sampleOfCampaign": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}
Sending a sample campaign does not modify the parent campaign. It’s a great way to test your template and parameters before a full broadcast.

Authorizations

Authorization
string
header
required

Project API key (sk_live… or sk_dev…). Send it as Authorization: Bearer <api_key>.

Path Parameters

_id
string
required

Campaign MongoDB id returned on create

Pattern: ^[a-fA-F0-9]{24}$

Body

application/json
recipients
object[]
required
Required array length: 1 - 1000 elements

Response

Sample campaign created and started

success
enum<boolean>
required
Available options:
true
data
object
required