Validate a message template
curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/templates/validate \
--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/templates/validate', 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/templates/validate"
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){
"errors": [
{
"field": "name",
"message": "name must contain only lowercase letters, digits, and underscores (no spaces or capitals)",
"component_index": 0
}
],
"valid": true,
"warnings": [
{
"field": "name",
"message": "name must contain only lowercase letters, digits, and underscores (no spaces or capitals)",
"component_index": 0
}
]
}{
"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
Validate a message template
Dry-run validation of a WhatsApp message template against the Cloud API rules (name format, component cardinality, header format, text limits, placeholder sequencing, button constraints). Returns errors for hard violations that WhatsApp would reject and warnings for best-practice issues. Performs no network call and does not submit the template.
POST
/
platforms
/
whatsapp
/
templates
/
validate
Validate a message template
curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/templates/validate \
--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/templates/validate', 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/templates/validate"
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){
"errors": [
{
"field": "name",
"message": "name must contain only lowercase letters, digits, and underscores (no spaces or capitals)",
"component_index": 0
}
],
"valid": true,
"warnings": [
{
"field": "name",
"message": "name must contain only lowercase letters, digits, and underscores (no spaces or capitals)",
"component_index": 0
}
]
}{
"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 to validate
Response
Validation result