REST API v1 · Resource
Broadcasts
Send a template to many contacts, preview who it reaches, follow each recipient and cancel.
API reference · Broadcasts
Endpoints
Paths are relative to https://fliok.com/api/v1. Each endpoint names the scope and the lowest key role it needs; a key without them gets 403 (see Authentication).
Broadcasts
6- GET
/broadcastsList campaigns with live sent/delivered/failed countsScopebroadcasts:read· viewer role or higherNeeds an API key - POST
/broadcastsCreate a campaign by tags, contact ids or a number list. Returns how many will actually send after opt-out and the marketing capScopebroadcasts:write· admin role or higherNeeds an API key - GET
/broadcasts/{id}One campaign with its delivery progressScopebroadcasts:read· viewer role or higherNeeds an API key - DELETE
/broadcasts/{id}Cancel a campaign. Messages already handed to WhatsApp cannot be recalledScopebroadcasts:write· admin role or higherNeeds an API key - GET
/broadcasts/{id}/recipientsWho a campaign went to and what happened to each (status, reason, sent/delivered/read times), cursor-paginated. Numbers and names need contacts:read tooScopebroadcasts:read· viewer role or higherNeeds an API key - POST
/broadcasts/previewWhat POST /broadcasts would do with this body — matched, will send, suppressed and why, new recipients, plan and reach warnings, Meta’s estimated cost. Writes nothingScopebroadcasts:write· admin role or higherNeeds an API key
Request bodies
What these endpoints take, field by field. A body that doesn’t match answers 400 naming the field.
POST /broadcasts
JSON body, admin keys. Refused before anything is written when this month’s allowance is used up or a template variable is blank. Recipients who have never messaged you (and have no opt-in recorded) have their own rules, the same as in the dashboard: 422 "notice_to_new_recipients" for a utility or authentication template, 409 "new_recipients_unconfirmed" without confirmNewRecipients, 409 "new_recipient_cool_off" after Meta restricted the account, and 409 "follow_up_too_soon" when they were sent a broadcast in the last few days and have not replied. Each answer carries a "message", "newRecipients" and "knownRecipients"; knownOnly is always accepted. A 409 "number_banned" or "sending_blocked" means Meta is refusing messages from the number.
| Field | Type | What it is |
|---|---|---|
namerequired | string | Up to 200 characters. |
templateIdrequired | uuid | An approved template’s id (GET /templates). |
phoneNumberIdrequired | uuid | The number that sends (GET /phone-numbers). |
segmentrequired | object | Who receives it: { "tags": [ … ] } and/or "excludeTags", "optInStatus", "lastSeenWithinDays" — or { "contactIds": [ … ] } for hand-picked contacts (an empty list means nobody). |
variables | object | The template’s parameters as { "components": [ … ] }, the same shape a template send uses. |
sendNow | boolean | Start sending at once. |
scheduledAt | ISO time | Send later instead. With neither, it is saved as a draft. |
confirmNewRecipients | boolean | Your confirmation that the recipients who have never messaged you agreed to get WhatsApp messages from your business. Recorded in the activity log. |
knownOnly | boolean | Send only to recipients who have messaged you or have an opt-in recorded; the others are listed as skipped. |
followUpOf | uuid | The broadcast this one follows up. A follow-up to a marketing broadcast must use a marketing template. |
Returns 201 { "id", "status": "running" | "scheduled" | "draft", "audience": { "matched", "willSend", "suppressed" }, "newRecipients" } — willSend is how many will actually be messaged after opt-outs and Meta’s marketing cap. newRecipients is how many of them have never messaged you; they are sent gradually, a daily allowance per number, so the broadcast can stay "running" for several days.
Rate limits
The buckets these endpoints use. Burst is how many requests you can make back-to-back from a full bucket; sustained is how fast it refills.
| Bucket | Endpoints | Burst | Sustained |
|---|---|---|---|
| Broadcast cancel | DELETE /broadcasts/{id} | 30 | 1 / 2 sec |
| Broadcast create | POST /broadcasts | 10 | 10 / hour |
Every limit, the RateLimit-* headers and what to do on a 429: Rate limits.