Skip to main content

Campaigns

A campaign sends one approved template to many contacts: all contacts of the project, or one or more groups. LUMA sends in batches, respects WhatsApp's limits for your number and records every message.

Plan: LUMA Elevate or Enterprise for the API (campaigns in the app are on every paid plan). Credits: 12 per template message sent. Before sending, LUMA checks that your balance covers the whole campaign.

Create a campaign​

POST /v1/project/{projectId}/campaigns

curl --request POST 'https://api.itechintl.com/v1/project/PROJECT_ID/campaigns' \
--header 'Authorization: Bearer lm_live_YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"waba_account_id": WABA_ACCOUNT_ID,
"campaign_name": "November offer",
"template_name": "november_offer",
"template_language": "en_US",
"target_type": "groups",
"group_ids": [ 12, 15 ],
"status": "draft"
}'
FieldTypeRequiredDescription
waba_account_idintegeryesLUMA ID of the sending WhatsApp account (from GET /v1/waba)
campaign_namestringyesYour label
template_name, template_languagestringyes to sendAn approved template
target_typestringnoallcontacts (default) or groups
group_idsarray of integerswith groupsTarget groups
statusstringnodraft (default)
owner_namestringnoWho created it

Template variables are filled from contact fields (for example the first name), mapped when you set up the campaign in the app.

Send a campaign​

POST /v1/project/{projectId}/campaigns/{campaignId}/send

The answer comes at once; sending runs in the background. If the balance cannot cover the campaign, the send is refused and nothing is sent.

Follow a campaign​

CallWhat it returns
GET /v1/project/{projectId}/campaigns?pageNumber=1&pageSize=20&status=&wabaAccountId=Your campaigns
GET /v1/project/{projectId}/campaigns/{campaignId}One campaign with its details
GET /v1/project/{projectId}/campaigns/{campaignId}/messages?pageSize=20&nextPageToken=Every message of the campaign with its status

The campaigns list answers data.items[] with id, campaign_name, waba_account_id, template_name, template_language, target_type, status, total_contacts, scheduled_at, sent_at, created_at, plus total_count, page_number and page_size.

Change or delete​

  • PUT /v1/project/{projectId}/campaigns/{campaignId}: change a campaign that has not been sent.
  • DELETE /v1/project/{projectId}/campaigns/{campaignId}: delete it.

Tips​

  • Use MARKETING templates only for people who opted in to offers.
  • Start with a small group, check the statuses, then send to everyone.
  • Replies from campaign recipients arrive as normal incoming messages (and in the LUMA Inbox).