Skip to Content
The Makinari API repo now includes an MCP Server — connect your AI models directly. View on GitHub →
MCP ServerToolsSend WhatsAppPOST

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

ParameterTypeDescription
phone_numberstringRecipient phone in international format (e.g. +1234567890, no spaces)
messagestringMessage text (merge fields when lead_id is set)
fromstringSender display name
lead_idstringLead UUID for tracking and merge fields
conversation_idstringConversation UUID (used for 24h window check)
agent_idstringAgent UUID for tracking
responseWindowEnabledbooleanIf true, skip template check and send as within 24h window
placeholder_policystringstrip_tokens or skip_recipient for unknown {{...}} tokens

REST Endpoint

POST /api/agents/tools/sendWhatsApp

The 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