Campaigns: Template API

Use the Template API to send an approved WhatsApp template message to a single lead programmatically. Messages sent via this API are recorded in the chat history, ensuring that agents have full context if the lead responds.

API Endpoint

https://service.tailortalk.ai/api/v1/send_whatsapp_template_message

Authentication

Headers

Key Value
Authorization Agent <token>

You can find the agent_token in your TailorTalk dashboard under Manage Agent.

Agent access token

Request Body

Parameter Required Description
lead_contact Lead contact number
lead_name Lead name (optional)
template_name WhatsApp template name
template_params Values for template variables. Use a list to match by order, or an object to match by name.

Example Request Body (Ordered Variables)

{
  "lead_contact": "9816923811",
  "lead_name": "Shiva",
  "template_name": "order_update",
  "template_params": ["OD1234", "Delhi"]
}

Example Request Body (Named Variables)

{
  "lead_contact": "9816923811",
  "lead_name": "Shiva",
  "template_name": "order_update",
  "template_params": {
    "order_id": "OD1234",
    "city": "Delhi"
  }
}

Notes

  • The template must be Approved in WhatsApp before it can be used.
  • Messages sent via this API will be visible in the lead's chat history.
  • If the lead responds, the agent will respond based on the template message context.
  • WhatsApp conversation charges apply.
XLinkedIn