List Templates
Retrieve all WhatsApp message templates created under your organisation, including each template's components, variables, language, category, and approval status.
Use this to discover the exact templateName and language values required by
Send Message.
Authentication Required
Requires the x-api-key header. See Overview for details.
HTTP Request
GET /api/dragonfly/whatsapp/message_templates
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
refresh | string | No | Pass true to bypass the cache and fetch the latest template list from Meta. |
Responses are cached
Template lists are served from a cache. If you just created or edited a template and
don't see the change, call this endpoint with ?refresh=true.
Try it
Loading playground…
Code Examples
- cURL
- JavaScript
- Python
curl -X GET "https://prod-api.superfone.co.in/superfone/api/dragonfly/whatsapp/message_templates" \
-H "x-api-key: your_api_key_here"
const response = await fetch(
'https://prod-api.superfone.co.in/superfone/api/dragonfly/whatsapp/message_templates',
{ headers: { 'x-api-key': process.env.SF_API_KEY } }
);
const result = await response.json();
const approved = result.data.data.filter(t => t.status === 'APPROVED');
console.log(approved.map(t => `${t.name} (${t.language})`));
import os
import requests
url = 'https://prod-api.superfone.co.in/superfone/api/dragonfly/whatsapp/message_templates'
headers = {'x-api-key': os.environ['SF_API_KEY']}
response = requests.get(url, headers=headers)
response.raise_for_status()
templates = response.json()['data']['data']
for t in templates:
print(t['name'], t['language'], t['status'])
Success Response
Status Code: 200 OK
{
"data": {
"data": [
{
"name": "after_setup_meet",
"parameter_format": "POSITIONAL",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Hi {{1}}",
"example": { "header_text": ["Garima"] }
},
{
"type": "BODY",
"text": "*During our meeting, we completed:* {{1}}\n\n*Pending :* {{2}}\n\n…",
"example": { "body_text": [["ab", "csd", "fref"]] }
},
{
"type": "FOOTER",
"text": "SUPERFONE SUCCESS TEAM"
}
],
"language": "en",
"status": "APPROVED",
"category": "MARKETING",
"id": "1056927135857721"
}
]
},
"message": "success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
data.data[] | object[] | Array of template objects |
data.data[].id | string | Meta template ID — use with Get Template by ID |
data.data[].name | string | Template name — the templateName for Send Message |
data.data[].language | string | Language code — pass this exact value as language when sending (en ≠ en_US) |
data.data[].status | string | Approval status: APPROVED, PENDING, REJECTED, … Only APPROVED templates can be sent |
data.data[].category | string | MARKETING, UTILITY, or AUTHENTICATION |
data.data[].parameter_format | string | POSITIONAL (variables numbered {{1}}, {{2}}, …) or NAMED (variables like {{name}}, with example.body_text_named_params) |
data.data[].components[] | object[] | Template structure: HEADER, BODY, FOOTER, BUTTONS, each with its text and example values |
Error Responses
| Status | Message | When it occurs |
|---|---|---|
400 | (Meta error message) | Meta rejected the template fetch (e.g. account/permission issue) |
401 | UnAuthorized, Please Provide Valid API Key | Missing or invalid x-api-key |
Related Endpoints
- Get Template by ID — fetch a single template
- Send Message — send an approved template