Send a broadcast
Send an approved WhatsApp template to up to 1,000 numbers in one request. It is queued and sent at a steady pace, people who opted out are skipped, and you follow progress like any broadcast in the app.
POST
/api/v1/broadcastsNeeds the scope broadcasts:send
Body#
A JSON object.
template_namestringRequiredAn approved template, for exampleorder_update.recipientsobject[]Required1 to 1,000 items of{ "to": "+91…", "params": ["…"] }.paramsfill{{1}},{{2}}… for that person (up to 60 values).template_languagestringoptionalLanguage code such asen_US. Leave it out to use the approved template with that name.header_media_urlstringoptionalFor templates with an image, video or document header: an https link to the file.namestringoptionalA name for the broadcast in the app. Default: “API broadcast (template name)”.
Example#
curl -X POST "https://app.catengage360.com/api/v1/broadcasts" \
-H "Authorization: Bearer cat_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Batch reminders",
"template_name": "class_reminder",
"recipients": [
{
"to": "+919876543210",
"params": [
"Asha",
"Friday 6 pm"
]
},
{
"to": "+919812345678",
"params": [
"Ravi",
"Friday 6 pm"
]
}
]
}'Response#
202Accepted and queued
JSON
{
"data": {
"broadcast_id": "c3d9a1e2-7b4f-4e6a-8d15-2f0b9c8e7a64",
"status": "sending",
"total_recipients": 2,
"accepted": 2,
"rejected": 0
}
}rejected counts numbers left out because they were invalid or opted out. For more than 1,000 people, split them over several requests.
Errors#
Errors come as { "error": { "code", "message" } }. Branch on code.
| Code | Status | What it means |
|---|---|---|
bad_request | 400 | No template_name, no or too many recipients, no valid number, or a media header without header_media_url. |
template_not_found | 400 | No template with that name. Sync templates from Meta in Settings. |
template_not_approved | 400 | The template exists but isn’t approved by Meta. |
whatsapp_not_configured | 400 | WhatsApp is not connected for this business. |
unauthorized | 401 | The API key is missing, wrong, revoked or expired. |
rate_limited | 429 | More than 120 requests a minute with this key. Wait for the seconds in Retry-After. |
forbidden | 403 | The key doesn’t have the broadcasts:send scope. |
account_not_approved | 403 | The business is waiting for approval. |
account_suspended | 403 | Messaging is paused for this business. |