Send Message

POST /api/external/send-message

Auth: Authorization: Bearer ck_<api_key> (required)

Request parameters

FieldRequiredTypeDescription
phoneNumberIdYesstringWhatsApp phone number ID to send from (must belong to your WABA)
toYesstringRecipient number with country code. Ten-digit Indian numbers are normalized to 91 prefix.
typeYesstringtext or template
text / messageIf type=textstringMessage body. Either field name is accepted.
templateNameIf type=templatestringApproved template name in Meta
templateLanguageIf type=templatestringTemplate language code (e.g. en, en_US)
templateVariablesNoarrayBody variable values in order
mediaUrlNostringPublic URL for template media header
buttonParametersNoarrayTemplate button components. Each item: type (url, quick_reply, phone_number, otp/copy_code, catalog), index, value
contextMessageIdNostringMeta 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).