Create Campaign
Creates a campaign with a channel-scoped API key and automatically starts sending after recipient preparation completes. JWT authentication is rejected. The send channel and phone number come from the API key. Do not send channel_id or phone_number_id. Immediate campaigns are created as DRAFT and start after preparation. Scheduled campaigns are created as SCHEDULED and send at scheduled_at.
How it works
- Authenticate with your workspace API key.
- The API validates the template, channel, audience, and billing features.
- The campaign is stored with
preparation_status: PREPARINGandis_auto_trigger: true. - A background worker builds the recipient list.
- When preparation is
READY, the campaign starts automatically.
total_contacts is 0 in the create response. The worker updates the count after it loads the audience.
Example request
Your API key is channel-scoped. The backend reads the WhatsApp channel andphone_number_id from the key. Do not send channel_id or phone_number_id in the body.
Channel
The send channel comes from your API key. Create the key against the WhatsApp number you want to send from. The API attaches that channel and phone number to the campaign automatically. Do not passchannel_id or phone_number_id in the request body.
The template must belong to the same WhatsApp Business account as the API key’s channel. Fetch approved templates first with Fetch Approved Templates.
Audience
Setcontact_selection_type and the matching fields.
csv_mapping uses 0-based column indexes. phone_column and country_code_column are required for CSV audiences.
Variable mapping
variable_mapping personalizes header, body, button, and carousel fields.
- For
all_contactsandsegmented, map template variables to contact fields such asfirstName,lastName,email,phoneNumber, orcountryCode. - For
csv_contacts, map to CSV keys such asname_column,email_column, or names fromcustom_field_mapping. - Use
default_valueswhen a contact field might be empty.
firstName) or a {{firstName}} placeholder. Both resolve at send time.
Feature and billing checks
send_type: SCHEDULEDrequires the Schedule Campaigns feature.contact_selection_type: segmentedrequires Targeted Segments.- Starting a campaign counts against Broadcasts Per Month.
- The template must be approved and available on the resolved channel’s WhatsApp Business account.
Authorizations
Body
Campaign name.
255"September promo"
Approved WhatsApp template UUID that belongs to the same WhatsApp Business account as the sending channel.
"123e4567-e89b-12d3-a456-426614174000"
How recipients are selected. segmented requires the Targeted Segments feature.
all_contacts, segmented, csv_contacts, quick_contacts, failed_contacts SCHEDULED requires scheduled_at in the future and the Schedule Campaigns feature.
IMMEDIATE, SCHEDULED Optional campaign description.
1000"Announce the monthly offer to every contact"
Not required for this endpoint. The channel-scoped API key supplies the send channel.
"b340b1b3-bf45-4a61-be71-853a31830dc5"
Not required for this endpoint. The channel-scoped API key supplies the WhatsApp phone number ID.
"106294715428491"
Optional extra filters for segmented campaigns.
Segment IDs for segmented campaigns. Contacts in any listed segment are included.
Phone numbers for quick_contacts. Each value must be a valid phone number. You can append inline variables after the number using a comma, pipe, or semicolon.
Raw CSV text for csv_contacts. Must include a header row and at least one data row. Provide this or a CSV file reference.
"phone,country_code,name\n9876543210,+91,John"
S3 key of a previously uploaded campaign CSV.
"workspaces/1/campaign-csvs/1730000000-abc123.csv"
Public URL of a previously uploaded campaign CSV.
0-based column indexes for csv_contacts.
Template personalization. Use contact field names such as firstName, CSV column keys such as name_column, or static values. Missing contact values fall back to default_values.
ISO 8601 send time. Required when send_type is SCHEDULED. Must be in the future.
"2026-10-01T10:00:00.000Z"
