curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/send-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567",
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "John"
}
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language: 'en_US',
template_name: 'order_confirmation',
to: '15551234567',
components: [{type: 'body', parameters: [{type: 'text', text: 'John'}]}]
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/send-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/send-template"
payload = {
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567",
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "John"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"contacts": [
{
"input": "15551234567",
"wa_id": "15551234567"
}
],
"messages": [
{
"id": "wamid.HBgLMTU1NTEyMzQ1NjcVAgARGBI...",
"message_status": "accepted"
}
],
"messaging_product": "whatsapp",
"message_id": "sapi_dm_TT974YVQH4RAHNN2HY2DJSNY9111D7LMTP1XXPCVQVL"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}Send a template message
Sends an approved WhatsApp template message to a recipient phone number. Template messages can be sent outside the 24-hour customer service window. The template must already be APPROVED on the WABA, and the language code must match an approved variant. Component parameter order must match the template’s placeholders. The response includes message_id, the SocialAPI message ID for the send, which matches the id field on the dm.status.* webhooks for this message.
curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/send-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567",
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "John"
}
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language: 'en_US',
template_name: 'order_confirmation',
to: '15551234567',
components: [{type: 'body', parameters: [{type: 'text', text: 'John'}]}]
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/send-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/send-template"
payload = {
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567",
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "John"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"contacts": [
{
"input": "15551234567",
"wa_id": "15551234567"
}
],
"messages": [
{
"id": "wamid.HBgLMTU1NTEyMzQ1NjcVAgARGBI...",
"message_status": "accepted"
}
],
"messaging_product": "whatsapp",
"message_id": "sapi_dm_TT974YVQH4RAHNN2HY2DJSNY9111D7LMTP1XXPCVQVL"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}Authorizations
Body
Recipient, template name, language, and components
Response
Message accepted by WhatsApp
MessageID is the SocialAPI message ID for the send, matching the "id" field on the dm.status.* webhooks for this message. Empty when WhatsApp returned no wamid or no canonical wa_id, since an ID built from half the pair would collide across conversations.
"sapi_dm_TT974YVQH4RAHNN2HY2DJSNY9111D7LMTP1XXPCVQVL"