Skip to main content

Broadcast Messages

The Broadcast Messages feature enables you to send messages to multiple recipients efficiently while automatically handling WhatsApp API rate limits and providing real-time progress tracking.

Overview

Send the same message or personalized template messages to thousands of recipients with:
  • Intelligent Rate Limiting: Automatic compliance with WhatsApp’s 80 msg/sec and 1000 msg/min limits
  • Progress Tracking: Real-time updates on send status, success rate, and estimated completion time
  • Error Handling: Individual message failures don’t stop the entire broadcast
  • Batch Processing: Efficient chunked processing for optimal throughput
  • Abort Control: Stop broadcasts mid-process when needed

Use Cases

  • Order confirmations
  • Shipping updates
  • Delivery notifications
  • Cart abandonment reminders
  • Medical appointment confirmations
  • Service reminders
  • Event notifications
  • Promotional messages (using approved templates)
  • Product launches
  • Special offers
  • System status updates
  • Emergency alerts
  • Important announcements
  • Survey requests
  • Feedback collection
  • Service updates

Quick Start

Simple Text Broadcast

Personalized Template Broadcast

Advanced Usage

Progress Tracking

Monitor your broadcast in real-time:

Custom Batch Configuration

Abort Broadcast

Rate Limiting

The SDK automatically handles WhatsApp Business API rate limits:

How It Works

  1. Chunking: Large batches are split into chunks of 10 messages
  2. Throttling: Each message takes minimum 13ms (~77 msg/sec)
  3. Batch Delays: Automatic delays between batches to respect per-minute limits
  4. Sequential Processing: Chunks processed sequentially to prevent spikes

API Reference

sendBroadcast(phoneNumbers, message, options?)

Send the same message to multiple recipients. Parameters:
  • phoneNumbers (string[]): Array of recipient phone numbers
  • message (OutgoingMessage): Message object with type and content
  • options (BroadcastOptions): Optional configuration
Returns: Promise<BroadcastResult>

sendBroadcastText(phoneNumbers, text, options?)

Shorthand for sending text broadcasts. Parameters:
  • phoneNumbers (string[]): Array of recipient phone numbers
  • text (string): Message text
  • options (BroadcastOptions): Optional configuration
Returns: Promise<BroadcastResult>

sendBulkTemplates(recipients, templateName, languageCode, options?)

Send personalized template messages to multiple recipients. Parameters:
  • recipients (BroadcastRecipient[]): Recipients with variables
  • templateName (string): Approved template name
  • languageCode (string): Template language (e.g., β€˜en_US’)
  • options (BroadcastOptions): Optional configuration
Returns: Promise<BroadcastResult>

abortBroadcast()

Stop the currently running broadcast. Returns: void

isBroadcastRunning()

Check if a broadcast is currently in progress. Returns: boolean

Types

BroadcastOptions

BroadcastResult

BroadcastProgress

MessageSendResult

BroadcastRecipient

Best Practices

1. Use Templates for Marketing

Text messages only work within the 24-hour conversation window. For marketing or notifications outside this window, use approved message templates.

2. Handle Individual Failures

3. Respect User Preferences

4. Optimize Batch Size

5. Monitor and Log

Examples

Example 1: Simple Broadcast with Progress Tracking

Example 2: Detailed Message Tracking

Example 3: Personalized Template Broadcast

Template Setup Required: Before using template broadcasts, ensure your template is approved in WhatsApp Business Manager. Template approval can take 1-48 hours.

Limitations

Important Limitations
  1. 24-Hour Window: Text broadcasts require an active conversation window (user messaged you in last 24h). Use templates otherwise.
  2. Template Approval: Template messages must be pre-approved by Meta. This can take 1-48 hours.
  3. Rate Limits: While the SDK handles rate limiting, sending to 100k+ recipients will take considerable time (~20+ minutes).
  4. No Retry Logic: Currently, failed messages are not automatically retried. Implement your own retry logic if needed.
  5. Single Broadcast: Only one broadcast can run at a time per client instance.

Troubleshooting

Solution: The SDK should handle this automatically. If you’re still seeing errors:
  • Reduce batchSize option
  • Increase delayBetweenBatches
  • Ensure you’re not running multiple broadcasts simultaneously
Possible causes:
  • Invalid access token or phone number ID
  • Messages sent to users outside 24-hour window (use templates)
  • Phone numbers incorrectly formatted
This is normal: For 10,000 recipients at 80 msg/sec, expect ~2 minutes minimum. The SDK prioritizes delivery success over speed.

Migration Guide

If you’re upgrading from a previous version without broadcast support:

Next Steps

Template Messages

Learn about using pre-approved templates

Text Messages

Learn about basic text messaging

Error Handling

Handle errors and implement retry logic

Message Overview

Explore all available message types

Version

Broadcast feature added in version 1.6.0