Pular para o conteúdo

POST /v1/conversations/{id}/messages

POST
/v1/conversations/{id}/messages
curl --request POST \
--url https://seu-endereco-da-api/v1/conversations/example/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "type": "text", "text": "example", "mediaKey": "example", "mediaMime": "example", "asVoiceNote": true, "durationMs": 1, "waveform": "example", "fileName": "example", "clientMessageId": "example", "replyToId": "example", "interactive": { "header": { "kind": "text", "text": "example" }, "body": "example", "footer": "example", "buttons": [ { "id": "example", "text": "example", "url": "example" } ], "buttonText": "example", "sections": [ { "title": "example", "rows": [ { "id": "example", "title": "example", "description": "example" } ] } ] }, "location": { "latitude": 1, "longitude": 1, "name": "example", "address": "example" }, "carousel": { "body": "example", "cards": [ { "mediaKind": "image", "mediaKey": "example", "mediaMime": "example", "body": "example", "linkLabel": "example", "url": "example", "buttons": [ { "id": "example", "text": "example" } ] } ] }, "flow": { "flowId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "cta": "example", "screen": "example", "body": "example", "mode": "draft", "data": {} }, "contactCardId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "mentions": [ "example" ], "viaDefaultTemplate": true }'

Permissão que a Chave de acesso precisa: Enviar mensagem e atender (conversations:write).

id
required
string
Media typeapplication/json
object
type
string
Allowed values: text image audio video document sticker buttons list contacts location location_request carousel cta_url flow
text
string
<= 4096 characters
mediaKey
string
<= 512 characters
mediaMime
string
<= 255 characters
asVoiceNote
boolean
durationMs
number
waveform
string
<= 128 characters
fileName
string
<= 255 characters
clientMessageId
string
<= 64 characters
replyToId
string
<= 64 characters
interactive
object
header
object
kind
required
string
Allowed values: text image video document
text
string
<= 60 characters
body
required
string
<= 1024 characters
footer
string
<= 60 characters
buttons
Array<object>
object
id
string
<= 255 characters
text
required
string
<= 20 characters
url
string
<= 2048 characters
buttonText
string
<= 20 characters
sections
Array<object>
object
title
string
<= 1024 characters
rows
required
Array<object>
object
id
string
<= 255 characters
title
required
string
<= 24 characters
description
string
<= 72 characters
location
object
latitude
required
number
longitude
required
number
name
string
<= 1000 characters
address
string
<= 1000 characters
carousel
object
body
required
string
<= 1024 characters
cards
required
Array<object>
object
mediaKind
required
string
Allowed values: image video
mediaKey
string
<= 512 characters
mediaMime
string
<= 255 characters
body
string
<= 160 characters
linkLabel
string
<= 20 characters
url
string
<= 2048 characters
buttons
Array<object>
object
id
string
<= 256 characters
text
required
string
<= 20 characters
flow
object
flowId
required
string format: uuid
cta
required
string
<= 30 characters
screen
string
body
string
<= 1024 characters
mode
string
Allowed values: draft published
data
object
key
additional properties
any
contactCardId
string format: uuid
mentions
Array<string>
<= 256 items
viaDefaultTemplate
boolean
Media typeapplication/json
object
id
required
string
conversationId
required
string
kind
required
string
direction
required
string
nullable
senderType
required
string
senderUserId
required
string
nullable
type
required
string
text
required
string
nullable
mediaKey
required
string
nullable
mediaMime
required
string
nullable
mediaDownloadFailedAt
required
string format: date-time
nullable
fileName
required
string
nullable
contacts
required
object
location
required
object
replyTo
required
object
reaction
required
string
nullable
groupSenderJid
required

The group member who sent it; null for a private conversation or for a message we sent

string
nullable
groupSenderName
required

The group member who sent it; null for a private conversation or for a message we sent

string
nullable
mentions

The group members tagged in the text: each @token in the text is shown as @name; a token with no known member is left as written

Array<object>
object
token
required

The digits after @ in the text: the member’s lid or phone

string
name
required

The saved contact name, else the member’s WhatsApp name, else the phone

string
channelId
required

The channel this message came in or went out through; it can differ from the conversation’s current channel

string
channelName
required

Still filled in for a channel that was already removed

string
nullable
channelProvider
required
string
nullable
channelCoexistence
required

The channel runs in coexistence with the WhatsApp Business app

boolean
nullable
viaIdentifierId
required

The contact identifier this message came in from or went out to; null for a group or for an older message

string
nullable
mediaUrl
required
string
nullable
templateName
required
string
nullable
templateLanguage
required
string
nullable
templateVariables
required
object
templateComponents
required
object
richContent
required
object
flow
required

Formulário enviado (type flow): body, cta e formName

object
providerMessageId
required
string
nullable
clientMessageId
required
string
nullable
status
required
string
nullable
errorCode
required
string
nullable
errorTitle
required

The title the provider gave when it refused the message

string
nullable
errorReason
required
string
nullable
scheduledMessageId
required
string
nullable
source
required
string
nullable
Allowed values: manual flow ai campaign scheduled system external api import
chargeId
required

The charge a payment message asks the contact to pay

string
nullable
payment

Only on a payment message: the template kind and the charge as it is now (status, value, instruments)

object
transcription
required

What the audio says; only for audio messages

string
nullable
transcriptionStatus
required
string
nullable
Allowed values: pending running done failed
createdAt
required
string format: date-time
receipts

Only present for a group conversation

object
reactions

Only present for a group conversation

Array<object>
object
pollVotes

Only present for a poll message that has at least one vote

Array<object>
object

Example

{
"source": "manual",
"transcriptionStatus": "pending"
}