send_broadcast
Send or schedule a broadcast: one approved template to every contact in a segment. Omit scheduled_at to send immediately. Validates the template is APPROVED and that every body placeholder is mapped to a contact field — a template with any unmapped placeholder is REJECTED with TEMPLATE_VARIABLES_UNMAPPED (the error's meta.unmapped_placeholders lists which). If you hit that, map them with set_template_variables, then retry. Call preview_broadcast FIRST to show the user the rendered message and catch this before sending. Returns { campaign_id, contact_count, scheduled_at } — use campaign_id with get_campaign_stats. For a new or unfamiliar workspace, call get_started FIRST and complete any missing setup steps before scheduling — otherwise the broadcast will not be delivered. On failure the error's meta field explains the fix: CHANNEL_NOT_CONNECTED means no WhatsApp number is connected (use whatsapp_connect_link); SUBSCRIPTION_REQUIRED or MONTHLY_LIMIT_REACHED means no active plan (use get_subscribe_link). Give the user the link, then retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| segment_id | Yes | ||
| template_id | Yes | ||
| scheduled_at | No | ISO 8601 datetime with offset; omit to send now | |
| timezone_mode | No | "account" (default): one send time for everyone |