Skip to main content

Create a WhatsApp campaign

POST 

/api/partner-gateway/campaigns

Creates a bulk WhatsApp campaign, as a draft or already marked ready to send. Nothing is sent until you confirm it.

  • Channel: set sendingMode to WHATSAPP, with the phone number (whatsappPhoneNumberId) and the template (whatsappTemplateId). WHATSAPP_SMS tries WhatsApp first and falls back to SMS: it needs smsSender and smsBody too.
  • Recipients: contact lists in contactListIds (destinationType 0), phone numbers in destinations (destinationType 1), or both (destinationType 2).
  • Schedule: set scheduledDate to a future time (yyyy-MM-dd HH:mm:ss.SSSZ) to send later. Without it the campaign is sent as soon as it is confirmed.
  • The number is checked against your account: whatsappPhoneNumberId must be one of your WhatsApp numbers, and with WHATSAPP_SMS smsSender must be an approved sender. Nothing is created when a check fails.
  • Personalisation of the fallback SMS: smsBody accepts placeholders in single braces named after your contact fields, such as {firstName}.
  • API key: CAMPAIGNS opens every campaign. A key without it manages only the campaigns whose sendingMode uses its channel operations, all of them for a combined mode: SMS campaigns need SMS, RCS_SMS campaigns need RCS and SMS.
From draft to sending, step by step
  1. Create the campaign with readyToSend false to save it as a draft.
  2. Adjust it with PUT /campaigns/{id}, as many times as you need.
  3. Check the recipient count and the price with GET /campaigns/{id}/price.
  4. Set readyToSend to true with PUT /campaigns/{id} when the configuration is final.
  5. Confirm it with PUT /campaigns/{id}/confirm: the campaign is priced, the amount is reserved and the sending starts, at once or at the scheduledDate.
Fields each sending mode needs
sendingModeFields
WHATSAPPwhatsappPhoneNumberId and whatsappTemplateId: the template is loaded only when both are sent.
WHATSAPP_SMSThe WhatsApp fields, plus smsSender and smsBody: WhatsApp is tried first, then SMS.
WHATSAPP_RCS_SMS, RCS_WHATSAPP_SMSThe fields of all three channels, tried in the order of the name. The RCS ones are on Create an RCS campaign.

WHATSAPP_RCS_SMS is stored and returned as RCS_WHATSAPP_SMS (RCS first) whenever rcsAgentId is set, which that mode needs before it can be confirmed.

POST /campaigns is one endpoint for SMS, RCS and WhatsApp: this page describes it for WhatsApp. See it for SMS or RCS.

Request​

Responses​

Campaign created, returned as stored with its id.