For the complete documentation index, see llms.txt. This page is also available as Markdown.
Sending WhatsApp messages
In order to send a WhatsApp message, you must have an active WhatsApp channel and perform a HTTP request to the following endpoint with a valid access key
Send a message
post
Send a message to a channel
Authorizations
HTTPRequired
Uses the Authorization header: 'AccessKey ' followed by your access key token
Path parameters
workspaceIdstring · uuidRequired
The unique identifier of the workspace.
channelIdstring · uuidRequired
The ID for a channel
Body
and
anyOptional
object · ChannelMessageCreateWithTemplateOptional
or
object · ChannelMessageCreateWithBodyOptional
Responses
202
Message was accepted for processing
application/json
400
An error
application/json
404
An error
application/json
409
The request conflicts with the current state of the resource.
application/json
413
The request was rejected for exceeding a size limit: the total request body must not exceed 200 KB, and a single attachment's inline content must not exceed 100 KB.
application/json
422
The request contains invalid parameters or body fields.
When sending outbound messages as well as setting the receiver information you must set message body field in all cases except for sending a message template when you must only set the template field
Body
Template
If it has been more than 24 hours since a customer last messaged you, you have to start a conversation by sending a template message first. Non-template messages can only be sent when the customer care window is active. You can check the expiry time for an active customer care window for a contact by making a request as follows:
Get channel details for a contact
get
Retrieve channel information for a given contact.
Authorizations
HTTPRequired
Uses the Authorization header: 'AccessKey ' followed by your access key token
The Channels API supports many of the features of WhatsApp, however due to the omni channel nature of the API there may be some differences between the Channels API message and the native WhatsApp API. Here is an overview of the WhatsApp messages types and Channels API message types:
Except for the template section all examples below must be set in the body field.
Text
Text Message
Text message with reply buttons
Text message with postback actions
Text message with reply and postback actions
Text message with location request
Image
Single image message
Single image message with text
Multiple image message
Single image message with postback actions
Single image message with label and reply actions
Single image message with label, postback and reply actions
Multiple images message with labels and postback actions
Multiple images message with reply actions
Multiple images message with labels, postback and reply actions
File
Single file message
Single file message with postback and reply actions
Multiple files message
Multiple files message with filename
Multiple files message with two postback actions and a reply action
Location
List
List message without sections
List message with sections
List message with sections and custom button label
Carousel
Carousel messages must contain:
body.carousel.text - this contains the text for the bubble before the carousel
Between 2-10 cards.
mediaUrl where media type is either all image or all video
Image types - image/jpeg, image/png
Video types - video/mp4, video/3gpp
Card title
One link action button
ReplyTo
You can send any outbound message as a reply to a previous message by setting the replyTo object as shown below. The replyTo.id should be set to the id of a received message and the replyTo.type should be set to "message"
ReplyTo with a text message
ReplyTo with an image message
ReplyTo with text message with postback actions
Template
Template is the only message type that can be sent by a business to a recipient outside the customer service window, however, a prior opt-in is required. Templates must be active in Studio and, therefore, pre-approved by Meta, before they are used. It's also important to note that the code snippets below must be set in the message template field