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"
}
'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)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));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'components' => [
[
'parameters' => [
[
'text' => 'John',
'type' => 'text'
]
],
'type' => 'body'
]
],
'language' => 'en_US',
'template_name' => 'order_confirmation',
'to' => '15551234567'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template"
payload := strings.NewReader("{\n \"components\": [\n {\n \"parameters\": [\n {\n \"text\": \"John\",\n \"type\": \"text\"\n }\n ],\n \"type\": \"body\"\n }\n ],\n \"language\": \"en_US\",\n \"template_name\": \"order_confirmation\",\n \"to\": \"15551234567\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"components\": [\n {\n \"parameters\": [\n {\n \"text\": \"John\",\n \"type\": \"text\"\n }\n ],\n \"type\": \"body\"\n }\n ],\n \"language\": \"en_US\",\n \"template_name\": \"order_confirmation\",\n \"to\": \"15551234567\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"components\": [\n {\n \"parameters\": [\n {\n \"text\": \"John\",\n \"type\": \"text\"\n }\n ],\n \"type\": \"body\"\n }\n ],\n \"language\": \"en_US\",\n \"template_name\": \"order_confirmation\",\n \"to\": \"15551234567\"\n}"
response = http.request(request)
puts response.read_body{
"contacts": [
{
"input": "15551234567",
"wa_id": "15551234567"
}
],
"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": {}
}
}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.
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"
}
'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)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));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'components' => [
[
'parameters' => [
[
'text' => 'John',
'type' => 'text'
]
],
'type' => 'body'
]
],
'language' => 'en_US',
'template_name' => 'order_confirmation',
'to' => '15551234567'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template"
payload := strings.NewReader("{\n \"components\": [\n {\n \"parameters\": [\n {\n \"text\": \"John\",\n \"type\": \"text\"\n }\n ],\n \"type\": \"body\"\n }\n ],\n \"language\": \"en_US\",\n \"template_name\": \"order_confirmation\",\n \"to\": \"15551234567\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"components\": [\n {\n \"parameters\": [\n {\n \"text\": \"John\",\n \"type\": \"text\"\n }\n ],\n \"type\": \"body\"\n }\n ],\n \"language\": \"en_US\",\n \"template_name\": \"order_confirmation\",\n \"to\": \"15551234567\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/send-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"components\": [\n {\n \"parameters\": [\n {\n \"text\": \"John\",\n \"type\": \"text\"\n }\n ],\n \"type\": \"body\"\n }\n ],\n \"language\": \"en_US\",\n \"template_name\": \"order_confirmation\",\n \"to\": \"15551234567\"\n}"
response = http.request(request)
puts response.read_body{
"contacts": [
{
"input": "15551234567",
"wa_id": "15551234567"
}
],
"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": {}
}
}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