Getting Started
Send your first WhatsApp message in 5 minutes using the Chatbase HTTP API
Getting Started
Welcome to the Chatbase API. This guide will get you from zero to sending your first WhatsApp message in under 5 minutes.
Prerequisites
Before you begin you need:
- A Chatbase account — Sign up free
- An active WhatsApp Business API connection (set up via the CRM dashboard under Integrations)
- At least one approved message template if you are messaging users outside the 24-hour window
Step 1 — Create an API Client
Go to your CRM dashboard → API Manage and click Create API Client.
Give it a name (e.g. my-app-server) and optionally restrict it to specific IP addresses or routes. Once created, copy the API key — it is shown only once.
wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Step 2 — Authenticate
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Step 3 — Send Your First Message
Send a template message to a phone number:
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": "hello_world",
"language": { "code": "en_US" }
}
}'
A successful response looks like:
{
"success": true,
"message_id": "wamid.HBgLOTE5ODc2NTQzMjEwFQIAERgSM0E2QTI3RThCNTFFNTU2QzA4AA==",
"status": "accepted"
}
Step 4 — Send a Plain Text Message
Within the 24-hour customer service window (after a user messages you first) you can send free-form text:
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! How can I help you today?" }
}'
Phone Number Format
Always send phone numbers in E.164 format without the leading +:
| Country | Correct | Incorrect |
|---|---|---|
| India | 919876543210 | +91-987-654-3210 |
| US | 14155550100 | +1 (415) 555-0100 |
| UK | 447911123456 | +44 7911 123456 |
What's Next?
- Authentication — API key security and key management
- Send Message API — Full reference for all message types
- Message Templates — Create and manage templates
- Webhooks — Receive delivery receipts and inbound messages
- Your First Message Guide — Detailed walkthrough with JavaScript examples