Mandala
Tools

WhatsApp

Send WhatsApp messages

Usage Instructions

Integrate WhatsApp into the workflow. Can send messages.

Tools

whatsapp_send_message

Send WhatsApp messages

Input

ParameterTypeRequiredDescription
phoneNumberstringYesRecipient phone with country code
messagestringNoMessage content to send (text mode; required when mode is text or omitted)
modestringNoMode: 'text' | 'list' | 'interactive' | 'template' | 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'location' | 'contacts' | 'reaction' | 'raw'. Back-compat: 'media' with media.type.
interactiveobjectNoInteractive payload (list/buttons)
listobjectNoList message: { header?, body, footer?, buttonText?, sections: [{ title?, rows: [{ id, title, description? }] }] }. Session-only (recipient must have messaged within 24h) -- use template mode to reach outside that window.
rawPayloadobjectNoSend any valid Cloud API payload
connectionIdstringNoA WhatsApp account connected in workspace Settings. Preferred over phoneNumberId/accessToken below.
phoneNumberIdstringNoWhatsApp Business Phone Number ID (only needed without a connectionId)
accessTokenstringNoWhatsApp Business API Access Token (only needed without a connectionId)
mediaobjectNoMedia for image/video/audio/document/sticker
locationobjectNoLocation payload
contactsobjectNoContacts array payload
reactionobjectNoReaction payload
templateobjectNoApproved template to send directly: { name, language, components? }. Alternative to templateId for callers that already know the exact Meta template shape.
templateIdstringNoAn approved template (from this connection) selected via the template picker. Preferred over template.
templateVariablesobjectNoVariable values for the picked template, keyed by component: { "header": [...], "body": [...] }
templateCarouselCardsobjectNoOnly for a Carousel template: { cards: [{ mediaUrl }] }, one entry per card in template order. A fresh media upload is required on every send.

Output

ParameterTypeDescription
successbooleanSend success status
messageIdstringUnique WhatsApp message identifier
httpStatusnumberHTTP status code from Graph API
errorstringError message (if any)
errorCodestringGraph API error code (if any)
errorTypestringGraph API error type (if any)
errorSubcodestringGraph API error subcode (if any)
traceIdstringFacebook trace id (if any)
phoneNumberstringRecipient phone number (echoed)
statusstringMessage delivery status (if present)
timestampstringMessage send timestamp (if present)
metajsonLight metadata (to/mode/msgType)
rawResponsejsonFull Graph API response body

Triggers

whatsapp_webhook

Trigger workflow from WhatsApp messages and events via Business Platform webhooks

Output

ParameterTypeDescription
messageIdstringUnique message identifier
fromstringPhone number of the message sender
phoneNumberIdstringWhatsApp Business phone number ID that received the message
messageTypestringType of message: text, image, video, audio, document, sticker, location, contacts, interactive, button, reaction, order
timestampstringMessage timestamp (Unix timestamp)
textstringMessage text content (for text messages)
media.idstringMedia file ID (for image/video/audio/document/sticker)
media.mimeTypestringMedia MIME type
media.sha256stringMedia file hash
media.captionstringMedia caption (for image/video/document)
media.filenamestringDocument filename (for document)
media.urlstringDurable Mandala-hosted URL for the downloaded media (only when Download Media Attachments is enabled)
media.keystringMandala storage key for the downloaded media (only when Download Media Attachments is enabled)
attachmentsfile[]Downloaded media files (only when Download Media Attachments is enabled and an access token is configured)
location.latitudenumberLocation latitude
location.longitudenumberLocation longitude
location.namestringLocation name
location.addressstringLocation address
interactive.interactiveTypestringInteractive type: button_reply or list_reply
interactive.buttonReply.idstringButton ID that was clicked
interactive.buttonReply.titlestringButton title
interactive.listReply.idstringList item ID that was selected
interactive.listReply.titlestringList item title
interactive.listReply.listDescriptionstringList item description
interactive.flowReply.namestringThe Flow component name that completed
interactive.flowReply.responseDataobjectThe Flow's final response payload
button.payloadstringButton payload data
button.textstringButton text
reaction.messageIdstringID of message being reacted to
reaction.emojistringReaction emoji
contactsarrayArray of contact objects shared
order.catalogIdstringThe catalog the order was placed against
order.textstringOptional note the customer added to the order
order.productItemsarrayOrdered items: [{ productRetailerId, quantity, itemPrice, currency }]. itemPrice's unit convention (minor vs. major) is unconfirmed from Meta's docs -- inspect a real payload before assuming.
rawobjectComplete raw message object from WhatsApp for advanced processing

Notes

  • Category: tools
  • Type: whatsapp
WhatsApp