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.

Paige bots can send nine types of WhatsApp messages. Each type is a JavaScript function available in your bot’s services/messages.js file. The right message type depends on what you need the user to do: read information, pick from options, share their location, or receive a file. The examples below show the exact function signatures from the template, so you can use them directly in your bot code.
Interactive messages — buttons, list menus, URL buttons, and flows — are billed as “interactive” messages by WhatsApp. Plain text and media messages are billed as regular messages. Check the Meta pricing page for the current rates for your region.

Message types

Send a plain text message. Supports newlines using \n.
await sendText(conversationId, to, "Hello! How can I help you today?");
Parameters:
  • conversationId — the conversation ID from your database
  • to — the recipient’s phone number (e.g. "27821234567")
  • text — the message body; use \n for line breaks
Text messages are the simplest message type and work in all WhatsApp clients. Use them for confirmations, plain responses, and any message that does not need user input.
You can also send a carousel of up to 10 cards, each with an image, body text, and quick-reply buttons. Carousels are useful for product listings, plan comparisons, or multi-item promotions.
await sendCarousel(
  conversationId,
  to,
  "Here are our current plans:",
  [
    {
      imageUrl: "https://example.com/images/starter.jpg",
      bodyText: "Starter — $29/month. Up to 1,000 conversations.",
      buttons: [{ id: "plan_starter", title: "Choose Starter" }],
    },
    {
      imageUrl: "https://example.com/images/pro.jpg",
      bodyText: "Pro — $79/month. Unlimited conversations.",
      buttons: [{ id: "plan_pro", title: "Choose Pro" }],
    },
  ]
);
Each card in the cards array takes imageUrl, bodyText, and a buttons array. Button clicks are returned via the webhook as interactive messages with button_reply.

Sending a WhatsApp Flow

To open a multi-screen WhatsApp Flow from within a conversation, use sendFlow. The user taps the call-to-action button and the flow opens inline in WhatsApp.
await sendFlow(
  conversationId,
  to,
  {
    flow_id: "1234567890",
    flow_cta: "Book now",
    body_text: "Fill in your details to complete your booking.",
    screen: "BOOKING_SCREEN",
  }
);
See Flows Builder for how to create and publish flows.