Send WhatsApp
Send a WhatsApp message to a phone number. Required: phone_number, message. Optional: from, lead_id (enables merge fields in message), placeholder_policy, conversation_id, agent_id, media_urls. If template_required: true (outside 24h), use whatsappTemplate.
With lead_id, merge tokens: {{lead.name}}, {{lead.first_name}}, {{lead.email}}, {{lead.phone}}, {{lead.position}}, {{lead.company}}, {{lead.notes}}, {{lead.metadata.<path>}}, {{site.name}} (double braces only).
Input Schema
| Parameter | Type | Description |
|---|---|---|
| phone_number | string | Recipient phone in international format (e.g. +1234567890, no spaces) |
| message | string | Message text (merge fields when lead_id is set) |
| from | string | Sender display name |
| lead_id | string | Lead UUID for tracking and merge fields |
| conversation_id | string | Conversation UUID (used for 24h window check) |
| agent_id | string | Agent UUID for tracking |
| responseWindowEnabled | boolean | If true, skip template check and send as within 24h window |
| placeholder_policy | string | strip_tokens or skip_recipient for unknown {{...}} tokens |
REST Endpoint
POST /api/agents/tools/sendWhatsAppThe site_id field is required when calling via REST.
POST /api/agents/tools/sendWhatsApp
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"site_id": "YOUR_SITE_ID",
"phone_number": "+1234567890",
"message": "Hi! How can we help you today?",
"from": "Support Team",
"conversation_id": "CONVERSATION_UUID"
}Response (within 24h window):
{
"success": true,
"status": "sent",
"message_id": "...",
"within_response_window": true
}Response (outside 24h window):
{
"success": true,
"template_required": true,
"within_response_window": false,
"hours_elapsed": 36
}When template_required: true, use the whatsappTemplate tool to send the message via a template.
Last updated on