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

WhatsApp Template

WhatsApp templates are required when sending to a user more than 24 hours after their last message. Use action create_template first (phone_number, message); if it returns template_id, then use action send_template (template_id, phone_number, original_message) to deliver the message. If create_template returns template_required: false, the conversation is within the 24h window - use sendWhatsApp instead.

Input Schema

ParameterTypeDescription
actionstringcreate_template: check 24h window and create or find template, returns template_id when needed. send_template: send a message using an existing template_id. Enum: create_template, send_template
phone_numberstringRecipient phone in international format (required for both actions)
messagestringMessage content (required for create_template; used as template body)
template_idstringTemplate SID from create_template result (required for send_template)
conversation_idstringConversation UUID for 24h window check (optional for create_template)
fromstringSender name (optional)
original_messagestringOriginal message text for logging (optional for send_template)

REST Endpoint

POST /api/agents/tools/whatsapp-templates

Send a JSON body with the same parameters as the MCP input schema. The site_id field is required when calling via REST.

Step 1 — Create template:

POST /api/agents/tools/whatsapp-templates Authorization: Bearer YOUR_API_KEY Content-Type: application/json { "action": "create_template", "phone_number": "+1234567890", "message": "Hi! Following up on your inquiry.", "conversation_id": "CONVERSATION_UUID", "site_id": "YOUR_SITE_ID" }

Response when outside the 24h window:

{ "success": true, "template_id": "HXabc123...", "template_required": true }

Response when inside the 24h window:

{ "success": true, "template_required": false }

Step 2 — Send template (only when template_required: true):

POST /api/agents/tools/whatsapp-templates Authorization: Bearer YOUR_API_KEY Content-Type: application/json { "action": "send_template", "phone_number": "+1234567890", "template_id": "HXabc123...", "site_id": "YOUR_SITE_ID" }
Last updated on