curl -X GET "https://api.whaapy.com/templates/v1" \
-H "Authorization: Bearer wha_xxxxx"
{
"data": [
{
"id": "tmpl-uuid-1",
"name": "order_confirmation",
"category": "UTILITY",
"language": "es_MX",
"status": "APPROVED",
"content": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado.",
"variables": ["{{1}}", "{{2}}"],
"components": [
{
"type": "BODY",
"text": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado.",
"example": {
"body_text": [["Juan", "12345"]]
}
}
],
"createdAt": "2026-01-15T10:00:00Z",
"updatedAt": "2026-01-15T10:00:00Z"
},
{
"id": "tmpl-uuid-2",
"name": "welcome_message",
"category": "MARKETING",
"language": "es_MX",
"status": "APPROVED",
"content": "¡Bienvenido {{1}}! Gracias por contactarnos.",
"variables": ["{{1}}"],
"components": [
{
"type": "HEADER",
"format": "IMAGE"
},
{
"type": "BODY",
"text": "¡Bienvenido {{1}}! Gracias por contactarnos."
},
{
"type": "FOOTER",
"text": "Equipo de Soporte"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Ver catálogo"
},
{
"type": "URL",
"text": "Visitar web",
"url": "https://ejemplo.com"
}
]
}
],
"createdAt": "2026-01-10T08:00:00Z",
"updatedAt": "2026-01-10T08:00:00Z"
}
]
}
Obtén todos los templates de WhatsApp aprobados
curl -X GET "https://api.whaapy.com/templates/v1" \
-H "Authorization: Bearer wha_xxxxx"
{
"data": [
{
"id": "tmpl-uuid-1",
"name": "order_confirmation",
"category": "UTILITY",
"language": "es_MX",
"status": "APPROVED",
"content": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado.",
"variables": ["{{1}}", "{{2}}"],
"components": [
{
"type": "BODY",
"text": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado.",
"example": {
"body_text": [["Juan", "12345"]]
}
}
],
"createdAt": "2026-01-15T10:00:00Z",
"updatedAt": "2026-01-15T10:00:00Z"
},
{
"id": "tmpl-uuid-2",
"name": "welcome_message",
"category": "MARKETING",
"language": "es_MX",
"status": "APPROVED",
"content": "¡Bienvenido {{1}}! Gracias por contactarnos.",
"variables": ["{{1}}"],
"components": [
{
"type": "HEADER",
"format": "IMAGE"
},
{
"type": "BODY",
"text": "¡Bienvenido {{1}}! Gracias por contactarnos."
},
{
"type": "FOOTER",
"text": "Equipo de Soporte"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Ver catálogo"
},
{
"type": "URL",
"text": "Visitar web",
"url": "https://ejemplo.com"
}
]
}
],
"createdAt": "2026-01-10T08:00:00Z",
"updatedAt": "2026-01-10T08:00:00Z"
}
]
}
curl -X GET "https://api.whaapy.com/templates/v1" \
-H "Authorization: Bearer wha_xxxxx"
{
"data": [
{
"id": "tmpl-uuid-1",
"name": "order_confirmation",
"category": "UTILITY",
"language": "es_MX",
"status": "APPROVED",
"content": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado.",
"variables": ["{{1}}", "{{2}}"],
"components": [
{
"type": "BODY",
"text": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado.",
"example": {
"body_text": [["Juan", "12345"]]
}
}
],
"createdAt": "2026-01-15T10:00:00Z",
"updatedAt": "2026-01-15T10:00:00Z"
},
{
"id": "tmpl-uuid-2",
"name": "welcome_message",
"category": "MARKETING",
"language": "es_MX",
"status": "APPROVED",
"content": "¡Bienvenido {{1}}! Gracias por contactarnos.",
"variables": ["{{1}}"],
"components": [
{
"type": "HEADER",
"format": "IMAGE"
},
{
"type": "BODY",
"text": "¡Bienvenido {{1}}! Gracias por contactarnos."
},
{
"type": "FOOTER",
"text": "Equipo de Soporte"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Ver catálogo"
},
{
"type": "URL",
"text": "Visitar web",
"url": "https://ejemplo.com"
}
]
}
],
"createdAt": "2026-01-10T08:00:00Z",
"updatedAt": "2026-01-10T08:00:00Z"
}
]
}
| Campo | Tipo | Descripción |
|---|---|---|
id | string | UUID interno de Whaapy |
name | string | Nombre del template (slug) |
category | string | MARKETING, UTILITY, AUTHENTICATION |
language | string | Código de idioma (ej: es_MX, en_US) |
status | string | APPROVED, PENDING, REJECTED |
content | string | Texto del body con placeholders |
variables | array | Lista de variables detectadas |
components | array | Componentes del template |
{
"type": "HEADER",
"format": "TEXT" | "IMAGE" | "VIDEO" | "DOCUMENT",
"text": "Texto del header (solo si format=TEXT)",
"example": {
"header_text": ["Ejemplo"]
}
}
{
"type": "BODY",
"text": "Texto con {{1}} variables {{2}}",
"example": {
"body_text": [["valor1", "valor2"]]
}
}
{
"type": "FOOTER",
"text": "Texto del footer"
}
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Opción 1"
},
{
"type": "URL",
"text": "Visitar web",
"url": "https://ejemplo.com/{{1}}"
},
{
"type": "PHONE_NUMBER",
"text": "Llamar",
"phone_number": "+5215512345678"
}
]
}
APPROVED. Para ver templates pendientes o rechazados, usa el dashboard de Whaapy o el Meta Business Manager.const template = templates[0]; // order_confirmation
await fetch('https://api.whaapy.com/messages/v1', {
method: 'POST',
headers: {
'Authorization': 'Bearer wha_xxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '+5215512345678',
type: 'template',
template: {
name: template.name,
language: template.language,
components: [
{
type: 'body',
parameters: [
{ type: 'text', text: 'Juan' }, // {{1}}
{ type: 'text', text: '12345' } // {{2}}
]
}
]
}
})
});