v1

latestOpenAPI 3.1.02026-07-22750642.5 KB
WhatsApp templates

Create template

Create a WhatsApp template and submit it for WhatsApp approval, which is asynchronous (~24–48h). Example (TEXT): { "name": "order_shipped", "language": "es", "category": "UTILITY", "contentType": "TEXT", "content": { "body": "Hola {{1}}, tu pedido ya salió." }, "variables": { "1": "Ana" } }. Example with buttons (CALL_TO_ACTION): { "name": "order_shipped_cta", "language": "es", "category": "UTILITY", "contentType": "CALL_TO_ACTION", "content": { "body": "Hola {{1}}, tu pedido ya salió.", "actions": [{ "type": "URL", "title": "Ver pedido", "url": "https://example.com/orders/{{2}}" }] }, "variables": { "1": "Ana", "2": "12345" } }. Example with reply buttons (QUICK_REPLY): { "name": "order_feedback", "language": "es", "category": "UTILITY", "contentType": "QUICK_REPLY", "content": { "body": "¿Te gustó tu compra?", "actions": [{ "title": "Sí", "id": "yes" }, { "title": "No", "id": "no" }] } }. Example with a header and image (CARD): { "name": "order_shipped_card", "language": "es", "category": "UTILITY", "contentType": "CARD", "content": { "headerType": "media", "mediaUrl": "https://example.com/banner.jpg", "body": "Hola {{1}}, tu pedido ya salió.", "footer": "Gracias por tu compra", "actions": [{ "type": "URL", "title": "Ver pedido", "url": "https://example.com/orders/{{2}}" }] }, "variables": { "1": "Ana", "2": "12345" } }. Example that is only an image (MEDIA): the image URL goes in content.media (an array), NOT in a variable — { "name": "promo_verano", "language": "es", "category": "MARKETING", "contentType": "MEDIA", "content": { "media": ["https://example.com/promo.png"], "body": "¡Hola {{1}}! Aprovecha nuestra promo de verano." }, "variables": { "1": "Ana" } }.

post/api/v1/templates

Request body

namestring required

Template name, unique per WhatsApp number.

languagestring required

WhatsApp language code, e.g. es, en. A regional variant like es_MX or en_US is normalized to its base code.

category'UTILITY' | 'MARKETING' | 'AUTHENTICATION' required
contentType'TEXT' | 'MEDIA' | 'QUICK_REPLY' | 'CALL_TO_ACTION' | 'CARD' required
contentobject required

Message content. Shape depends on contentType: TEXT { body }; MEDIA { body?, media: [url] }; QUICK_REPLY { body, actions: [{ title, id }] }; CALL_TO_ACTION { body, actions: [{ type: URL|PHONE_NUMBER, title, url|phone }] }; CARD { headerType, headerText|mediaUrl, body, footer?, actions? }. Use {{1}}, {{2}}… for variables. Example (TEXT): { "body": "Hola {{1}}, tu pedido está en camino" }. Example (CALL_TO_ACTION, adds a button): { "body": "Hola {{1}}, tu pedido está en camino", "actions": [{ "type": "URL", "title": "Ver pedido", "url": "https://example.com/orders/{{2}}" }] }. Example (QUICK_REPLY, adds reply buttons): { "body": "¿Te gustó tu compra?", "actions": [{ "title": "Sí", "id": "yes" }, { "title": "No", "id": "no" }] }. Example (CARD, header + optional footer/button): { "headerType": "text", "headerText": "Pedido en camino", "body": "Hola {{1}}, tu pedido ya salió.", "footer": "Gracias por tu compra", "actions": [{ "type": "URL", "title": "Ver pedido", "url": "https://example.com/orders/{{2}}" }] }.

variablesobject

Example values for placeholders, e.g. { "1": "Ana" } for {{1}}. Required for every placeholder used.

phoneNumbersstring[]

WhatsApp numbers (E.164) to create the template for. Omit to use the first active number connected to your organization.

Response

Success