Create a message template
curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "UTILITY",
"components": [
{
"type": "BODY",
"buttons": [
{
"type": "URL",
"example": {},
"phone_number": "+15551234567",
"text": "Visit",
"url": "https://example.com/{{1}}"
}
],
"example": {},
"format": "TEXT",
"text": "Hello {{1}}, your order {{2}} is confirmed."
}
],
"language": "en_US",
"name": "order_confirmation"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: 'UTILITY',
components: [
{
type: 'BODY',
buttons: [
{
type: 'URL',
example: {},
phone_number: '+15551234567',
text: 'Visit',
url: 'https://example.com/{{1}}'
}
],
example: {},
format: 'TEXT',
text: 'Hello {{1}}, your order {{2}} is confirmed.'
}
],
language: 'en_US',
name: 'order_confirmation'
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/templates', 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}/templates"
payload = {
"category": "UTILITY",
"components": [
{
"type": "BODY",
"buttons": [
{
"type": "URL",
"example": {},
"phone_number": "+15551234567",
"text": "Visit",
"url": "https://example.com/{{1}}"
}
],
"example": {},
"format": "TEXT",
"text": "Hello {{1}}, your order {{2}} is confirmed."
}
],
"language": "en_US",
"name": "order_confirmation"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"category": "UTILITY",
"id": "1234567890123456",
"status": "PENDING"
}{
"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"
}WhatsApp
Create a message template
Submits a new message template to the WhatsApp Business Account (WABA) for review. The request body is the raw WhatsApp Cloud API template payload (name, category, language, components). New templates start in PENDING status; Meta reviews them and the status transitions to APPROVED or REJECTED asynchronously.
POST
/
platforms
/
whatsapp
/
accounts
/
{account_id}
/
templates
Create a message template
curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "UTILITY",
"components": [
{
"type": "BODY",
"buttons": [
{
"type": "URL",
"example": {},
"phone_number": "+15551234567",
"text": "Visit",
"url": "https://example.com/{{1}}"
}
],
"example": {},
"format": "TEXT",
"text": "Hello {{1}}, your order {{2}} is confirmed."
}
],
"language": "en_US",
"name": "order_confirmation"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: 'UTILITY',
components: [
{
type: 'BODY',
buttons: [
{
type: 'URL',
example: {},
phone_number: '+15551234567',
text: 'Visit',
url: 'https://example.com/{{1}}'
}
],
example: {},
format: 'TEXT',
text: 'Hello {{1}}, your order {{2}} is confirmed.'
}
],
language: 'en_US',
name: 'order_confirmation'
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{account_id}/templates', 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}/templates"
payload = {
"category": "UTILITY",
"components": [
{
"type": "BODY",
"buttons": [
{
"type": "URL",
"example": {},
"phone_number": "+15551234567",
"text": "Visit",
"url": "https://example.com/{{1}}"
}
],
"example": {},
"format": "TEXT",
"text": "Hello {{1}}, your order {{2}} is confirmed."
}
],
"language": "en_US",
"name": "order_confirmation"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"category": "UTILITY",
"id": "1234567890123456",
"status": "PENDING"
}{
"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
application/json
Template definition
Response
Created template (initial status)