Send Template Message (V2)
POSThttps://public.leadpattern.com/v2/whatsapp/message/template
Send approved templates with named key-value placeholders instead of positional strings. Recommended for clarity. Each message item can also include an optional "scheduledAt" (ISO date-time) to send at a future time instead of immediately. Media headers use the same templateData.header shape as the v1 endpoint (type, mediaUrl, and — for a DOCUMENT header only — filename, e.g. "invoice.pdf", so WhatsApp shows a readable file name instead of a generic one).
- v2 body placeholders are named — an array of { variableName: value } objects.
- Supports carousel templates through content.templateData.cards.
- Pass scheduledAt (future ISO date-time) to schedule instead of sending now.
Headers
1 fieldAuthorizationstringrequired
Your API key. Sent raw (e.g. 'lp_...'). No Bearer prefix required.
Body Parameters
1 fieldmessagesarray of objectsrequired
Batch of template messages (non-empty).
tostringrequired
Recipient phone number in E.164 format (with country code).
contentobjectrequired
Responses
JSON Response
{
"type": "success",
"data": {
"messages": [
{
"status": "SENT",
"recipient": "9195XXXXXXXX",
"messageId": "wamid.abc123"
}
]
}
}Sample Request Body
{
"messages": [
{
"to": "+9195XXXXXXXX",
"content": {
"templateName": "order_confirmation",
"language": "en",
"templateData": {
"body": {
"placeholders": [
{
"name": "John"
},
{
"order_id": "ORD-1234"
}
]
}
}
}
}
]
}
