Skip to main content
POST

Authorizations

Authorization
string
header
required

API token in the sk_live_… format.

Headers

Idempotency-Key
string

Unique key for the operation. If you repeat the call with the same key and the same body, you get the stored response.

Maximum string length: 200

Body

channelId
integer
required

Channel where the conversation takes place. See the available channels at GET /channels.

Example:

4

type
enum<string>
default:text

Type of message. It defines which other fields are required:

Available options:
text,
media,
template,
interactive
number
string

Recipient on phone channels (WhatsApp, RCS): digits only, with country and area code. If there is no contact with this number yet, one is created. Not valid on channels without a phone number.

Example:

"5511999999999"

contactId
integer

Recipient by the id of a contact that already exists, on any channel. Required on channels without a phone number (Instagram, Facebook/Messenger, Webchat, Telegram) — on them you can only message someone who has already talked to the channel. The contact must belong to the token's company. Takes precedence over number.

Example:

842

ticketId
integer

Sends inside a ticket that already exists. Takes precedence over contactId and number.

Example:

9034

contactName
string

Name given to the contact if it is created by this send (only with number).

Example:

"Marina Alves"

body
string

Message text, or caption when type: media. Accepts system variables (e.g. {{name}}).

Example:

"Olá, Marina! Seu pedido #88213 foi confirmado."

template
object

Required when type: template. Accepts the simple form ({ name, parameters }), which is the recommended one: the API validates the template and builds the message. It also accepts the fully built object with components, for those who already work with that format.

With media in the header (in the fully built object, with the link in the header component), the conversation shows a copy of the file, kept in the company storage, and the template text with the variables. The copy accepts a JPEG or PNG image, an MP4 or 3GPP video and a PDF document, within Meta limits, and counts toward storage. If the copy is not possible (internal address, type outside the list, above the limit, too slow or storage full), the message is sent all the same, just without the media in the conversation.

Example:
interactive
object

Required when type: interactive. The interactive object of the official WhatsApp API (Cloud API), the same on every channel that has interactive messages: the payload you already send to official WhatsApp works on Webchat with no changes.

On Webchat, the types and the limits checked during the call:

On all of them: body.text is required, up to 1024 characters (list: 4096); text header up to 60; footer up to 60. A media header (image, video, document) only by public http(s) link — the webchat does not use media by Meta id.

The contact's choice arrives as it does on WhatsApp: a text message with the option title, replying to (quoting) the interactive message.

Example:
queueId
integer

Moves the ticket to this queue after sending.

Example:

7

openTicket
boolean

Reopens the ticket if it is closed.

closeTicket
boolean

Closes the ticket after sending.

wrapupTypeId
integer

Wrap-up recorded when the ticket is closed with closeTicket.

Example:

12

Response

Accepted and queued for sending.

data
object