Skip to main content

Documentation Index

Fetch the complete documentation index at: https://howto.paigeme.dev/llms.txt

Use this file to discover all available pages before exploring further.

Message templates are pre-approved message formats that let your bot reach users proactively — outside of an active conversation window or as outbound notifications. Every template must be approved by Meta before it can be sent. Once approved, you call sendTemplate() in your bot code to deliver it to any number in your contact list.

Template categories

When you create a template, you assign it to one of three categories. The category affects approval speed and how WhatsApp bills the message.

UTILITY

Transactional messages tied to a user action or request — order confirmations, appointment reminders, shipping updates, payment receipts. Approved in minutes in most cases.

MARKETING

Promotional messages, product announcements, offers, and campaigns. Approval typically takes longer than UTILITY. Subject to per-message marketing pricing.

AUTHENTICATION

One-time passcodes and verification messages. Used for 2FA and account verification flows. Tightly scoped and approved quickly.
If your message is tied to something the user initiated — a booking, an order, a sign-up — use UTILITY. UTILITY templates are approved in minutes and cost less to send.

Template components

A template is made up of components. The only required component is a BODY. You can optionally add a HEADER (text or media), a FOOTER, and BUTTONS.
The main text of the message. Supports variables using {{1}}, {{2}} notation. Variable values are provided at send time.
{
  "type": "BODY",
  "text": "Hi {{1}}, your appointment on {{2}} has been confirmed."
}
Displayed above the body. Can be plain text or a media type (image, video, document).
{
  "type": "HEADER",
  "format": "TEXT",
  "text": "Appointment Confirmed"
}
Up to three buttons. Supported types are QUICK_REPLY (sends a reply back to your webhook), URL (opens a link), and PHONE_NUMBER (initiates a call).
{
  "type": "BUTTONS",
  "buttons": [
    {
      "type": "URL",
      "text": "Track order",
      "url": "https://example.com/track/{{1}}"
    }
  ]
}

Creating a template

You can create a template from the Paige dashboard or by asking the AI agent to create one for you.
Tell the AI agent what template you need. The agent calls create_template automatically and handles the Meta API submission.Example prompt:
“Create a UTILITY template called order_shipped in English. The body should say ‘Hi , your order has shipped and will arrive by .’”
The agent will create the template and confirm when it has been submitted to Meta for approval.
Template names must be lowercase letters, numbers, and underscores only, and must start with a letter. For example: order_confirmation, appt_reminder_v2.

Template approval

After you submit a template, Meta reviews it. Approval times vary by category:
  • UTILITY — typically approved within minutes
  • AUTHENTICATION — typically approved within minutes
  • MARKETING — can take hours to a few days
You can check the approval status of your templates from the Templates section in your project dashboard or by asking the AI agent to list your templates.
Templates that are rejected can be edited and resubmitted, but the name cannot be changed. If your template was rejected, review Meta’s messaging policies, adjust the content, and resubmit.

Listing your templates

To see the current status of all templates for your project, ask the AI agent:
“List my templates.”
Or view them directly in the Templates section of your project dashboard.

Sending a template in bot code

Once a template is approved, use sendTemplate() in your bot code to send it.
const { sendTemplate } = require("../services/messages");

// Send a template with no variables
await sendTemplate(to, "welcome_message", "en");

// Send a template with body variables
await sendTemplate(to, "appointment_reminder", "en", [
  {
    type: "body",
    parameters: [
      { type: "text", text: contactName },
      { type: "text", text: appointmentDate },
    ],
  },
]);

// Send a template with a header variable and a URL button variable
await sendTemplate(to, "order_shipped", "en", [
  {
    type: "header",
    parameters: [{ type: "text", text: "Order Update" }],
  },
  {
    type: "body",
    parameters: [
      { type: "text", text: contactName },
      { type: "text", text: orderNumber },
      { type: "text", text: deliveryDate },
    ],
  },
  {
    type: "button",
    sub_type: "url",
    index: "0",
    parameters: [{ type: "text", text: orderNumber }],
  },
]);
Parameters:
  • to — recipient phone number (e.g. "27821234567")
  • templateName — the exact name of the approved template
  • languageCode — language code used when the template was created (e.g. "en", "en_US", "pt_BR")
  • components — array of component objects providing variable values at send time
Variable indices in the components array at send time must match the {{1}}, {{2}} placeholders in the template definition, in order.

Deleting a template

To delete a template, navigate to the Templates section in your project dashboard and click the delete action next to the template. Deleting a template removes it from your WhatsApp Business Account on Meta. This action cannot be undone.