The WhatsApp Templates API allows you to search, retrieve, and create WhatsApp Business message templates within your DMLY workspace.
Templates follow the official Meta WhatsApp Business API template structure and are used for:
Transactional notifications
Marketing campaigns
Authentication messages
Broadcast messaging
Automated workflows
Base URLhttps://api.dmly.io/api
AuthenticationAll endpoints require the x-api-key header:
x-api-key: YOUR_API_KEY
Endpoints
List WhatsApp TemplatesGET /v1/whatsapp-templatesSearch and list WhatsApp templates in a workspace with pagination support.
Query ParametersName | Type | Required | Description |
workspaceId | string | Yes | The workspace ID |
searchText | string | No | Filter templates by name |
page | number | No | Page number (default: 1) |
limit | number | No | Results per page (default: 10) |
Example Requestcurl -X GET "https://api.dmly.io/api/v1/whatsapp-templates?workspaceId=abc123xyz&page=1&limit=10" \
-H "x-api-key: YOUR_API_KEY"200 OK[
{
"id": "template_001",
"template": {
"category": "UTILITY",
"language": "en",
"name": "order_confirmation",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, this is a test message from {{2}}.\nYour reference number is {{3}}.",
"example": {
"body_text": [
["John", "MyCompany", "123456"]
]
}
},
{
"type": "FOOTER",
"text": "Reply STOP to unsubscribe from our updates."
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Learn more",
"url": "https://example.com"
}
]
}
]
},
"workspace": {
"id": "abc123xyz",
"title": "My Workspace"
},
"createdAt": "2026-02-18T11:36:58.308Z",
"updatedAt": "2026-02-18T11:36:58.308Z"
}
]GET /v1/whatsapp-templates/{templateId}Retrieve a specific WhatsApp template by its ID.
Path ParametersName | Type | Required | Description |
templateId | string | Yes | Unique template ID |
Example Requestcurl -X GET https://api.dmly.io/api/v1/whatsapp-templates/template_001 \
-H "x-api-key: YOUR_API_KEY"200 OK{
"id": "template_001",
"template": {
"category": "MARKETING",
"language": "en",
"name": "welcome_message",
"components": [
{
"type": "HEADER",
"format": "IMAGE",
"example": {
"header_handle": ["media_id_123"]
}
},
{
"type": "BODY",
"text": "Ready to transform your customer conversations? 🚀"
},
{
"type": "FOOTER",
"text": "Reply STOP to unsubscribe."
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Learn more",
"url": "https://example.com"
}
]
}
]
},
"workspace": {
"id": "abc123xyz",
"title": "My Workspace"
},
"createdAt": "2026-02-18T05:25:45.378Z",
"updatedAt": "2026-02-18T07:59:10.478Z"
}POST /v1/whatsapp-templateCreate a new WhatsApp template in a workspace.
Request BodyContent-Type: application/json
Field | Type | Required | Description |
workspace | object | Yes | Must contain |
template | object | Yes | Meta WhatsApp template structure |
Example Requestcurl -X POST https://api.dmly.io/api/v1/whatsapp-template \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"template": {
"category": "UTILITY",
"language": "en",
"name": "order_notification",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, this is a system notification from {{2}}. Your temporary code is {{3}}.",
"example": {
"body_text": [
["John", "MyCompany", "789012"]
]
}
},
{
"type": "FOOTER",
"text": "This is an automated message."
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "View Details",
"url": "https://example.com"
}
]
}
]
},
"workspace": {
"id": "abc123xyz"
}
}'201 Created{
"id": "template_002",
"status": "PENDING",
"createdAt": "2026-02-20T09:00:00.000Z"
}{
"id": "string",
"template": {
"category": "UTILITY | MARKETING | AUTHENTICATION",
"language": "string",
"name": "string",
"status": "APPROVED | PENDING | REJECTED",
"components": [
{
"type": "HEADER | BODY | FOOTER | BUTTONS",
"format": "TEXT | IMAGE | VIDEO | DOCUMENT",
"text": "string",
"example": {
"header_handle": ["string"],
"body_text": [["string"]]
},
"buttons": [
{
"type": "URL | QUICK_REPLY | PHONE_NUMBER",
"text": "string",
"url": "string"
}
]
}
]
},
"workspace": {
"id": "string",
"title": "string"
},
"createdAt": "string (ISO 8601)",
"updatedAt": "string (ISO 8601)"
}{
"template": {
"category": "UTILITY | MARKETING | AUTHENTICATION",
"language": "string",
"name": "string",
"components": [
{
"type": "HEADER | BODY | FOOTER | BUTTONS",
"format": "TEXT | IMAGE | VIDEO | DOCUMENT",
"text": "string",
"example": {
"header_handle": ["string"],
"body_text": [["string"]]
},
"buttons": [
{
"type": "URL | QUICK_REPLY | PHONE_NUMBER",
"text": "string",
"url": "string"
}
]
}
]
},
"workspace": {
"id": "string"
}
}Templates follow the official Meta WhatsApp Business API template structure.
CategoriesUTILITY
MARKETING
AUTHENTICATION
ComponentsA template may contain:
HEADER (optional)
TEXT, IMAGE, VIDEO, DOCUMENT
BODY (required)
Main message content
Supports dynamic variables: {{1}}, {{2}}, etc.
FOOTER (optional)
BUTTONS (optional)
URL
QUICK_REPLY
PHONE_NUMBER
Maximum of 3 buttons
VariablesDynamic placeholders must follow:
{{1}}, {{2}}, {{3}}Examples must be provided inside the example field.
Important NotesTemplate names must be unique within a workspace.
Templates require Meta approval before they can be used.
Marketing templates typically require opt-out language.
All variables must have corresponding example values.
Buttons are limited to 3 per template.
Changes to approved templates require re-approval.
Security Best PracticesNever expose x-api-key on frontend applications.
Use server-side integrations only.
Monitor template approval status before sending.
Log template creation attempts.
Validate workspace ownership before template creation.