Skip to content

WhatsApp

Use the WhatsApp Business API to send template messages, session (conversation) messages, and group messages from a registered WhatsApp number. Templates must be approved before you can send them outside an open customer-care window.

When to use which API

  • Create templates when you need a new UTILITY, MARKETING, or AUTHENTICATION template. Meta must approve it before production sends. Create templates
  • Send templates for notifications, alerts, and OTP templates to users who have not messaged you in the last 24 hours. Send templates
  • Customize messages when one request must deliver a different body, media, or template to each recipient (up to 100). Customize
  • Interactive / conversation messages for buttons, lists, and session replies inside the 24-hour window. Interactive messages
  • Groups to create WhatsApp groups, manage participants, and send group messages. Groups
  • Webhooks for delivery, read, failed, and inbound user replies. WhatsApp webhooks

Template approval

  1. Upload media if the header is an image, video, or document (generateHeaderHandle).
  2. Create the template with a lowercase name, language, category, and components (createWaTemplate).
  3. Wait until the template is Approved. Rejected or paused templates can be edited (once per day, up to 10 times per month).
  4. Send with type: "template" and the approved templateName. Placeholders in the body ({{1}}, {{2}}) are filled from components.body.params in order.

A template that is still pending will not deliver. Authentication templates also require otp on customize sends.

24-hour session window

WhatsApp only delivers text, image, video, document, audio, and interactive messages while a customer-care window is open. That window starts when the user messages you and lasts 24 hours.

  • Template messages do not need an open window.
  • Session messages (type other than template) fail if the window is closed. Use a template instead, or wait for the user to write in.

Customize and Interactive pages use the same rule.

Identifiers you will store

FieldMeaning
fromYour WhatsApp Business number, with country code, for example +91XXXXXXXXXX
toRecipient MSISDN
templateNameApproved template name (lowercase, digits, underscores)
messageIdReturned on send; match this to webhook message_status

Message lifecycle

  1. Your app calls send or customize.
  2. The API returns messageId with "error": null.
  3. WhatsApp webhooks later emit message_status (sent, delivered, read, failed).
  4. If the user replies, you receive message_received (text, button, list, media). Reply with a session message while the window is open.

Full payload samples are on WhatsApp webhooks. Platform setup is on Webhooks.

Was this page helpful?