Wati

Usage Instructions

Integrate Wati, the WhatsApp Business platform, into the workflow. Reply to customers with text, files, buttons, and lists; send approved template messages to one contact or a broadcast list; manage contacts and their attributes; read a conversation; and hand chats to a teammate or team. Can also run workflows when a message arrives or a sent message is delivered, read, replied to, or fails. WhatsApp only allows free-form messages within 24 hours of the contact’s last message; outside that window, or to start a conversation, send an approved template. Requires your Wati API endpoint and an API token.

Actions

Wati Send Session Message

Send a free-form WhatsApp text message to a contact through Wati. WhatsApp only allows free-form session messages within 24 hours of the contact’s last message to you. Outside that window, or to start a conversation, send an approved template message instead. A success means Wati accepted the message, not that it was delivered.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
messageTextstringYesMessage text, up to 4096 characters
replyContextIdstringNoWhatsApp message ID (wamid) to reply to, so the message shows as a quoted reply
localMessageIdstringNoYour own message ID, echoed back in the Wati status webhooks
channelPhoneNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.

Output

ParameterTypeDescription
messageIdstringWati ID of the queued message. Accepted is not delivered: watch the webhook.
typestringMessage type, e.g. text, image, or interactive
textstringText that was sent
createdstringWhen Wati created the message (ISO 8601)

Wati Send Template Message

Send a WhatsApp-approved template message to one contact through Wati. Templates are required to start a conversation or to message a contact more than 24 hours after their last message; inside that 24-hour window a free-form session message also works. Marketing templates are subject to daily limits. A success means Wati accepted the message, not that it was delivered.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
templateNamestringYesName of a WhatsApp-approved template (its element name), e.g. order_update
broadcastNamestringNoLabel that groups the sends in Wati broadcast reports. Defaults to the template name.
channelNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.
parametersjsonNoValues for the template placeholders, as {"name": "Asha", "order_id": "1234"} or [{"name": "name", "value": "Asha"}]. Use "1", "2", ... as names for numbered placeholders like {{1}}.

Output

ParameterTypeDescription
phoneNumberstringRecipient phone number
templateNamestringTemplate that was sent
validWhatsAppNumberbooleanWhether Wati recognized the number as a WhatsApp user
localMessageIdstringMessage ID echoed in the Wati status webhooks
infostringStatus note from Wati

Wati Send Template Broadcast

Send one WhatsApp-approved template to up to 1000 contacts in a single Wati call, each with their own placeholder values. Use templates for any contact who has not messaged you in the last 24 hours. A success means Wati queued the sends; check invalidWhatsappNumbers and the status webhooks for failures.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
templateNamestringYesName of a WhatsApp-approved template (its element name), e.g. order_update
broadcastNamestringNoLabel that groups the sends in Wati broadcast reports. Defaults to the template name.
channelNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.
receiversjsonYesUp to 1000 recipients: [{"whatsappNumber": "919876543210", "customParams": {"name": "Asha"}, "localMessageId": "optional-your-id"}]. A plain list of numbers also works when the template has no placeholders.

Output

ParameterTypeDescription
receiverCountnumberNumber of receivers submitted
errorstringError reported by Wati, if any
invalidWhatsappNumbersarrayNumbers Wati rejected as invalid
invalidCustomParametersarrayPlaceholder values Wati rejected

Wati Send File

Send an image, video, audio file, or document to a contact on WhatsApp through Wati, from a public URL, with an optional caption. Set voice to send an OGG audio file as a voice note. WhatsApp only allows free-form session messages within 24 hours of the contact’s last message to you. Outside that window, or to start a conversation, send an approved template message instead.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
fileUrlstringYesPublic https URL of the image, video, audio file, or document
captionstringNoCaption shown with the file
voicebooleanNoSend an audio/ogg file as a WhatsApp voice note
channelPhoneNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.

Output

ParameterTypeDescription
messageIdstringWati ID of the queued message. Accepted is not delivered: watch the webhook.
typestringMessage type, e.g. text, image, or interactive
textstringText that was sent
createdstringWhen Wati created the message (ISO 8601)

Wati Send Interactive Message

Send a WhatsApp interactive message through Wati: up to 3 quick-reply buttons, or a list of up to 10 options behind a menu button. The contact's choice arrives on the Wati webhook. WhatsApp only allows free-form session messages within 24 hours of the contact’s last message to you. Outside that window, or to start a conversation, send an approved template message instead.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
interactiveTypestringYes"buttons" for up to 3 reply buttons, or "list" for a menu of up to 10 rows
bodystringYesMain message text, up to 1024 characters
footerstringNoFooter text, up to 60 characters
headerTextstringNoHeader text, up to 60 characters
headerTypestringNoButtons only: header type, one of Text, Image, Video, or Document
headerMediaUrlstringNoButtons only: media URL for an Image, Video, or Document header
headerFileNamestringNoButtons only: file name shown for a Document header
buttonsjsonNoButtons only: 1 to 3 button labels of up to 20 characters, as ["Yes", "No"] or a comma-separated list
buttonTextstringNoList only: label of the button that opens the list, e.g. "View options"
sectionsjsonNoList only: [{"title": "Plans", "rows": [{"title": "Basic", "description": "Up to 5 users"}]}]. Up to 10 rows in total; titles up to 24 characters, descriptions up to 72.
channelPhoneNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.

Output

