Skip to main content

Send a broadcast

POST 

/v1/agents/:agentId/broadcasts

x-scope: "broadcasts:write"
x-rate-limit-per-minute: 10

Sends one approved template from one of the agent's WhatsApp numbers to many numbers, right away, as the dashboard's Broadcasts page does. The answer is 201 with the broadcast, sending; Mojeeb sends in the background, and each message's delivery comes back on listBroadcastRecipients. Each recipient lands in their conversation with the agent (one is started if they have none), so a reply reaches the AI.

A broadcast fills only the template's body variables: parameters for everyone, and a recipient's own parameters over them. Its header keeps the sample it was approved with, and no button gets a value, so a template with a header variable or a button that needs a value per send is 422 template_not_broadcastable (send those one by one with sendWhatsAppTemplate), and so is one with a location header, which Mojeeb can't send yet. A template the number doesn't have is 422 template_not_found with available_templates, or template_not_found_for_language with available_languages. Only an approved template can be broadcast (422 template_not_approved). A number listed twice gets one message; recipient_count says how many will be sent. Mojeeb refuses a broadcast with more recipients than the number's WhatsApp daily messaging limit allows (422 invalid_request).

Send an Idempotency-Key: a retry after a timeout then never sends the broadcast twice. It checks the template with Meta, so it shares the WhatsApp template endpoints' budget of 10 requests a minute per key. Plans with broadcasts only.

Request​

Responses​

The broadcast, sending (a replay of it when Idempotent-Replayed is true).

Response Headers
    X-Correlation-ID

    Correlation id for this request — paste into support tickets.

    Idempotent-Replayed

    Present and true when the response is a replay of a prior request.