Broadcast Lists
Manage broadcast lists to send messages to multiple recipients at once.
Create Broadcast List
Create a new broadcast list with recipients.
POST /sessions/{id}/broadcasts
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Broadcast list name |
recipients | array | Yes | Array of phone numbers |
Example Request
curl -X POST http://localhost:3000/sessions/{id}/broadcasts \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing List",
"recipients": ["919988066776", "919876543210", "919123456789"]
}'
Response
{
"success": true,
"broadcast": {
"id": "broadcast_abc123",
"name": "Marketing List",
"recipientCount": 3
}
}
Get All Broadcast Lists
Get all broadcast lists for a session.
GET /sessions/{id}/broadcasts
Example Request
curl -H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/broadcasts
Response
{
"success": true,
"broadcasts": [
{
"id": "broadcast_abc123",
"name": "Marketing List",
"recipientCount": 3,
"createdAt": "2026-01-28T10:00:00.000Z"
}
]
}
Get Broadcast List Details
Get details of a specific broadcast list.
GET /sessions/{id}/broadcasts/{broadcastId}
Example Request
curl -H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/broadcasts/broadcast_abc123
Response
{
"success": true,
"broadcast": {
"id": "broadcast_abc123",
"name": "Marketing List",
"recipients": [
"919988066776",
"919876543210",
"919123456789"
],
"createdAt": "2026-01-28T10:00:00.000Z"
}
}
Update Broadcast List
Update a broadcast list's name or recipients.
PUT /sessions/{id}/broadcasts/{broadcastId}
Request Body
{
"name": "Updated List Name",
"recipients": ["919988066776", "919876543210"]
}
Example Request
curl -X PUT http://localhost:3000/sessions/{id}/broadcasts/broadcast_abc123 \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated List Name",
"recipients": ["919988066776", "919876543210"]
}'
Delete Broadcast List
Delete a broadcast list.
DELETE /sessions/{id}/broadcasts/{broadcastId}
Example Request
curl -X DELETE \
-H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/broadcasts/broadcast_abc123
Send to Broadcast List
Send a message to all recipients in a broadcast list.
POST /sessions/{id}/broadcasts/{broadcastId}/send
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Message text |
type | string | No | Message type (text, image, video, etc.) |
media | string | No | Media URL (for image/video/document) |
caption | string | No | Media caption |
Example Request (Text)
curl -X POST http://localhost:3000/sessions/{id}/broadcasts/broadcast_abc123/send \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello everyone! This is a broadcast message."
}'
Example Request (Image)
curl -X POST http://localhost:3000/sessions/{id}/broadcasts/broadcast_abc123/send \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"type": "image",
"media": "https://example.com/image.jpg",
"caption": "Check out this offer!"
}'
Response
{
"success": true,
"broadcast": {
"id": "broadcast_abc123",
"totalRecipients": 3,
"sent": 3,
"failed": 0
},
"results": [
{
"to": "919988066776",
"status": "sent",
"messageId": "3EB0ABC123456789"
},
{
"to": "919876543210",
"status": "sent",
"messageId": "3EB0ABC123456790"
},
{
"to": "919123456789",
"status": "sent",
"messageId": "3EB0ABC123456791"
}
]
}
Best Practices
1. Message Delays
The API automatically adds delays between messages to avoid rate limiting:
- Default: 1-3 seconds between messages
- Configurable via environment variables
2. Recipient Limits
- Keep broadcast lists under 100 recipients
- For larger lists, split into multiple broadcasts
- Monitor rate limits
3. Personalization
For personalized messages, use individual sends instead of broadcasts:
# Instead of broadcast, loop through recipients
for recipient in recipients:
send_message(recipient, personalized_message)
4. Tracking
Each message in a broadcast gets a unique messageId for tracking delivery status via webhooks.
Broadcasts respect rate limits. If you have 30 messages/minute limit and 100 recipients, the broadcast will take ~4 minutes to complete.