Messages API
Send messages across WhatsApp, Email, and SMS channels. Retrieve conversations and message history.
POST/whatsapp/send
Send a WhatsApp message using an approved template or freeform text (within 24h window).
POST /api/whatsapp/send
Content-Type: application/json
{
"to": "+919876543210",
"type": "template",
"template": {
"name": "welcome_message",
"language": "en",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "John" }
]
}
]
}
}
// Response
{
"success": true,
"data": {
"messageId": "msg_abc123",
"status": "SENT",
"timestamp": "2025-03-26T10:00:00Z"
}
}POST/email/send
Send an email to one or more recipients.
POST /api/email/send
Content-Type: application/json
{
"to": "[email protected]",
"subject": "Welcome to BeeCastly!",
"html": "<h1>Hello!</h1><p>Thanks for signing up.</p>",
"replyTo": "[email protected]"
}POST/sms/send
Send an SMS via your configured provider.
POST /api/sms/send
Content-Type: application/json
{
"to": "+14155551234",
"message": "Your OTP is 123456. Valid for 10 minutes."
}GET/conversations
List all conversations with pagination. Filter by channel.
GET /api/conversations?channel=WHATSAPP&page=1&limit=20
// Response
{
"success": true,
"data": {
"conversations": [
{
"id": "conv_abc123",
"contactId": "contact_def456",
"channel": "WHATSAPP",
"status": "ACTIVE",
"lastMessageAt": "2025-03-26T09:30:00Z",
"lastMessageText": "Thanks for the info!",
"aiEnabled": true,
"messageCount": 12
}
],
"total": 350
}
}GET/conversations/:id/messages
Retrieve all messages in a conversation.