Messaging API Endpoints
Complete API reference for messaging endpoints.
Send Message
Send a message via any channel (WhatsApp, SMS, Email, IVR).
POST /api/messages/send
Authorization: Bearer {token}
Content-Type: application/json
{
"channel": "whatsapp",
"to": "+919876543210",
"message": "Hello, this is a test message",
"template_id": "optional_template_id"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Channel: whatsapp, sms, email, ivr |
to | string | Yes | Recipient phone/email |
message | string | Yes | Message content |
template_id | string | No | Template ID (for WhatsApp) |
media_url | string | No | Media URL (for WhatsApp) |
Response
{
"success": true,
"message": "Message sent successfully",
"data": {
"id": "msg_123",
"status": "sent",
"channel": "whatsapp",
"to": "+919876543210"
}
}
Broadcast Message
Send a message to multiple recipients.
POST /api/messages/broadcast
Authorization: Bearer {token}
Content-Type: application/json
{
"channel": "whatsapp",
"recipients": ["+919876543210", "+919876543211"],
"message": "Broadcast message",
"segment_id": "optional_segment_id"
}
Response
{
"success": true,
"message": "Broadcast initiated",
"data": {
"campaign_id": "camp_123",
"total_recipients": 100,
"status": "queued"
}
}
Message History
Retrieve message history.
GET /api/messages/history
Authorization: Bearer {token}
Query Parameters
page: Page numberper_page: Items per pagechannel: Filter by channelstatus: Filter by statusdate_from: Start datedate_to: End date
Response
{
"success": true,
"data": {
"data": [
{
"id": "msg_123",
"channel": "whatsapp",
"to": "+919876543210",
"message": "Hello",
"status": "delivered",
"sent_at": "2024-01-01T00:00:00Z"
}
],
"current_page": 1,
"total": 100
}
}
Next Steps
Need help? Contact Support