Send messages
Send and manage WhatsApp messages with Wazend: text, media, polls, lists, buttons, reactions and more.
Send and manage WhatsApp messages from your application.
Common fields
session— name of the session you're sending the message from.chatId— destination identifier:5215551234567@c.us(user),...@g.us(group),...@newsletter(channel) orstatus@broadcast(status).file— for media, usefile.url(public URL) orfile.data(base64).reply_to— ID of the message you're replying to.
Mark as read
POST /api/sendSeen{
"session": "S0001",
"chatId": "5215551234567@c.us"
}To read specific messages, use messageIds (and participant in groups):
{
"session": "S0001",
"chatId": "5215551234567@c.us",
"messageIds": [
"false_5215551234567@c.us_AAAAAAAAAAAAAAAAAAAA"
]
}Send text
POST /api/sendText{
"session": "S0001",
"chatId": "5215551234567@c.us",
"text": "Hello!"
}Additional options:
reply_to— reply to a message.mentions— mention contacts in a group (["5215551234567@c.us"]or["all"]for everyone).linkPreview— enable link preview.linkPreviewHighQuality— high quality preview.
Send image
POST /api/sendImage{
"session": "S0001",
"chatId": "5215551234567@c.us",
"file": {
"mimetype": "image/jpeg",
"url": "https://ejemplo.com/foto.jpg",
"filename": "foto.jpg"
},
"caption": "Mira esta imagen"
}You can also send the file in base64 using file.data instead of file.url.
Image format
WhatsApp works best with JPEG images. There's no convert flag for images: you must convert to JPEG before sending them.
Send voice note
POST /api/sendVoice{
"session": "S0001",
"chatId": "5215551234567@c.us",
"file": {
"mimetype": "audio/ogg; codecs=opus",
"url": "https://ejemplo.com/audio.ogg"
},
"convert": false
}Use convert: true so Wazend converts the audio automatically. You can also send the file in base64 with file.data.
Send video
POST /api/sendVideo{
"session": "S0001",
"chatId": "5215551234567@c.us",
"file": {
"mimetype": "video/mp4",
"url": "https://ejemplo.com/video.mp4"
},
"caption": "Mira este video",
"convert": false
}Use convert: true so Wazend converts the video automatically.
Convert voice
Convert an audio file to a WhatsApp-compatible format (OGG/Opus).
POST /api/{session}/media/convert/voice{
"url": "https://ejemplo.com/audio.mp3"
}Convert video
Convert a video to MP4 format.
POST /api/{session}/media/convert/video{
"url": "https://ejemplo.com/video.avi"
}Send file
POST /api/sendFile{
"session": "S0001",
"chatId": "5215551234567@c.us",
"file": {
"mimetype": "application/pdf",
"url": "https://ejemplo.com/documento.pdf",
"filename": "documento.pdf"
},
"caption": "Here is the document"
}Send poll
POST /api/sendPoll{
"session": "S0001",
"chatId": "5215551234567@c.us",
"poll": {
"name": "What's your favorite color?",
"options": ["Rojo", "Azul", "Verde"],
"multipleAnswers": false
}
}Vote in a poll
POST /api/sendPollVote{
"session": "S0001",
"chatId": "5215551234567@c.us",
"pollMessageId": "ID_DE_LA_ENCUESTA",
"pollServerId": null,
"votes": ["Rojo"]
}Send interactive list
POST /api/sendList{
"session": "S0001",
"chatId": "5215551234567@c.us",
"message": {
"title": "Main menu",
"description": "Choose an option",
"footer": "Wazend",
"button": "Open menu",
"sections": [
{
"title": "Options",
"rows": [
{ "title": "Option 1", "rowId": "option-1", "description": "Description 1" },
{ "title": "Option 2", "rowId": "option-2", "description": "Description 2" }
]
}
]
}
}Send link with custom preview
POST /api/send/link-custom-preview{
"session": "S0001",
"chatId": "5215551234567@c.us",
"text": "Check this out: https://example.com",
"linkPreviewHighQuality": true,
"preview": {
"url": "https://ejemplo.com",
"title": "Custom title",
"description": "Link description",
"image": { "url": "https://ejemplo.com/preview.jpg" }
}
}Forward message
POST /api/forwardMessage{
"session": "S0001",
"messageId": "false_5215551234567@c.us_ABC123",
"chatId": "5219999999999@c.us"
}React to a message
PUT /api/reaction{
"session": "S0001",
"messageId": "false_5215551234567@c.us_ABC123",
"reaction": "👍"
}Star message
PUT /api/star{
"session": "S0001",
"messageId": "false_5215551234567@c.us_ABC123",
"chatId": "5215551234567@c.us",
"star": true
}Send contact
POST /api/sendContactVcard{
"session": "S0001",
"chatId": "5215551234567@c.us",
"contacts": [
{ "fullName": "Juan Pérez", "phoneNumber": "+5215551234567" }
]
}Send location
POST /api/sendLocation{
"session": "S0001",
"chatId": "5215551234567@c.us",
"latitude": 19.4326,
"longitude": -99.1332,
"title": "Mexico City"
}Typing indicator
POST /api/startTyping{
"session": "S0001",
"chatId": "5215551234567@c.us"
}POST /api/stopTyping