WhatsApp templates

Create template

Changed on

Create a WhatsApp template and submit it for WhatsApp approval, which is asynchronous (~24–48h). A template belongs to one WhatsApp account (WABA) and can only be sent from that account's numbers; if the organization has several accounts, choose one with whatsappAccountId: its WABA ID or the name the team gave it, e.g. "Soporte" (see whatsapp_numbers_list). 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 a "Copy code" coupon button (CALL_TO_ACTION, MARKETING only; the code is a fixed code of up to 15 characters or a single variable filled per recipient): { "name": "buen_fin_coupon", "language": "es", "category": "MARKETING", "contentType": "CALL_TO_ACTION", "content": { "body": "Hola {{1}}, aquí está tu 15% de descuento.", "actions": [{ "type": "COPY_CODE", "title": "Copiar código", "code": "{{2}}" }] }, "variables": { "1": "Ana", "2": "BUENFIN15" } }. 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

  • Base URL
    https://www.useboom.ai
  • Auth
    HTTP bearer

Request body

namestring required

Template name, unique per WhatsApp account (shared by all its numbers).

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|COPY_CODE, title, url|phone|code }] } (at most one COPY_CODE, MARKETING templates only; code is a fixed code of up to 15 characters or one variable like {{2}}); 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 (CALL_TO_ACTION, a coupon the customer copies in one tap): { "body": "Hola {{1}}, aquí está tu descuento", "actions": [{ "type": "COPY_CODE", "title": "Copiar código", "code": "{{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.

whatsappAccountIdstring

WABA ID of the WhatsApp account to create the template on (whatsappAccount.id from whatsapp_numbers_list), or the account's alias, matched case-insensitively (whatsappAccount.alias, e.g. "Soporte"). The template belongs to that account: every number on it can send it, and numbers on other accounts can't. Works for an account with no active numbers yet. Omit when the organization has a single WhatsApp account; with several, pass this or phoneNumbers.

phoneNumbersstring[]

Alternative to whatsappAccountId: any WhatsApp number (E.164) on the account to create the template on. One number per account is enough. Numbers on several accounts create one template per account. Omit when the organization has a single WhatsApp account.

Response

Success

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the required property // to the response with the status

    • info

      added the required property // to the response with the status