Documentation

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

FieldTypeRequiredDescription
tostringYesRecipient phone number in E.164 without + (e.g. 919876543210)
typestringYesMessage type: text, template, image, document, video, audio
textobjectFor type=textText message body
templateobjectFor type=templateTemplate name, language, and components
imageobjectFor type=imageImage URL or uploaded file
documentobjectFor type=documentDocument URL or uploaded file
videoobjectFor type=videoVideo URL or uploaded file
captionstringNoCaption 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_LIMIT feature 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_EXCEL feature 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"
}
FieldDescription
successtrue when the message was accepted for delivery
message_idWhatsApp message ID — use this to track delivery via webhooks
statusaccepted means queued for delivery by Meta

Error Codes

StatusMessageCause
400"to" is requiredMissing recipient number
400Template not found or not approvedTemplate name doesn't exist or is pending approval
403Feature not available in your planBulk/media not in current plan
422Invalid phone number formatNumber not in E.164 format
429Rate limit exceededToo many requests — back off and retry