Miira · leads & WhatsApp v1 current
miira. broadcast_ sent
Sends the WhatsApp broadcast quoted by miira.broadcast_quoted, exactly to whom and how the quote said. If anything changed (window, consent, rate) it refuses with a new quote to confirm again. Costs money when templates are involved: do not call it without the person having seen the cost.
Last updated
POST /api/v1/actions/miira.broadcast_sent- Key scope
miira.broadcast_sent@1- Workspace permission
api.miira.broadcast_sentoff by default- Guarded
- Yes — the cost of the request is recorded and may be capped per workspace.
Two permissions, not one
Both are needed: a key with that scope, and the workspace owner having switched the permission on. Holding the key is not enough — they are two decisions made by different people.
Request
| field | type | rules | |
|---|---|---|---|
quote | string | required | min 1 · max 65536 |
Response — output when status is done
| field | type | rules | |
|---|---|---|---|
queued | object[] | required | |
costUsd | string | required |
queued[]
| field | type | rules | |
|---|---|---|---|
clientId | string | required | |
clientName | string | required | |
mode | "free_text" | "template" | required | |
outboxId | string | required |
Example
# One request, one idempotency key: retrying with the same key never runs twice.
curl -X POST https://niiko.org/api/v1/actions/miira.broadcast_sent \
-H "Authorization: Bearer nk_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"quote": "…"
}'
# 200 → done · 202 → pending_approval (a person signs later) · 4xx → refused, with a named reasonWhy it may refuse
Each reason names who can fix it and how. With reason stale, detail.message says what to do.
presupuesto_invalidopresupuesto_vencidopresupuesto_cambiadoplantilla_invalidatarifas_vencidassin_permiso
In the clients
| @vorluno/niiko-sdk | niiko.sentBroadcast() |
| niiko (Python) | niiko.sent_broadcast() |
| niiko-cli | niiko run miira.broadcast_sent |
| n8n-nodes-niiko | miiraBroadcastSent |
| niiko-mcp-server | miira_broadcast_sent |
History
- Broadcasts can be declared a promotion
miira.broadcast_quotedtakes an optionalpurpose:notice(the default, unchanged) orpromotion. A promotion never goes as free text, even with the 24-hour window open: it needs an approved marketing template (otherwiseplantilla_invalida) and only reaches clients with granted marketing consent (no_marketing_consentotherwise). US numbers are left out with the new row outcomeus_moratorium, which is emitted only for a promotion, so existing integrations never see it. The purpose is signed into the quote. - Broadcasts no longer wait for quiet hoursniiko no longer defers or excludes sends by the time of day. Broadcast rows are no longer reported as
quiet_hours(the value stays in the outcome enum, but it is never emitted), and the messages queued bymiira.broadcast_sentgo out right away, at any hour. Meta's 24-hour service window and consent rules are unchanged. - WhatsApp broadcast, in two steps
miira.broadcast_quotedquotes the same message to up to 50 clients (free inside the 24-hour window, approved template and rate outside) and returns a signed quote valid for 15 minutes;miira.broadcast_sentsends exactly what was quoted, or refuses with a new quote if anything changed.