Send a Template Message
WhatsApp requires pre-approved templates for business-initiated conversations.Send a Session Message
Once a user messages you, a 24-hour session window opens for free-form replies. Use the window-status check to confirm the window is still open before sending.Check the 24-Hour Window
Before composing a free-form (session) message, call the window-status endpoint to confirm the recipient is still inside Meta’s 24-hour re-engagement window. The send pipeline enforces the same check, but this pre-flight lets you gate the UI (force template-only when the window has closed) and avoid a wasted send attempt.to(required) — the contact’s E.164 number.from(optional) — the WABA number that will be the sender. When omitted, the check spans any of your WABA numbers; when supplied it is scoped to that sender pair (matching the send-time gate).
Response
reason is one of:
| Reason | Meaning |
|---|---|
within_window | An inbound was received in the last 24 hours — free-form replies are allowed. |
window_expired | The last inbound is older than 24 hours — template-only. |
no_inbound_history | No inbound has ever been received from this contact — last_inbound_at and hours_since_last_inbound are null. |
within_window is false and you must fall back to an approved template message.
Send a Broadcast
Fan a single approved template out to up to 256 recipients in one operation (Meta’s documented broadcast-list cap). Each recipient receives a normal 1:1 conversation — there is no shared thread, so per-recipient STOP / opt-out handling is preserved. The endpoint is persist-then-attempt: every recipient is pre-inserted as apending row in one transaction before the per-recipient send pipeline runs, so a pre-create rejection (template not approved, parameter-count mismatch, 24-hour-window block, fraud guard, quota, sender validation) flips that row to failed rather than throwing without persisting a record.
recipients(required) — 1–256 entries, each with ato(E.164) and optional per-rowtemplate_params/metadata. Per-rowtemplate_paramsoverride the batch-level sharedtemplate_params. Duplicate numbers in one request are rejected (422).template_name(required) — an approved WhatsApp template.template_language,from,template_params,scheduled_at,webhook_url,metadata(optional) — shared across the batch. Withscheduled_atset, every recipient lands asscheduledfor the worker queue.
Response
Returns a per-recipient result array plus a summary. Inspectsummary.failed and each results[].status — the HTTP status code signals whether to look at the body.
| Status | When |
|---|---|
200 | Every recipient succeeded. |
207 | At least one recipient failed (partial or all-failed) — always inspect the body. |
402 | Org balance can’t cover the broadcast floor. |
429 | The recipient count would breach the WABA’s daily messaging_limit_tier cap. |
500 | Bulk pre-insert failed — no recipients were processed. |
Features
- Template messages — pre-approved message templates for outbound notifications
- Session messaging — free-form replies within the 24-hour conversation window, with a pre-flight window-status check
- Broadcast lists — fan one approved template out to up to 256 recipients with per-recipient results
- Rich media — images, videos, documents, audio, stickers, and location sharing
- Interactive messages — buttons, list pickers, and quick replies
- Read receipts — know when messages are delivered and read
- Catalog & product messages — share product listings directly in chat
Media Support
| Type | Max Size | Formats |
|---|---|---|
| Image | 5 MB | JPEG, PNG |
| Video | 16 MB | MP4, 3GPP |
| Document | 100 MB | PDF, DOC, XLSX, etc. |
| Audio | 16 MB | AAC, MP3, OGG |