Messaging API

Campaigns

Send an approved WhatsApp template to a list of contacts.

A campaign sends one approved template to an audience of contacts. You need a connected channel first.

1. Create the campaign

POSThttps://api.tryvox.io/v1/messaging/campaigns

A new campaign starts as a draft and sends nothing until you start it.

FieldTypeRequiredDescription
channel_idstringYesA channel on your account
namestringYesCampaign name
template_namestringYesAn approved template on the channel
audience_typestringYesall, tags, manual, or segment
audience_tagsstringConditionalThe tags for tags, or the segment ID for segment
contact_idsarrayConditionalThe contacts for manual
template_paramsstringNoTemplate parameters
batch_sizeintegerNoMessages per batch
batch_delay_msintegerNoDelay between batches, in milliseconds
scheduled_atstringNoSend time, as an RFC 3339 timestamp
curl -X POST https://api.tryvox.io/v1/messaging/campaigns \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "<channel-id>",
    "name": "November offer",
    "template_name": "november_offer",
    "audience_type": "tags",
    "audience_tags": "vip"
  }'

To preview the recipient count and estimated cost first, send the same audience fields to POST /v1/messaging/campaigns/estimate.

2. Start it

curl -X POST https://api.tryvox.io/v1/messaging/campaigns/$CAMPAIGN_ID/start \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN

A successful request returns 204 No Content.

3. Track and control it

MethodPathPurpose
GET/v1/messaging/campaignsList campaigns
GET/v1/messaging/campaigns/{id}Get status and counts
GET/v1/messaging/campaigns/{id}/recipientsPer-recipient status
POST/v1/messaging/campaigns/{id}/pausePause
POST/v1/messaging/campaigns/{id}/resumeResume
POST/v1/messaging/campaigns/{id}/cancelCancel
DELETE/v1/messaging/campaigns/{id}Delete

A campaign includes status, total_recipients, sent_count, delivered_count, read_count, failed_count, and skipped_count.

status is one of draft, scheduled, sending, running, paused, completed, or cancelled.

On this page