Send a text message
/v1/whatsapp/sessions/{sessionId}/messages/send-textSends a text message.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
textrequired | string | The message text. |
mentions | string[] | Chat ids to @mention. The text must also contain the @number token. |
linkPreview | boolean | Whether to attach a preview for links in the text. |
quotedMessageId | string | Send as a reply to this message id. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-text" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"text": "Hello from Tusk WhatsApp!"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send an image
/v1/whatsapp/sessions/{sessionId}/messages/send-imageSends an image. Provide the file as a public url or as base64.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
url | string | A public URL of the image. Send either url or base64. |
base64 | string | The image as a base64 string. Send either url or base64. |
mimetype | string | The media type, for example image/jpeg. Recommended with base64. |
filename | string | A file name. |
caption | string | Text shown with the media. |
mentions | string[] | Chat ids to @mention. The text must also contain the @number token. |
quotedMessageId | string | Send as a reply to this message id. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-image" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"url": "https://example.com/photo.jpg",
"caption": "Your order"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send a video
/v1/whatsapp/sessions/{sessionId}/messages/send-videoSends a video. Provide the file as a public url or as base64.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
url | string | A public URL of the video. Send either url or base64. |
base64 | string | The video as a base64 string. Send either url or base64. |
mimetype | string | The media type, for example image/jpeg. Recommended with base64. |
filename | string | A file name. |
caption | string | Text shown with the media. |
mentions | string[] | Chat ids to @mention. The text must also contain the @number token. |
quotedMessageId | string | Send as a reply to this message id. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-video" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"url": "https://example.com/clip.mp4",
"caption": "Your order"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send an audio or voice message
/v1/whatsapp/sessions/{sessionId}/messages/send-audioSends an audio file or a voice message. Provide the file as a public url or as base64.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
url | string | A public URL of the audio. Send either url or base64. |
base64 | string | The audio as a base64 string. Send either url or base64. |
mimetype | string | The media type, for example image/jpeg. Recommended with base64. |
filename | string | A file name. |
caption | string | Text shown with the media. |
mentions | string[] | Chat ids to @mention. The text must also contain the @number token. |
quotedMessageId | string | Send as a reply to this message id. |
ptt | boolean | Send as a voice note (push to talk). |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-audio" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"url": "https://example.com/voice.ogg"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send a document
/v1/whatsapp/sessions/{sessionId}/messages/send-documentSends a document or any file. Provide the file as a public url or as base64.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
url | string | A public URL of the file. Send either url or base64. |
base64 | string | The file as a base64 string. Send either url or base64. |
mimetype | string | The media type, for example image/jpeg. Recommended with base64. |
filename | string | A file name. |
caption | string | Text shown with the media. |
mentions | string[] | Chat ids to @mention. The text must also contain the @number token. |
quotedMessageId | string | Send as a reply to this message id. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-document" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"url": "https://example.com/invoice.pdf",
"filename": "invoice.pdf",
"caption": "Your order"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send a location
/v1/whatsapp/sessions/{sessionId}/messages/send-locationSends a map location.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
latituderequired | number | Latitude in degrees. |
longituderequired | number | Longitude in degrees. |
description | string | A name for the place. |
address | string | A street address. |
quotedMessageId | string | Send as a reply to this message id. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-location" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"latitude": -1.2921,
"longitude": 36.8219,
"description": "Our shop",
"address": "Nairobi, Kenya"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send a contact card
/v1/whatsapp/sessions/{sessionId}/messages/send-contactSends a contact card.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
contactNamerequired | string | The name on the card. |
contactNumberrequired | string | The phone number on the card. |
quotedMessageId | string | Send as a reply to this message id. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-contact" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"contactName": "Support",
"contactNumber": "254700000003"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send a poll
/v1/whatsapp/sessions/{sessionId}/messages/send-pollSends a native WhatsApp poll.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
namerequired | string | The poll question. |
optionsrequired | string[] | The answer options. |
allowMultipleAnswers | boolean | Let people pick more than one option. |
quotedMessageId | string | Send as a reply to this message id. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-poll" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"name": "Pick a delivery slot",
"options": [
"Morning",
"Afternoon"
],
"allowMultipleAnswers": false
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Send a template
/v1/whatsapp/sessions/{sessionId}/messages/send-templateRenders one of your stored templates and sends it as a text message. Give templateId or templateName.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The recipient chat id. |
templateId | string | The template id. Send this or templateName. |
templateName | string | The template name. Send this or templateId. |
vars | object | Values for the {{placeholder}} tokens in the template. |
mentions | string[] | Chat ids to @mention. |
linkPreview | boolean | Whether to attach a link preview. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-template" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"templateName": "order-confirmation",
"vars": {
"customer": "Amina",
"orderId": "1001"
}
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Reply to a message
/v1/whatsapp/sessions/{sessionId}/messages/replySends a text that quotes an earlier message.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The chat the message is in. |
quotedMessageIdrequired | string | The id of the message to reply to. |
textrequired | string | The reply text. |
mentions | string[] | Chat ids to @mention. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/reply" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"quotedMessageId": "3EB0A1B2C3D4E5F60789",
"text": "Sure, on its way."
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Forward a message
/v1/whatsapp/sessions/{sessionId}/messages/forwardForwards a message to another chat.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
fromChatIdrequired | string | The chat the message is in. |
toChatIdrequired | string | The chat to forward it to. |
messageIdrequired | string | The message to forward. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/forward" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"fromChatId": "[email protected]",
"toChatId": "[email protected]",
"messageId": "3EB0A1B2C3D4E5F60789"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}React to a message
/v1/whatsapp/sessions/{sessionId}/messages/reactAdds a reaction to a message, or removes it.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The chat the message is in. |
messageIdrequired | string | The message to react to. |
emojirequired | string | The reaction emoji. Send an empty string to remove your reaction. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/react" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"messageId": "3EB0A1B2C3D4E5F60789",
"emoji": "👍"
}'{
"success": true
}Edit a sent message
/v1/whatsapp/sessions/{sessionId}/messages/editEdits the text of a message your number sent.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The chat the message is in. |
messageIdrequired | string | The message to edit. |
bodyrequired | string | The new text. |
mentions | string[] | Chat ids to @mention. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/edit" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"messageId": "3EB0A1B2C3D4E5F60789",
"body": "Corrected text"
}'{
"message_id": "3EB0A1B2C3D4E5F60789",
"chat_id": "[email protected]",
"timestamp": 1768469400
}Delete a message
/v1/whatsapp/sessions/{sessionId}/messages/deleteDeletes a message.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
chatIdrequired | string | The chat the message is in. |
messageIdrequired | string | The message to delete. |
forEveryone | boolean | Delete for everyone in the chat, not just for you. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/delete" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatId": "[email protected]",
"messageId": "3EB0A1B2C3D4E5F60789",
"forEveryone": true
}'{
"success": true
}Send in bulk
/v1/whatsapp/sessions/{sessionId}/messages/send-bulkQueues up to 100 messages to different recipients as one asynchronous batch and returns at once with 202 Accepted. Messages are sent one at a time with a pause between them. Poll the batch for progress, or cancel it.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
messagesrequired | object[] | Up to 100 items. Each has chatId, a type (text, image, video, audio or document), and content: text for text, or an object such as image with url or base64, plus an optional caption (up to 1024 characters). Text is up to 4096 characters. Optional variables are substituted into the text. Exact duplicate items are collapsed. |
batchId | string | Your own batch id. Generated if omitted. |
options.delayBetweenMessages | integer | Pause between messages in milliseconds, 1000 to 60000. Defaults to 3000. |
options.randomizeDelay | boolean | Add a random 0 to 2 seconds to each pause. Defaults to true. |
options.stopOnError | boolean | Stop the batch at the first failure. Defaults to false. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/send-bulk" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"chatId": "[email protected]",
"type": "text",
"content": {
"text": "Your order 1001 is ready."
}
},
{
"chatId": "[email protected]",
"type": "text",
"content": {
"text": "Your order 1002 is ready."
}
}
],
"options": {
"delayBetweenMessages": 3000
}
}'{
"batchId": "batch_01",
"status": "pending",
"totalMessages": 2,
"estimatedCompletionTime": "2026-01-15T09:31:00Z"
}Get a batch's status
/v1/whatsapp/sessions/{sessionId}/messages/batch/{batchId}Returns the progress of a bulk batch and the result for each recipient.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
batchIdrequired | path | The batch id returned by send-bulk. |
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/batch/batch_01" \
-H "X-API-Key: $TUSK_WA_KEY"{
"batchId": "batch_01",
"status": "processing",
"progress": {
"total": 2,
"sent": 1,
"failed": 0,
"pending": 1,
"cancelled": 0
},
"results": [
{
"chatId": "[email protected]",
"status": "sent",
"messageId": "3EB0A1B2C3D4E5F60789",
"sentAt": "2026-01-15T09:30:03Z"
},
{
"chatId": "[email protected]",
"status": "pending"
}
],
"startedAt": "2026-01-15T09:30:00Z"
}Batch status is pending, processing, completed, cancelled or failed. Each result is pending, sent, failed or cancelled.
Cancel a batch
/v1/whatsapp/sessions/{sessionId}/messages/batch/{batchId}/cancelCancels a running batch. Messages already sent stay sent.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
batchIdrequired | path | The batch to cancel. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/messages/batch/batch_01/cancel" \
-H "X-API-Key: $TUSK_WA_KEY"{
"batchId": "batch_01",
"status": "cancelled",
"progress": {
"total": 2,
"sent": 1,
"failed": 0,
"pending": 0,
"cancelled": 1
}
}