API Reference v1.0

Send Message

Send a text or interactive message to a WhatsApp user. Supports plain text messages and rich interactive messages with headers, footers, and reply buttons.

POST https://whatsbizapi.com/api/wpbox/sendmessage

Sends a text-based message to a single recipient. You can optionally include a header, footer, and up to 3 quick-reply buttons to create an interactive message.

Text messages can only be sent within the 24-hour customer service window (after the customer messages you first). To send messages outside this window, use the Send Template endpoint instead.

Parameters

Parameter Type Description
token required string Your API authentication token. Found in your dashboard under Settings → API.
phone required string Recipient phone number with country code. E.g., +919876543210. Do not include spaces or dashes.
message required string The message text to send. Supports WhatsApp formatting: *bold*, _italic_, ~strikethrough~, ```monospace```.
header optional string Header text displayed above the message body. When provided, the message is sent as an interactive message.
footer optional string Footer text displayed below the message body in a smaller font.
buttons optional array Array of quick-reply button objects (maximum 3). Each object must have an id and title property. Button titles have a 20-character limit.

Examples

Simple Text Message

Send a basic text message to a recipient within the 24-hour service window.

cURL
curl -X POST https://whatsbizapi.com/api/wpbox/sendmessage \ -H "Content-Type: application/json" \ -d '{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "message": "Hello! Your order has been confirmed." }'
Request Body
{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "message": "Hello! Your order has been confirmed." }
Response 200
{ "status": "success", "message_id": 123, "message_wamid": "wamid.HBgNOTE5ODc2NTQzMjEwFQIAERgSMEI4..." }

Interactive Message with Buttons

Send a rich interactive message with a header, footer, and quick-reply buttons. Users can tap buttons to respond instantly.

cURL
curl -X POST https://whatsbizapi.com/api/wpbox/sendmessage \ -H "Content-Type: application/json" \ -d '{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "message": "Your order #12345 is ready for delivery. Would you like to proceed?", "header": "Order Update", "footer": "Reply within 24 hours", "buttons": [ {"id": "confirm", "title": "Confirm Delivery"}, {"id": "reschedule", "title": "Reschedule"}, {"id": "cancel", "title": "Cancel Order"} ] }'
Request Body
{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "message": "Your order #12345 is ready for delivery. Would you like to proceed?", "header": "Order Update", "footer": "Reply within 24 hours", "buttons": [ { "id": "confirm", "title": "Confirm Delivery" }, { "id": "reschedule", "title": "Reschedule" }, { "id": "cancel", "title": "Cancel Order" } ] }
Response 200
{ "status": "success", "message_id": 124, "message_wamid": "wamid.HBgNOTE5ODc2NTQzMjEwFQIAERgSNEQ3..." }

Error Responses

Error Response 400
{ "status": "error", "message": "The phone field is required." }
Error Response 401
{ "status": "error", "message": "Invalid API token." }
Error Response 400
{ "status": "error", "message": "Message sending failed: outside 24-hour service window. Use a template message instead." }

Notes

24-Hour Service Window: WhatsApp enforces a customer service window. You can only send free-form text messages within 24 hours of the customer's last message to you. After this window closes, you must use approved template messages.

Interactive Messages: When you include a header, footer, or buttons parameter, the message is automatically sent as an interactive message. You can use up to 3 reply buttons, and each button title must be 20 characters or fewer.

Phone Number Format: Always include the full international country code with a + prefix. For example, use +919876543210 for an Indian number or +14155552671 for a US number. Do not include spaces, dashes, or parentheses.