List Templates
Overview
This API retrieves WhatsApp message templates from your Meta Business account. You can fetch all templates, filter by approval status, search by name, or paginate through large template sets.
Endpoint
GET https://client-api.wappcloud.com/api/v1/external/templatesHeaders
| Header | Description |
|---|---|
x-api-key | (Required) Your API Key for authentication |
Authorization | (Required) Bearer Token |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
TemplateName | string | No | Fetch a single template by exact name. Returns full component detail |
TemplateStatus | string | No | Filter by status: APPROVED, PENDING, REJECTED, or ALL |
limit | number | No | Number of templates to return (default: 1000) |
after | string | No | Cursor for the next page (from pagination.after in previous response) |
TemplateFields | string | No | Comma-separated list of Meta template fields to include |
Important:
TemplateNameandTemplateStatuscannot be used together. WhenTemplateNameis provided, the API returns full template detail (all components, variables, media URL). WithoutTemplateName, the API returns a summary list with status counts.
Setting Up in Postman
- Select the Params tab in Postman
- Add any of the query parameters listed above as key-value pairs
Requests
1. Get All Templates
Fetches all templates (up to 1000 by default). Returns a summary: name, status, category, and ID per template — plus status counts.
GET https://client-api.wappcloud.com/api/v1/external/templatesResponse:
{
"success": true,
"code": 200,
"message": "Template listed created",
"data": {
"messageTemplates": {
"templates": [
{
"name": "hello_world",
"status": "APPROVED",
"category": "UTILITY",
"_id": "1234567890123456"
},
{
"name": "order_confirmation",
"status": "APPROVED",
"category": "UTILITY",
"_id": "9876543210987654"
},
{
"name": "promo_launch",
"status": "PENDING",
"category": "MARKETING",
"_id": "1122334455667788"
}
],
"pagination": {
"before": "cursor_before_value",
"after": "cursor_after_value"
},
"statusCounts": [
{ "status": "APPROVED", "count": 2 },
{ "status": "PENDING", "count": 1 },
{ "status": "TOTAL", "count": 3 }
]
}
}
}2. Filter by Status — APPROVED
Returns only approved templates, ready to be used for sending messages.
GET https://client-api.wappcloud.com/api/v1/external/templates?TemplateStatus=APPROVED3. Filter by Status — PENDING
Returns templates currently under Meta review.
GET https://client-api.wappcloud.com/api/v1/external/templates?TemplateStatus=PENDING4. Filter by Status — REJECTED
Returns templates that Meta has rejected. Check Meta’s rejection reason in the Business Manager.
GET https://client-api.wappcloud.com/api/v1/external/templates?TemplateStatus=REJECTED5. Filter by Status — ALL (Explicit)
Same as fetching without any status filter. Returns templates of all statuses.
GET https://client-api.wappcloud.com/api/v1/external/templates?TemplateStatus=ALL6. Get Template by Name
Returns full template detail — all components, body text, variable examples, button definitions, and media URL (if applicable).
Use this when you need to inspect a specific template’s structure before sending.
GET https://client-api.wappcloud.com/api/v1/external/templates?TemplateName=order_confirmationResponse:
{
"success": true,
"code": 200,
"message": "Template listed created",
"data": {
"messageTemplates": [
{
"id": "9876543210987654",
"name": "order_confirmation",
"status": "APPROVED",
"category": "UTILITY",
"language": "en_US",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Hello {{1}}!"
},
{
"type": "BODY",
"text": "Hi {{1}}, your order #{{2}} has been confirmed. Expected delivery: {{3}}.",
"example": {
"body_text": [["Rahul", "ORD-9821", "Dec 25, 2024"]]
}
},
{
"type": "FOOTER",
"text": "WappCloud Orders"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Track Order",
"url": "https://track.wappcloud.com/{{1}}",
"example": ["https://track.wappcloud.com/ORD-9821"]
}
]
}
],
"variableCountBySection": {
"HEADER": 1,
"BODY": 3,
"BUTTONS": 1
}
}
]
}
}| Field | Description |
|---|---|
variableCountBySection | Number of dynamic variables per section (HEADER, BODY, BUTTONS) |
mediaUrl | S3 URL of the uploaded media (present for IMAGE/DOCUMENT/VIDEO headers only) |
7. Pagination — First Page
Use limit to control how many templates are returned per request.
GET https://client-api.wappcloud.com/api/v1/external/templates?limit=108. Pagination — Next Page
Take the after cursor from the previous response’s pagination.after field and pass it here.
GET https://client-api.wappcloud.com/api/v1/external/templates?limit=10&after=cursor_after_value9. Approved Templates with Pagination
GET https://client-api.wappcloud.com/api/v1/external/templates?TemplateStatus=APPROVED&limit=20Response Fields Reference
Summary List Response (no TemplateName)
| Field | Type | Description |
|---|---|---|
templates | array | List of template summary objects |
templates[].name | string | Template name |
templates[].status | string | APPROVED, PENDING, or REJECTED |
templates[].category | string | MARKETING, UTILITY, or AUTHENTICATION |
templates[]._id | string | Meta template ID |
pagination.before | string | Cursor to fetch the previous page |
pagination.after | string | Cursor to fetch the next page — pass as after query param |
statusCounts | array | Count of templates per status, plus a TOTAL entry |
Full Detail Response (with TemplateName)
| Field | Type | Description |
|---|---|---|
id | string | Meta template ID |
name | string | Template name |
status | string | Approval status |
category | string | Template category |
language | string | Language code |
components | array | Full component definitions (HEADER, BODY, FOOTER, BUTTONS) |
variableCountBySection | object | Number of variables in each section |
mediaUrl | string | S3 URL of the media (if IMAGE/DOCUMENT/VIDEO header) |
Error Responses
401 Unauthorized
{
"error": "Missing authToken or x-api-key"
}403 Forbidden
{
"error": "Invalid or inactive API key"
}Notes
- Template names must match exactly as stored in Meta — they are case-sensitive.
- The
aftercursor is returned only when there are more templates beyond the current page. - When
TemplateStatus=ALLor no status is passed, all templates regardless of status are returned. - Use
TemplateNameto get the component structure of a template before building a send-message payload.