Messages
Send messages to your contacts and clients on every connected channel, and read a contact's conversation.
- Send to an existing
contactorclientby id, or (WhatsApp) to arecepientphone number: the contact is created if needed. - Pass
locationto choose the workspace whose connected channel sends the message, and optionallyscheduleDateTimeto send later. - Outside the 24-hour customer service window, WhatsApp only allows approved templates.
- A successful request returns
{"success": true}once the message is queued; delivery status shows in the Team Inbox and in message webhooks.
api.whautomate.comGet Messages of Contact
/v1/messages/{contactId}x-api-keystringrequiredcontactIdstringrequiredlimitstringpagestringsearchTextstringidstringcontactobjectchannelstringisIncomingbooleantypestringsentBystringstatusstringerrorMessagestringmediaUrlstringtextstringfooterTextstringoptionsobjectcurl -X GET "https://api.whautomate.com/v1/messages/{contactId}" \
-H "x-api-key: YOUR_API_KEY"
[
{
"id": "string",
"contact": {
"id": "string",
"channel": "string",
"phoneNumber": "string"
},
"channel": "string",
"isIncoming": true,
"type": "string",
"sentBy": "string",
"status": "string",
"errorMessage": "string",
"mediaUrl": "string",
"text": "string",
"footerText": "string",
"options": {
"type": "string",
"buttons": [
{
"type": "string",
"text": "string",
"url": "string"
}
]
}
}
]
WhatsApp
Please note you can only send Media and Text Messages when there is an active session (24 hr period). You can send template messages to a contact any time even if there is no active session.
You can send WhatsApp messages to
- Contact
- Client
- Recepient
Simply send the message to a recepient with phoneNumber and name, the platform will create or use the existing contact in your account.
If you already have a contact or Client created in Whautomate and you have those identifiers, use those identifiers to send the message to them. If not use recepient instead.
POST /v1/messages/whatsapp/sendtemplate
/v1/messages/whatsapp/sendtemplatex-api-keystringrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringtemplateobjectrequiredheaderMediaUrlstringheaderTextParametersstring[]bodyTextParametersstring[]buttonUrlParametersstring[]locationParametersobjectflowParametersobjectlocationobjectrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringtemplateobjectrequiredheaderMediaUrlstringheaderTextParametersstring[]bodyTextParametersstring[]buttonUrlParametersstring[]locationParametersobjectflowParametersobjectlocationobjectrequiredcurl -X POST "https://api.whautomate.com/v1/messages/whatsapp/sendtemplate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string",
"name": "string"
},
"scheduleDateTime": "string",
"template": {
"name": "string",
"language": "string"
},
"headerMediaUrl": "string",
"headerTextParameters": [
"string"
],
"bodyTextParameters": [
"string"
],
"buttonUrlParameters": [
"string"
],
"locationParameters": {
"latitude": 0,
"longitude": 0,
"address": "string",
"name": "string"
},
"flowParameters": {
"flowToken": "string",
"flowData": "string"
},
"location": {
"id": "string"
}
}'
{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string",
"name": "string"
},
"scheduleDateTime": "string",
"template": {
"name": "string",
"language": "string"
},
"headerMediaUrl": "string",
"headerTextParameters": [
"string"
],
"bodyTextParameters": [
"string"
],
"buttonUrlParameters": [
"string"
],
"locationParameters": {
"latitude": 0,
"longitude": 0,
"address": "string",
"name": "string"
},
"flowParameters": {
"flowToken": "string",
"flowData": "string"
},
"location": {
"id": "string"
}
}
POST /users
<Description of the endpoint>
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Body
| Name | Type | Description |
|---|---|---|
name | string | Name of the user |
age | number | Age of the user |
Response
- 200
- 400
{
"id": 1,
"name": "John",
"age": 30
}
{
"error": "Invalid request"
}
POST /v1/messages/whatsapp/sendmedia
/v1/messages/whatsapp/sendmediax-api-keystringrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringmimeTypestringrequiredmediaUrlstringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/whatsapp/sendmedia" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string"
},
"scheduleDateTime": "string",
"mimeType": "string",
"mediaUrl": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
POST /v1/messages/whatsapp/sendtext
/v1/messages/whatsapp/sendtextx-api-keystringrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/whatsapp/sendtext" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
WhatsApp interactive messages
Inside an open 24-hour conversation you can also send interactive messages: up to 3 reply buttons, a list of up to 10 options, a button that opens a URL, or your WhatsApp catalog. Replies to buttons and list options arrive as incoming messages and can trigger your automations.
Send WhatsApp Reply Buttons Message
/v1/messages/whatsapp/sendinteractivebuttonsx-api-keystringrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredheaderTypestring (enum)TEXT, IMAGE, DOCUMENT, VIDEO.headerTextMessagestringmimeTypestringmediaUrlstringbuttonsstring[]requiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/whatsapp/sendinteractivebuttons" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string",
"name": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"headerType": "TEXT",
"headerTextMessage": "string",
"mimeType": "string",
"mediaUrl": "string",
"buttons": [
"string"
],
"location": {
"id": "string"
}
}'
{
"success": true
}
Send WhatsApp List Message
/v1/messages/whatsapp/sendinteractivelistx-api-keystringrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredheaderTypestring (enum)TEXT.headerTextMessagestringlistButtonTitlestringrequiredlistSectionTitlestringbuttonsobject[]requiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/whatsapp/sendinteractivelist" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string",
"name": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"headerType": "TEXT",
"headerTextMessage": "string",
"listButtonTitle": "string",
"listSectionTitle": "string",
"buttons": [
{
"id": "string",
"title": "string",
"description": "string"
}
],
"location": {
"id": "string"
}
}'
{
"success": true
}
Send WhatsApp Call-to-Action URL Message
/v1/messages/whatsapp/sendinteractivectaurlx-api-keystringrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredheaderTypestring (enum)TEXT, IMAGE, DOCUMENT, VIDEO.headerTextMessagestringmimeTypestringmediaUrlstringbuttonTitlestringrequiredbuttonUrlstringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/whatsapp/sendinteractivectaurl" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string",
"name": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"headerType": "TEXT",
"headerTextMessage": "string",
"mimeType": "string",
"mediaUrl": "string",
"buttonTitle": "string",
"buttonUrl": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
Send WhatsApp Catalog Message
/v1/messages/whatsapp/sendcatalogx-api-keystringrequiredclientobjectcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/whatsapp/sendcatalog" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string"
},
"contact": {
"id": "string"
},
"recepient": {
"phoneNumber": "string",
"name": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
Telegram
/v1/messages/telegram/sendmediax-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringmimeTypestringrequiredmediaUrlstringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/telegram/sendmedia" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"mimeType": "string",
"mediaUrl": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
POST /v1/messages/telegram/sendtext
/v1/messages/telegram/sendtextx-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringtextMessagestringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/telegram/sendtext" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
POST /v1/messages/telegram/sendtemplate
/v1/messages/telegram/sendtemplatex-api-keystringrequiredcontactobjectrequiredlocationobjectrequiredheaderTypestring (enum)IMAGE, VIDEO, DOCUMENT.mimeTypestringmediaUrlstringtextMessagestringrequiredbuttonsobject[]requiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/telegram/sendtemplate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"location": {
"id": "string"
},
"headerType": "IMAGE",
"mimeType": "string",
"mediaUrl": "string",
"textMessage": "string",
"buttons": [
{
"type": "web_url",
"title": "string",
"payload": "string",
"url": "string"
}
]
}'
{
"success": true
}
Instagram
/v1/messages/instagram/sendmediax-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringmimeTypestringrequiredmediaUrlstringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/instagram/sendmedia" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"mimeType": "string",
"mediaUrl": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
POST /v1/messages/instagram/sendtemplate
/v1/messages/instagram/sendtemplatex-api-keystringrequiredcontactobjectrequiredlocationobjectrequiredelementsobject[]requiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/instagram/sendtemplate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"location": {
"id": "string"
},
"elements": [
{
"title": "string",
"subtitle": "string",
"image_url": "string",
"default_action": {
"type": "string",
"url": "string"
},
"buttons": [
{
"type": "web_url",
"title": "string",
"payload": "string",
"url": "string"
}
]
}
]
}'
{
"success": true
}
POST /v1/messages/instagram/sendtext
/v1/messages/instagram/sendtextx-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringtextMessagestringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/instagram/sendtext" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
Messenger
/v1/messages/messenger/sendmediax-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringmimeTypestringrequiredmediaUrlstringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/messenger/sendmedia" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"mimeType": "string",
"mediaUrl": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
POST /v1/messages/messenger/sendtemplate
/v1/messages/messenger/sendtemplatex-api-keystringrequiredcontactobjectrequiredlocationobjectrequiredelementsobject[]requiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/messenger/sendtemplate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"location": {
"id": "string"
},
"elements": [
{
"title": "string",
"subtitle": "string",
"image_url": "string",
"default_action": {
"type": "string",
"url": "string"
},
"buttons": [
{
"type": "web_url",
"title": "string",
"payload": "string",
"url": "string"
}
]
}
]
}'
{
"success": true
}
POST /v1/messages/messenger/sendtext
/v1/messages/messenger/sendtextx-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringtextMessagestringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/messenger/sendtext" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
TikTok
Send messages to contacts who messaged your connected TikTok Business account. Use the contact id, or the tikTokUserId of the recipient. TikTok lets businesses reply only within the time window TikTok allows after the customer's last message.
Send TikTok Text Message
/v1/messages/tiktok/sendtextx-api-keystringrequiredcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/tiktok/sendtext" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"recepient": {
"tikTokUserId": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
Send TikTok Media Message
/v1/messages/tiktok/sendmediax-api-keystringrequiredcontactobjectrecepientobjectscheduleDateTimestringmimeTypestringrequiredmediaUrlstringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/tiktok/sendmedia" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"recepient": {
"tikTokUserId": "string"
},
"scheduleDateTime": "string",
"mimeType": "string",
"mediaUrl": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
Send TikTok Q&A Button Card
/v1/messages/tiktok/sendqabuttoncardx-api-keystringrequiredcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredbuttonsstring[]requiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/tiktok/sendqabuttoncard" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"recepient": {
"tikTokUserId": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"buttons": [
"string"
],
"location": {
"id": "string"
}
}'
{
"success": true
}
Send TikTok Q&A Text Link Card
/v1/messages/tiktok/sendqatextlinkcardx-api-keystringrequiredcontactobjectrecepientobjectscheduleDateTimestringtextMessagestringrequiredbuttonsstring[]requiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/tiktok/sendqatextlinkcard" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"recepient": {
"tikTokUserId": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"buttons": [
"string"
],
"location": {
"id": "string"
}
}'
{
"success": true
}
Live Chat (website)
Send messages to visitors who chat with you through your live chat widget. Use the contact id of the visitor.
Send Live Chat Text Message
/v1/messages/website/sendtextx-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringtextMessagestringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/website/sendtext" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
Send Live Chat Media Message
/v1/messages/website/sendmediax-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringmimeTypestringrequiredmediaUrlstringrequiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/website/sendmedia" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"mimeType": "string",
"mediaUrl": "string",
"location": {
"id": "string"
}
}'
{
"success": true
}
Send Live Chat Template Message
/v1/messages/website/sendtemplatex-api-keystringrequiredcontactobjectrequiredscheduleDateTimestringtextMessagestringrequiredheaderTypestring (enum)TEXT, IMAGE, DOCUMENT, VIDEO.headerTextMessagestringmimeTypestringmediaUrlstringbuttonsobject[]requiredlocationobjectrequiredsuccessbooleancurl -X POST "https://api.whautomate.com/v1/messages/website/sendtemplate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"id": "string"
},
"scheduleDateTime": "string",
"textMessage": "string",
"headerType": "TEXT",
"headerTextMessage": "string",
"mimeType": "string",
"mediaUrl": "string",
"buttons": [
{
"type": "web_url",
"title": "string",
"url": "string",
"payload": "string"
}
],
"location": {
"id": "string"
}
}'
{
"success": true
}