Send Message
POST /api/external/send-message
Auth: Authorization: Bearer ck_<api_key> (required)
Request parameters
| Field | Required | Type | Description |
|---|---|---|---|
phoneNumberId | Yes | string | WhatsApp phone number ID to send from (must belong to your WABA) |
to | Yes | string | Recipient number with country code. Ten-digit Indian numbers are normalized to 91 prefix. |
type | Yes | string | text or template |
text / message | If type=text | string | Message body. Either field name is accepted. |
templateName | If type=template | string | Approved template name in Meta |
templateLanguage | If type=template | string | Template language code (e.g. en, en_US) |
templateVariables | No | array | Body variable values in order |
mediaUrl | No | string | Public URL for template media header |
buttonParameters | No | array | Template button components. Each item: type (url, quick_reply, phone_number, otp/copy_code, catalog), index, value |
contextMessageId | No | string | Meta message ID to reply in thread |
Response example
{
"success": true,
"message": "Message sent successfully",
"requestId": "req_1720856400000_abc123def",
"data": {
"messageId": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQjAwMDAwMDAwMDAwMDAwAA==",
"conversationId": 1001,
"status": "sent",
"to": "919876543210",
"type": "text",
"timestamp": "2026-07-13T07:00:00.000Z"
}
}If the message was delivered to Meta but database save failed, warning may be present and delivery tracking may be limited.
Code samples
curl -X POST https://chatyug.com/api/external/send-message \
-H "Authorization: Bearer ck_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "100000000000001",
"to": "919876543210",
"type": "template",
"templateName": "order_update",
"templateLanguage": "en",
"templateVariables": ["Rahul", "ORD-90001"]
}'const axios = require('axios');
await axios.post('https://chatyug.com/api/external/send-message', {
phoneNumberId: '100000000000001',
to: '919876543210',
type: 'template',
templateName: 'order_update',
templateLanguage: 'en',
templateVariables: ['Rahul', 'ORD-90001']
}, { headers: { Authorization: 'Bearer ck_your_api_key_here' } });import requests
requests.post('https://chatyug.com/api/external/send-message', json={
'phoneNumberId': '100000000000001',
'to': '919876543210',
'type': 'template',
'templateName': 'order_update',
'templateLanguage': 'en',
'templateVariables': ['Rahul', 'ORD-90001']
}, headers={'Authorization': 'Bearer ck_your_api_key_here'})$client = new GuzzleHttp\Client();
$client->post('https://chatyug.com/api/external/send-message', [
'headers' => ['Authorization' => 'Bearer ck_your_api_key_here'],
'json' => [
'phoneNumberId' => '100000000000001',
'to' => '919876543210',
'type' => 'template',
'templateName' => 'order_update',
'templateLanguage' => 'en',
'templateVariables' => ['Rahul', 'ORD-90001']
]
]);
Related webhook: After send, Meta pushes delivery updates to ChatYug, which forwards
eventType: status to your webhook URL (delivered, read, failed).