Edit a message template
curl --request PUT \
--url https://api.social-api.ai/v1/platforms/whatsapp/templates/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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."
}
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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.'
}
]
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/templates/{template_id}', 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/{template_id}"
payload = { "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."
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"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
Edit a message template
Updates the components of an existing message template by its WhatsApp template ID. Only APPROVED, REJECTED or PAUSED templates can be edited. Meta reviews the edit again: an edited APPROVED or PAUSED template returns to APPROVED unless it fails review. Meta allows an approved template 1 edit per 24 hours and 10 per 30 days.
PUT
/
platforms
/
whatsapp
/
templates
/
{template_id}
Edit a message template
curl --request PUT \
--url https://api.social-api.ai/v1/platforms/whatsapp/templates/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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."
}
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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.'
}
]
})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/templates/{template_id}', 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/{template_id}"
payload = { "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."
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"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
Replacement components
Response
Template updated