POST
/v1/whatsapp/messages/send
Send Message
Send a text message via WhatsApp
Send Message
Send a text message to a WhatsApp user.
Endpoint
POST /v1/whatsapp/messages/send
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {access_token} |
| Content-Type | application/json |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to |
string | Yes | Recipient phone number (E.164 format) |
message |
string | Yes | Message text (max 4096 characters) |
preview_url |
boolean | No | Enable URL preview (default: false) |
Example Request
curl -X POST https://api.apimw.com/v1/whatsapp/messages/send \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"message": "Hello! Thanks for contacting us. How can we help you today?",
"preview_url": true
}'
Response
Success Response (200 OK)
{
"success": true,
"data": {
"message_id": "wamid.HBgNNjI4MTU1NTc0NDU2FQIAERgSM0VGMDA0...",
"to": "+1234567890",
"status": "sent",
"timestamp": "2024-01-15T10:30:00Z"
}
}
Error Response (400 Bad Request)
{
"success": false,
"error": {
"code": "INVALID_PHONE_NUMBER",
"message": "The phone number format is invalid"
}
}
Message Status Flow
sent → delivered → read
Important Notes
- Phone numbers must be in E.164 format (e.g., +1234567890)
- Text messages can only be sent within the 24-hour customer service window
- Use template messages to initiate conversations
- Emojis and special characters are supported