Use the Template API to send an approved WhatsApp template message to a single lead programmatically via a POST request. Messages sent via this API are recorded in the chat history, ensuring that agents have full context if the lead responds.
https://service.tailortalk.ai/api/v1/send_whatsapp_template_message
| Key | Value |
|---|---|
| Authorization | Agent <token> |
You can find the agent_token in your TailorTalk dashboard under Manage Agent.

| 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. |
| websitebuttonparams | ❌ | List of dynamic URL suffix values for URL buttons that have {{1}} in their URL. Values are matched in order of button appearance. |
| copycodebutton_params | ❌ | Coupon code string for the Copy Code button. |
| headermediaurl | ❌ | Dynamic media URL for template header (image, document, video). Supported for media templates. |
| headermedianame | ❌ | Explicit filename for template header document. Falls back to name from URL if not provided. |
{
"lead_contact": "9816923811",
"lead_name": "Shiva",
"template_name": "order_update",
"template_params": ["OD1234", "Delhi"]
}
{
"lead_contact": "9816923811",
"lead_name": "Shiva",
"template_name": "order_update",
"template_params": {
"order_id": "OD1234",
"city": "Delhi"
}
}
If your template has dynamic URL buttons and/or a Copy Code button:
{
"lead_contact": "9816923811",
"lead_name": "Shiva",
"template_name": "promo_template",
"template_params": {
"name": "Shiva",
"order_id": "OD1234"
},
"website_button_params": ["shiva123", "order/OD1234"],
"copy_code_button_params": "SAVE20"
}
Note:
website_button_paramsvalues are appended to the dynamic URL in order. For example, if your template has a button URLhttps://example.com/track/{{1}}and you pass["OD1234"], the final URL becomeshttps://example.com/track/OD1234. Static URL buttons (without{{1}}) do not need any parameters.
If your template has a media header (Image or Document):
{
"lead_contact": "9816923811",
"template_name": "event_invite",
"template_params": ["Annual Gala", "March 25th"],
"header_media_url": "https://example.com/invitation_card.jpg",
"header_media_name": "invitation.jpg"
}
Note:
header_media_nameis especially useful for Document templates where you want to specify the filename that the user sees when they download the document. If not provided, TailorTalk will try to extract the name from the URL.