Send Message API
Complete reference for sending WhatsApp messages through the Chatbase API
Send Message
Send WhatsApp messages of any type — text, template, image, document, video, or audio — to any phone number.
Endpoint
POST /messages/send
Base URL: https://chatbase.in/api/v1/whatsapp
Authentication
Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number in E.164 without + (e.g. 919876543210) |
type | string | Yes | Message type: text, template, image, document, video, audio |
text | object | For type=text | Text message body |
template | object | For type=template | Template name, language, and components |
image | object | For type=image | Image URL or uploaded file |
document | object | For type=document | Document URL or uploaded file |
video | object | For type=video | Video URL or uploaded file |
caption | string | No | Caption for media messages |
Examples
Send a Text Message
curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"type": "text",
"text": { "body": "Hello! Your order has been confirmed." }
}'
await api.post('/messages/send', {
to: '919876543210',
type: 'text',
text: { body: 'Hello! Your order has been confirmed.' },
});
Send a Template Message
Use approved WhatsApp templates for outbound messages outside the 24-hour window:
curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"type": "template",
"template": {
"name": "order_shipped",
"language": { "code": "en_US" },
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "ORD-98765" },
{ "type": "text", "text": "2 days" }
]
}
]
}
}'
Send an Image
Upload the image as multipart/form-data or provide a public URL:
# Via public URL
curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"type": "image",
"image": { "link": "https://example.com/product.jpg" },
"caption": "Your ordered product — Model XYZ"
}'
# Via file upload
curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "to=919876543210" \
-F "type=image" \
-F "caption=Your invoice" \
-F "file=@/path/to/invoice.jpg"
Send a Document
curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"type": "document",
"document": { "link": "https://example.com/invoice.pdf" },
"caption": "Invoice #1234"
}'
Send Bulk Messages
Send the same message (or personalised messages) to multiple recipients.
POST /messages/send/bulk
Requires
BULK_MSG_LIMITfeature in your subscription plan.
curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send/bulk \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"recipients": ["919876543210", "919876543211", "919876543212"],
"type": "template",
"template": {
"name": "promo_offer",
"language": { "code": "en_US" }
}
}'
Bulk via Excel
Upload an Excel file (.xlsx) with a phone column to send personalised messages at scale.
POST /messages/send/bulk/excel
Requires
BULK_EXCELfeature in your subscription plan.
curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send/bulk/excel \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "customerExcel=@/path/to/customers.xlsx" \
-F "templateName=sale_alert" \
-F "language=en_US"
Get Message List
GET /messages
Returns paginated messages sent or received via your account.
curl "https://chatbase.in/api/v1/whatsapp/messages?page=1&limit=20" \
-H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Response
{
"success": true,
"message_id": "wamid.HBgLOTE5ODc2NTQzMjEwFQIAERgSM0E2QTI3RThCNTFFNTU2QzA4AA==",
"status": "accepted"
}
| Field | Description |
|---|---|
success | true when the message was accepted for delivery |
message_id | WhatsApp message ID — use this to track delivery via webhooks |
status | accepted means queued for delivery by Meta |
Error Codes
| Status | Message | Cause |
|---|---|---|
400 | "to" is required | Missing recipient number |
400 | Template not found or not approved | Template name doesn't exist or is pending approval |
403 | Feature not available in your plan | Bulk/media not in current plan |
422 | Invalid phone number format | Number not in E.164 format |
429 | Rate limit exceeded | Too many requests — back off and retry |