curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"components": [
{
"parameters": [
{
"text": "John",
"type": "text"
}
],
"type": "body"
}
],
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
components: [{parameters: [{text: 'John', type: 'text'}], type: 'body'}],
language: 'en_US',
template_name: 'order_confirmation',
to: '15551234567'
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{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/{id}/send-template"
payload = {
"components": [
{
"parameters": [
{
"text": "John",
"type": "text"
}
],
"type": "body"
}
],
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"contacts": [
{
"input": "15551234567",
"wa_id": "15551234567"
}
],
"message_id": "sapi_dm_TT974YVQH4RAHNN2HY2DJSNY9111D7LMTP1XXPCVQVL",
"messages": [
{
"id": "wamid.HBgLMTU1NTEyMzQ1NjcVAgARGBI...",
"message_status": "accepted"
}
],
"messaging_product": "whatsapp"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}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/{id}/send-template \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"components": [
{
"parameters": [
{
"text": "John",
"type": "text"
}
],
"type": "body"
}
],
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
components: [{parameters: [{text: 'John', type: 'text'}], type: 'body'}],
language: 'en_US',
template_name: 'order_confirmation',
to: '15551234567'
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{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/{id}/send-template"
payload = {
"components": [
{
"parameters": [
{
"text": "John",
"type": "text"
}
],
"type": "body"
}
],
"language": "en_US",
"template_name": "order_confirmation",
"to": "15551234567"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"contacts": [
{
"input": "15551234567",
"wa_id": "15551234567"
}
],
"message_id": "sapi_dm_TT974YVQH4RAHNN2HY2DJSNY9111D7LMTP1XXPCVQVL",
"messages": [
{
"id": "wamid.HBgLMTU1NTEyMzQ1NjcVAgARGBI...",
"message_status": "accepted"
}
],
"messaging_product": "whatsapp"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Authorizations
Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...
Path Parameters
Connected account ID (sapi_acc_...)
Body
Recipient, template name, language, and components
Components carries header/body/button variable substitutions. Each component matches WhatsApp's template component schema (type + parameters).
Show child attributes
Show child attributes
Language is the BCP-47 code matching the template's approved language (e.g. en_US, fr_FR).
"en_US"
TemplateName is the approved template name to send.
"order_confirmation"
To is the recipient phone number in E.164 format without the leading "+".
"15551234567"
Response
Message accepted by WhatsApp
Contacts maps the input phone number to its canonical WhatsApp ID.
Show child attributes
Show child attributes
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"
Messages contains one entry per delivered message, with its platform ID.
Show child attributes
Show child attributes
MessagingProduct is always "whatsapp".
"whatsapp"