Miira · leads & WhatsApp v1 current
miira. broadcast_ quoted
Quotes sending the SAME WhatsApp message to several clients named by name (up to 50). Sends NOTHING: per client, it says whether the text goes as-is (24-hour window open, free), whether an approved template is needed and what it costs, or why that client cannot be messaged. Returns a signed quote valid for 15 minutes; to send, call miira.broadcast_sent with it. Show the quote to the person first. Optional `purpose`: `notice` (default) is the usual notice; `promotion` NEVER sends free text, even with the window open, and requires an approved MARKETING template (otherwise plantilla_invalida): it only reaches clients with granted marketing consent (no_marketing_consent otherwise) and leaves US numbers out (us_moratorium). In a promotion `message` is never sent: what goes is the template with its `templateValues`. Use `promotion` for offers and campaigns, never for a reply or a notice.
Last updated
POST /api/v1/actions/miira.broadcast_quoted- Key scope
miira.broadcast_quoted@1- Workspace permission
api.miira.broadcast_quotedoff by default
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 | |
|---|---|---|---|
clients | string[] | required | |
message | string | required | min 1 · max 4096 |
template | string | optional | min 1 · max 512 |
templateValues | string[] | optional | |
purpose | "notice" | "promotion" | optional |
Response — output when status is done
| field | type | rules | |
|---|---|---|---|
rows | object[] | required | |
totals | object | required | |
quote | string | null | required | |
expiresAt | string | null | required |
rows[]
| field | type | rules | |
|---|---|---|---|
client | string | required | |
clientId | string | null | required | |
clientName | string | null | required | |
outcome | "free_text" | "template" | "needs_template" | "no_phone" | "suppressed" | "consent_revoked" | "no_marketing_consent" | "quiet_hours" | "not_found" | "ambiguous" | "too_many" | "us_moratorium" | required | |
costUsd | string | null | required | |
candidates | string[] | optional |
totals
| field | type | rules | |
|---|---|---|---|
freeText | integer | required | |
template | integer | required | |
skipped | integer | required | |
costUsd | 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_quoted \
-H "Authorization: Bearer nk_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"clients": [
"…"
],
"message": "…"
}'
# 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.
plantilla_invalidatarifas_vencidassin_permiso
In the clients
| @vorluno/niiko-sdk | niiko.quotedBroadcast() |
| niiko (Python) | niiko.quoted_broadcast() |
| niiko-cli | niiko run miira.broadcast_quoted |
| n8n-nodes-niiko | miiraBroadcastQuoted |
| niiko-mcp-server | miira_broadcast_quoted |
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.