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
E-commerce
E-commerce
- Order confirmations
- Shipping updates
- Delivery notifications
- Cart abandonment reminders
Appointments & Reminders
Appointments & Reminders
- Medical appointment confirmations
- Service reminders
- Event notifications
Marketing Campaigns
Marketing Campaigns
- Promotional messages (using approved templates)
- Product launches
- Special offers
Alerts & Notifications
Alerts & Notifications
- System status updates
- Emergency alerts
- Important announcements
Customer Service
Customer Service
- 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
- Chunking: Large batches are split into chunks of 10 messages
- Throttling: Each message takes minimum 13ms (~77 msg/sec)
- Batch Delays: Automatic delays between batches to respect per-minute limits
- 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 numbersmessage(OutgoingMessage): Message object with type and contentoptions(BroadcastOptions): Optional configuration
Promise<BroadcastResult>
sendBroadcastText(phoneNumbers, text, options?)
Shorthand for sending text broadcasts.
Parameters:
phoneNumbers(string[]): Array of recipient phone numberstext(string): Message textoptions(BroadcastOptions): Optional configuration
Promise<BroadcastResult>
sendBulkTemplates(recipients, templateName, languageCode, options?)
Send personalized template messages to multiple recipients.
Parameters:
recipients(BroadcastRecipient[]): Recipients with variablestemplateName(string): Approved template namelanguageCode(string): Template language (e.g., βen_USβ)options(BroadcastOptions): Optional configuration
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.- β Good
- β Avoid
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
Troubleshooting
Messages failing with rate limit errors
Messages failing with rate limit errors
Solution: The SDK should handle this automatically. If youβre still seeing errors:
- Reduce
batchSizeoption - Increase
delayBetweenBatches - Ensure youβre not running multiple broadcasts simultaneously
All messages failing immediately
All messages failing immediately
Possible causes:
- Invalid access token or phone number ID
- Messages sent to users outside 24-hour window (use templates)
- Phone numbers incorrectly formatted
Broadcast slower than expected
Broadcast slower than expected
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