ParameterTypeDescription
messageIdstringWati ID of the queued message. Accepted is not delivered: watch the webhook.
typestringMessage type, e.g. text, image, or interactive
textstringText that was sent
createdstringWhen Wati created the message (ISO 8601)

Wati List Templates

List the WhatsApp message templates in a Wati workspace with their category, approval status, and body text. Only APPROVED templates can be sent, and a template is what you need to message a contact outside the 24-hour session window.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
pageSizenumberNoItems per page
pageNumbernumberNoPage number, starting at 1
channelPhoneNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.

Output

ParameterTypeDescription
pageNumbernumberCurrent page number
pageSizenumberPage size
totalnumberTotal items, when Wati reports it
nextPagestringPath of the next page, if any
prevPagestringPath of the previous page, if any
templatesarrayMessage templates
↳ idstringTemplate ID
↳ namestringTemplate name (element name) to send with
↳ categorystringMARKETING, UTILITY, or AUTHENTICATION
↳ statusstringApproval status, e.g. APPROVED
↳ bodystringBody text with {{placeholders}}

Wati List Contacts

List contacts in a Wati workspace, optionally filtered by name, creation date, or contact attribute.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
pageSizenumberNoItems per page
pageNumbernumberNoPage number, starting at 1
namestringNoOnly contacts whose name matches
attributejsonNoAttribute filter, e.g. [{"name": "city", "operator": "contain", "value": "Pune"}]. Operators include contain, notContain, exist, and notExist.
createdDatestringNoOnly contacts created on this date (YYYY-MM-DD or MM-DD-YYYY)

Output

ParameterTypeDescription
pageNumbernumberCurrent page number
pageSizenumberPage size
totalnumberTotal items, when Wati reports it
nextPagestringPath of the next page, if any
prevPagestringPath of the previous page, if any
contactsarrayContacts
↳ idstringWati contact ID
↳ waIdstringWhatsApp ID (phone number with country code)
↳ firstNamestringFirst name
↳ fullNamestringFull name
↳ phonestringPhone number
↳ createdstringWhen the contact was created

Wati Add Contact

Add a contact to a Wati workspace by WhatsApp number, with a name and custom attributes. Wati also adds contacts automatically on the first message, so this is mainly for saving attributes up front.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesWhatsApp number with country code and no + (e.g. 919876543210)
namestringNoContact name
customParamsjsonNoCustom attributes, as {"city": "Pune", "plan": "Pro"} or [{"name": "city", "value": "Pune"}]

Output

ParameterTypeDescription
contactobjectThe created or existing contact
↳ idstringWati contact ID
↳ waIdstringWhatsApp ID (phone number with country code)
↳ firstNamestringFirst name
↳ fullNamestringFull name
↳ phonestringPhone number
↳ createdstringWhen the contact was created
infostringStatus note from Wati

Wati Update Contact Attributes

Set custom attributes on a Wati contact, such as lead stage, city, or order ID, so they can fill template placeholders and segment broadcasts.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
customParamsjsonYesAttributes to set, as {"lead_stage": "qualified"} or [{"name": "lead_stage", "value": "qualified"}]

Output

ParameterTypeDescription
infostringStatus note from Wati

Wati Get Messages

Get the WhatsApp conversation history with one contact from Wati, newest first, optionally limited to a UTC time range. Use it to give an agent context before replying.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
pageSizenumberNoItems per page
pageNumbernumberNoPage number, starting at 1
fromstringNoStart of the range in UTC, as YYYY-MM-DD HH:mm:ss
tostringNoEnd of the range in UTC, as YYYY-MM-DD HH:mm:ss
channelPhoneNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.

Output

ParameterTypeDescription
pageNumbernumberCurrent page number
pageSizenumberPage size
totalnumberTotal items, when Wati reports it
nextPagestringPath of the next page, if any
prevPagestringPath of the previous page, if any
messagesarrayMessages in the conversation
↳ idstringMessage ID
↳ createdstringWhen the message was created (ISO 8601)
↳ typestringMessage type, e.g. text or image
↳ textstringMessage text
↳ statusstringDelivery status, e.g. DELIVERED
↳ ownerbooleanTrue when your business sent the message

Wati Assign Operator

Assign a WhatsApp chat in the Wati team inbox to a teammate by email, for example to hand a conversation from a bot to a human. Leave the email empty to assign the chat back to the bot.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
emailstringNoEmail of the Wati user to assign. Empty assigns the chat to the bot.
channelPhoneNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.

Output

ParameterTypeDescription
infostringStatus note from Wati

Wati Assign Team

Route a WhatsApp chat in the Wati team inbox to one or more teams by name, such as Sales or Support. Available on the Wati Pro and Business plans.

Input

ParameterTypeRequiredDescription
apiEndpointstringYesYour Wati API endpoint from the dashboard API Docs page, e.g. https://live-mt-server.wati.io/123456 (must be https on a wati.io host)
apiKeystringYesWati API access token, sent as a Bearer token
whatsappNumberstringYesRecipient WhatsApp number with country code and no + (e.g. 919876543210), or a Wati contact ID or BSUID
teamsjsonYesTeam names, as ["Sales", "Support"] or a comma-separated list
channelPhoneNumberstringNoYour WhatsApp business number to send from, with country code. Only needed when the workspace has more than one number.

Output

ParameterTypeDescription
infostringStatus note from Wati