Interactive Messages
POST /api/external/messages/interactive
Auth: Authorization: Bearer ck_<api_key> (required)
Request parameters
| Field | Required | Type | Description |
|---|---|---|---|
phoneNumberId | Yes | string | WhatsApp phone number ID |
to | Yes | string | Recipient with country code |
interactiveType | Yes | string | button (1โ3 buttons) or list |
bodyText | Yes | string | Message body (max 1024 characters) |
headerText | No | string | Header text (max 60 characters) |
footerText | No | string | Footer text (max 60 characters) |
buttons | If button | array | 1โ3 items: { id/payload, title/text } per button |
sections | If list | array | List sections: { title, rows: [{ id, title, description? }] } (max 10 rows per section) |
listButtonText | No | string | List open button label (default View options, max 20 chars) |
contextMessageId | No | string | Reply in thread to a prior message |
Response example
{
"success": true,
"message": "Interactive message sent",
"data": {
"messageId": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQjAwMDAwMDAwMDAwMDAwAA==",
"conversationId": 1001,
"interactiveType": "button"
}
}Code samples (button message)
curl -X POST https://chatyug.com/api/external/messages/interactive \
-H "Authorization: Bearer ck_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "100000000000001",
"to": "919876543210",
"interactiveType": "button",
"bodyText": "How can we help you today?",
"buttons": [
{ "id": "sales", "title": "Sales" },
{ "id": "support", "title": "Support" }
]
}'await axios.post('https://chatyug.com/api/external/messages/interactive', {
phoneNumberId: '100000000000001',
to: '919876543210',
interactiveType: 'button',
bodyText: 'How can we help you today?',
buttons: [
{ id: 'sales', title: 'Sales' },
{ id: 'support', title: 'Support' }
]
}, { headers: { Authorization: 'Bearer ck_your_api_key_here' } });requests.post('https://chatyug.com/api/external/messages/interactive', json={
'phoneNumberId': '100000000000001',
'to': '919876543210',
'interactiveType': 'button',
'bodyText': 'How can we help you today?',
'buttons': [
{'id': 'sales', 'title': 'Sales'},
{'id': 'support', 'title': 'Support'}
]
}, headers={'Authorization': 'Bearer ck_your_api_key_here'})$client->post('https://chatyug.com/api/external/messages/interactive', [
'headers' => ['Authorization' => 'Bearer ck_your_api_key_here'],
'json' => [
'phoneNumberId' => '100000000000001',
'to' => '919876543210',
'interactiveType' => 'button',
'bodyText' => 'How can we help you today?',
'buttons' => [
['id' => 'sales', 'title' => 'Sales'],
['id' => 'support', 'title' => 'Support']
]
]
]);
Related webhook: When the customer taps a button or list row, you receive
eventType: message with interactive.button_reply or interactive.list_reply in the Meta message object.