I have a new feature I am trying to test, and so created a new test template directly on Meta as their UI is more convenient.
However I am getting error Failed to send freeform message because you are outside the allowed window. If you are using WhatsApp, please use a Message Template.
I investigated matched by copy/pasting/search ensuring it is identical, compared string length and it is identical.
Finally - I noticed that Twilio WA templates list still does not show the new template, even after an hour of reading and refreshing the page.
Is there any way to force a pull from Meta/WA? How frequently does it refresh?
Also a side question - is there an API to create/update those WA templates from Twilio side? We may want to integrate this into our platform and business needs.
At the moment, Twilio doesn't synchronize WhatsApp message templates with Meta (aka Facebook). This means if you create a new template directly on Meta, it won't automatically appear in your Twilio WhatsApp template list.
Therefore, it is generally recommended to create and manage your templates directly on the Twilio platform (via the Content Template Builder) to avoid synchronization issues. It ensures the templates are immediately available in Twilio after they get approved by WhatsApp.
For your second question, yes, Twilio provides an API endpoint to create or update WhatsApp message templates programmatically.
curl -X POST 'https://content.twilio.com/v1/Content' \
-H 'Content-Type: application/json' \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
-d '{
"friendly_name": "flight_replies",
"language": "en",
"variables": {"1":"Owl Air Customer"},
"types": {
"twilio/quick-reply": {
"body": "Hi, {{1}} 👋 \nThanks for contacting Owl Air Support. How can I help?",
"actions": [
{
"title": "Check flight status",
"id": "flightid1"
},
{
"title": "Check gate number",
"id": "gateid1"
},
{
"title": "Speak with an agent",
"id": "agentid1"
}
]
},
"twilio/text": {
"body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?."
}
}
}'