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.
Send the same apikey header as every other channel. WhatsApp requests go to https://api.azmarq.com/v1/whatsapp. See Authentication.
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
- Upload media if the header is an image, video, or document (
generateHeaderHandle). - Create the template with a lowercase name, language, category, and components (
createWaTemplate). - Wait until the template is Approved. Rejected or paused templates can be edited (once per day, up to 10 times per month).
- Send with
type: "template"and the approvedtemplateName. Placeholders in the body ({{1}},{{2}}) are filled fromcomponents.body.paramsin 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 (
typeother thantemplate) 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
| Field | Meaning |
|---|---|
from | Your WhatsApp Business number, with country code, for example +91XXXXXXXXXX |
to | Recipient MSISDN |
templateName | Approved template name (lowercase, digits, underscores) |
messageId | Returned on send; match this to webhook message_status |
Message lifecycle
- Your app calls send or customize.
- The API returns
messageIdwith"error": null. - WhatsApp webhooks later emit
message_status(sent,delivered,read,failed). - 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.