Messages
Send messages on every channel WhautoChat connects to (WhatsApp, Telegram, Instagram, TikTok, Messenger and website live chat) and read a contact's message history. All paths are under /v1/messages. Send your key in the x-api-key header and send bodies as JSON with Content-Type: application/json. A missing or revoked key gets 401 { "message": "Unauthorized" }. See REST API for how to get a key.
- Queued, not instant. Every send is queued and delivered in the background, straight away or at
scheduleDateTime.200 { "success": true }means the message is queued, not that it was delivered. Follow delivery with Webhooks or read it back with message history. - Choose who receives it. Send either
contactwith the WhautoChat contactid, orrecepientwith the channel's identifier (a phone number, username or user ID, depending on the channel). See addressing. - The field really is spelled
recepient. That is the name the API reads;recipientis ignored. - Choose the workspace.
workspace.idis required on every send and must be a workspace in your account. The message goes out from that workspace's connected channel.
/v1/messages/whatsapp/sendtextSend a text messagePOST/v1/messages/whatsapp/sendmediaSend an image, video or documentPOST/v1/messages/whatsapp/sendtemplateSend an approved templatePOST/v1/messages/whatsapp/sendinteractivebuttonsSend reply buttonsPOST/v1/messages/whatsapp/sendinteractivelistSend a list messagePOST/v1/messages/whatsapp/sendinteractivectaurlSend a link buttonPOST/v1/messages/whatsapp/sendcatalogSend your catalogPOST/v1/messages/whatsapp/sendproductSend one productPOST/v1/messages/whatsapp/sendproductlistSend several productsThe contact, recepient and workspace objects
Every send names one recipient (contact or recepient) and one workspace.
contactobjector recepientAn existing WhautoChat contact.
recepientobjector contactThe channel's own identifier for the person. Which field you send depends on the channel.
workspaceobjectrequiredThe workspace whose connected channel sends the message. It must be in your account.
scheduleDateTimestring2026-11-02T09:30:00Z. Leave it out to send now.| Channel | Address with | Notes |
|---|---|---|
contact.id or recepient.phoneNumber | If no contact has that number yet, the send creates one, named after recepient.name (or the number). | |
| Telegram | contact.id | The contact exists once the person messages your Telegram bot. |
contact.id or recepient.username | The contact exists once the person messages your Instagram account. | |
| TikTok | contact.id or recepient.tikTokUserId | The contact exists once the person messages your TikTok account. |
| Messenger | contact.id (or recepient.messengerId on sendtemplate) | The contact exists once the person messages your Facebook Page. |
| Website live chat | contact.id | Visitors who have chatted with you through your website widget. |
On Instagram, TikTok and Messenger, a recepient that matches no contact returns 400 asking you to get the contact to start the conversation first.
{
"contact": { "id": "Xk82LmQp4T" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"scheduleDateTime": "2026-11-02T09:30:00Z"
}
{
"recepient": { "phoneNumber": "+12025550188", "name": "Maria Lopez" },
"workspace": { "id": "Wk7Hs2Pq9L" }
}
Sending rules
These apply to every POST endpoint on this page.
- Scheduling.
scheduleDateTimeis optional. Send an ISO 8601 date and time (for example2026-11-02T09:30:00Z) to send later, or leave it out to send now. - Media. For
mediaUrl, give a public URL that WhautoChat can download. WhautoChat downloads and stores the file when you call the API, so the URL only needs to work at that moment. If the download fails you get400 { "error": "Error downloading file from the URL" }. Most channels sendimage/jpegandimage/pngas images,video/mp4andvideo/3gppas videos, and anything else as a document. - Personalisation. Text in
textMessage(and in the list, button and header text that the channel supports) goes through the same contact personalisation as messages sent from the app. - WhatsApp 24-hour window. WhatsApp only delivers free-form messages (text, media, interactive and product messages) to people who messaged you in the last 24 hours. To start a conversation, or after the window has closed, use a template. The API queues the message either way, so a free-form message outside the window fails at delivery, not at the API call.
- Errors. Error bodies have an
errorfield with the reason (except401). A500means the request could not be completed; retry, and contact support if it keeps happening.
The message object
idstringcontactobjectThe contact the message belongs to.
channelstringwhatsapp, telegram, instagram, tiktok, messenger or websiteisIncomingbooleantrue for messages from the contact, false for messages you sentfromstringsentBystringreplyToMessageobject{ "id": "..." }mediaUrlstringtype, status, errorMessage, headerText, caption, text, footerText, optionsvarioustimestamp, createdAt, updatedAtstringFields that do not apply are left out.
{
"id": "a1B2c3D4e5",
"contact": {
"id": "Xk82LmQp4T",
"channel": "whatsapp",
"phoneNumber": "12025550188"
},
"channel": "whatsapp",
"isIncoming": true,
"type": "text",
"from": "Maria Lopez",
"timestamp": "2026-10-12T14:05:11.000Z",
"status": "read",
"text": "Hi, can I move my booking to Friday?",
"createdAt": "2026-10-12T14:05:12.310Z",
"updatedAt": "2026-10-12T14:06:40.902Z"
}
List messages for a contact
/v1/messages/{contactId}Returns one contact's messages, newest first.
contactIdstringrequiredpageintegerdefault 1limitintegerdefault 10100.searchTextstring200 OK: a plain JSON array of messages.
Errors
| Status | Body | When |
|---|---|---|
404 | { "error": "Contact not found" } | The contact is not in your account |
500 | { "error": "Could not retrieve Chat Messages" } | The request could not be completed |
curl "https://api.whauto.chat/v1/messages/Xk82LmQp4T?page=1&limit=20" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
[
{
"id": "a1B2c3D4e5",
"contact": { "id": "Xk82LmQp4T", "channel": "whatsapp", "phoneNumber": "12025550188" },
"channel": "whatsapp",
"isIncoming": true,
"type": "text",
"from": "Maria Lopez",
"timestamp": "2026-10-12T14:05:11.000Z",
"status": "read",
"text": "Hi, can I move my booking to Friday?",
"createdAt": "2026-10-12T14:05:12.310Z",
"updatedAt": "2026-10-12T14:06:40.902Z"
}
]
Send a WhatsApp text message
/v1/messages/whatsapp/sendtextcontactobjector recepient{ "id": "..." }. See addressing.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }: the workspace whose WhatsApp number sends ittextMessagestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact or recepient, workspace.id or textMessage is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Text Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendtext" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "phoneNumber": "+12025550188", "name": "Maria Lopez" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Hi Maria, your order has shipped and will arrive on Thursday."
}'
{ "success": true }
Send WhatsApp media
/v1/messages/whatsapp/sendmediaSends an image, video or document. See media for how files are fetched.
contactobjector recepient{ "id": "..." }. See addressing.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }mediaUrlstringrequiredmimeTypestringrequiredimage/jpeg, video/mp4 or application/pdfscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Media Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendmedia" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "phoneNumber": "+12025550188" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"mediaUrl": "https://example.com/files/invoice-1042.pdf",
"mimeType": "application/pdf"
}'
{ "success": true }
Send a WhatsApp template
/v1/messages/whatsapp/sendtemplateSends an approved WhatsApp template. Use it to start a conversation or after the 24-hour window has closed. The template is looked up by template.name and template.language in the workspace you send from. List your templates with the WhatsApp templates API.
contactobjector recepient{ "id": "..." }. See addressing.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }templateobjectrequiredThe template to send.
headerMediaUrlstringheaderTextParametersstring[]bodyTextParametersstring[]buttonUrlParametersstring[]locationParametersobjectFor a location header.
flowParametersobjectFor a template that opens a WhatsApp Flow.
scheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact or recepient, workspace.id, template.name or template.language is missing, or locationParameters or flowParameters is incomplete |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
404 | { "error": "Invalid WhatsApp Template" } | No template with that name and language in the workspace |
500 | { "error": "Could not send WhatsApp Template Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendtemplate" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "phoneNumber": "+447700900123", "name": "James Carter" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"template": { "name": "appointment_reminder", "language": "en_US" },
"bodyTextParameters": ["James", "Friday 14 November", "10:30"],
"scheduleDateTime": "2026-11-13T09:00:00Z"
}'
{ "success": true }
Send WhatsApp reply buttons
/v1/messages/whatsapp/sendinteractivebuttonscontactobjector recepient{ "id": "..." }. The contact must belong to the workspace you send from.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }textMessagestringrequiredbuttonsstring[]requiredheaderTypestringTEXT, image, video or documentheaderTextMessagestringwith headerType TEXTmediaUrlstringwith a media headerTypemimeTypestringwith mediaUrlscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in that workspace |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Interactive Button Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendinteractivebuttons" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Xk82LmQp4T" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"headerType": "TEXT",
"headerTextMessage": "Your appointment",
"textMessage": "Can you still make it on Friday at 10:30?",
"buttons": ["Yes, confirm", "Reschedule", "Cancel"]
}'
{ "success": true }
Send a WhatsApp list message
/v1/messages/whatsapp/sendinteractivelistcontactobjector recepient{ "id": "..." }. The contact must belong to the workspace you send from.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }textMessagestringrequiredlistButtonTitlestringrequiredbuttonsobject[]requiredThe list rows.
listSectionTitlestringheaderTypestringTEXT is acceptedheaderTextMessagestringwith headerTypescheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in that workspace |
404 | { "error": "Invalid workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Interactive List Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendinteractivelist" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Xk82LmQp4T" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Pick a time that suits you.",
"listButtonTitle": "See times",
"listSectionTitle": "Friday",
"buttons": [
{ "id": "fri-0930", "title": "09:30", "description": "Morning" },
{ "id": "fri-1400", "title": "14:00", "description": "Afternoon" }
]
}'
{ "success": true }
Send a WhatsApp link button
/v1/messages/whatsapp/sendinteractivectaurlcontactobjector recepient{ "id": "..." }. The contact must belong to the workspace you send from.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }textMessagestringrequiredbuttonTitlestringrequiredbuttonUrlstringrequiredheaderTypestringimage, video or document for a media headermediaUrlstringwith a media headerTypemimeTypestringwith mediaUrlscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in that workspace |
404 | { "error": "Invalid workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Interactive CTA URL Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendinteractivectaurl" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Xk82LmQp4T" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Your order is on its way.",
"buttonTitle": "Track order",
"buttonUrl": "https://example.com/track/1042"
}'
{ "success": true }
Send a WhatsApp catalog
/v1/messages/whatsapp/sendcatalogSends your WhatsApp catalog with a message.
contactobjector recepient{ "id": "..." }. The contact must belong to the workspace you send from.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }textMessagestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in that workspace |
404 | { "error": "Invalid workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Catalog Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendcatalog" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "phoneNumber": "+12025550188" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Browse our new season collection."
}'
{ "success": true }
Send a WhatsApp product
/v1/messages/whatsapp/sendproductSends one product from your catalog.
contactobjector recepient{ "id": "..." }. The contact must belong to the workspace you send from.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }textMessagestringrequiredproductobjectrequiredThe product to send.
scheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in that workspace |
404 | { "error": "Invalid workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Product Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendproduct" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "phoneNumber": "+12025550188" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Back in stock in your size.",
"product": { "catalogId": "184467290011", "productRetailerId": "TEE-BLUE-M" }
}'
{ "success": true }
Send a WhatsApp product list
/v1/messages/whatsapp/sendproductlistSends several products from your catalog.
contactobjector recepient{ "id": "..." }. The contact must belong to the workspace you send from.recepientobjector contact{ "phoneNumber": "...", "name": "..." }. Creates the contact if the number is new.workspaceobjectrequired{ "id": "..." }textMessagestringrequiredheaderTextMessagestringrequiredproductListobject[]requiredAt least one item. The catalog of the first item is used.
scheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing or productList is empty |
400 | { "error": "Invalid Contact" } | contact.id is not in that workspace |
404 | { "error": "Invalid workspace" } | The workspace is not in your account |
500 | { "error": "Could not send WhatsApp Product List Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/whatsapp/sendproductlist" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "phoneNumber": "+12025550188" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"headerTextMessage": "New this week",
"textMessage": "Here are three picks we think you will like.",
"productList": [
{ "catalogId": "184467290011", "productRetailerId": "TEE-BLUE-M" },
{ "catalogId": "184467290011", "productRetailerId": "TEE-GREY-M" },
{ "catalogId": "184467290011", "productRetailerId": "CAP-BLK" }
]
}'
{ "success": true }
Send a Telegram text message
/v1/messages/telegram/sendtextThe contact must already exist in WhautoChat, which happens when the person messages your Telegram bot.
contactobjectrequired{ "id": "..." }: an existing Telegram contactworkspaceobjectrequired{ "id": "..." }: the workspace whose Telegram bot sends ittextMessagestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact.id, workspace.id or textMessage is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Telegram Text Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/telegram/sendtext" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Tg93NcWe1R" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Thanks for reaching out. A team member will reply shortly."
}'
{ "success": true }
Send Telegram media
/v1/messages/telegram/sendmediaSends an image, video or document to an existing Telegram contact.
contactobjectrequired{ "id": "..." }: an existing Telegram contactworkspaceobjectrequired{ "id": "..." }mediaUrlstringrequiredmimeTypestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Telegram Media Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/telegram/sendmedia" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Tg93NcWe1R" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"mediaUrl": "https://example.com/images/menu.png",
"mimeType": "image/png"
}'
{ "success": true }
Send a Telegram message with buttons
/v1/messages/telegram/sendtemplateSends a message with buttons and an optional media header to an existing Telegram contact.
contactobjectrequired{ "id": "..." }: an existing Telegram contactworkspaceobjectrequired{ "id": "..." }textMessagestringrequiredbuttonsarrayrequiredheaderTypestringmediaUrlstringwith headerTypemimeTypestringwith headerTypescheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Telegram Media Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/telegram/sendtemplate" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Tg93NcWe1R" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Your order has shipped.",
"buttons": [
{ "type": "web_url", "title": "Track order", "url": "https://example.com/track/1042" }
]
}'
{ "success": true }
Send an Instagram text message
/v1/messages/instagram/sendtextThe contact must already exist in WhautoChat, which happens when the person messages your Instagram account.
contactobjector recepient{ "id": "..." }. See addressing.recepientobjector contact{ "username": "..." }: the contact's Instagram usernameworkspaceobjectrequired{ "id": "..." }: the workspace whose Instagram account sends ittextMessagestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact or recepient, workspace.id or textMessage is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No Instagram contact has that username. Get the contact to start the conversation first. |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Instagram Text Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/instagram/sendtext" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "username": "maria.lopez.studio" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Hi Maria, your class pass is ready to use."
}'
{ "success": true }
Send Instagram media
/v1/messages/instagram/sendmediaSends an image, video or document to an existing Instagram contact.
contactobjector recepient{ "id": "..." }recepientobjector contact{ "username": "..." }workspaceobjectrequired{ "id": "..." }mediaUrlstringrequiredmimeTypestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No Instagram contact has that username |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Instagram Media Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/instagram/sendmedia" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "username": "maria.lopez.studio" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"mediaUrl": "https://example.com/images/timetable.jpg",
"mimeType": "image/jpeg"
}'
{ "success": true }
Send an Instagram generic template
/v1/messages/instagram/sendtemplatecontactobjector recepient{ "id": "..." }recepientobjector contact{ "username": "..." }workspaceobjectrequired{ "id": "..." }elementsarrayrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing or elements is empty |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No Instagram contact has that username |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Instagram Template Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/instagram/sendtemplate" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Ig27PwQs5N" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"elements": [
{
"title": "Spring yoga retreat",
"subtitle": "Three days, from USD 450",
"image_url": "https://example.com/images/retreat.jpg",
"buttons": [
{ "type": "web_url", "url": "https://example.com/retreat", "title": "Book now" }
]
}
]
}'
{ "success": true }
Send a TikTok text message
/v1/messages/tiktok/sendtextThe contact must already exist in WhautoChat, which happens when the person messages your TikTok account.
contactobjector recepient{ "id": "..." }. See addressing.recepientobjector contact{ "tikTokUserId": "..." }: the contact's TikTok user IDworkspaceobjectrequired{ "id": "..." }: the workspace whose TikTok account sends ittextMessagestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact or recepient, workspace.id or textMessage is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No TikTok contact has that user ID. Get the contact to start the conversation first. |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send TikTok Text Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/tiktok/sendtext" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Tt51RbVz8K" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Thanks for your message. Your discount code is SPRING15."
}'
{ "success": true }
Send a TikTok image
/v1/messages/tiktok/sendmediaSends an image. The file is always sent to TikTok as an image.
contactobjector recepient{ "id": "..." }recepientobjector contact{ "tikTokUserId": "..." }workspaceobjectrequired{ "id": "..." }mediaUrlstringrequiredmimeTypestringrequiredimage/jpeg or image/pngscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No TikTok contact has that user ID |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send TikTok Media Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/tiktok/sendmedia" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Tt51RbVz8K" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"mediaUrl": "https://example.com/images/size-guide.png",
"mimeType": "image/png"
}'
{ "success": true }
Send a TikTok Q&A button card
/v1/messages/tiktok/sendqabuttoncardSends a Q&A card: a question with options the person can tap, shown as buttons. To show the options as text links, use the text link card.
contactobjector recepient{ "id": "..." }recepientobjector contact{ "tikTokUserId": "..." }workspaceobjectrequired{ "id": "..." }textMessagestringrequiredbuttonsstring[]requiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing or buttons is empty |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No TikTok contact has that user ID |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send TikTok Q&A Button Card" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/tiktok/sendqabuttoncard" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Tt51RbVz8K" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "What can we help you with?",
"buttons": ["Order status", "Returns", "Talk to a person"]
}'
{ "success": true }
Send a TikTok Q&A text link card
/v1/messages/tiktok/sendqatextlinkcardSame as the button card, with the same body, but the options are shown as text links.
contactobjector recepient{ "id": "..." }recepientobjector contact{ "tikTokUserId": "..." }workspaceobjectrequired{ "id": "..." }textMessagestringrequiredbuttonsstring[]requiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing or buttons is empty |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No TikTok contact has that user ID |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send TikTok Q&A Text Link Card" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/tiktok/sendqatextlinkcard" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recepient": { "tikTokUserId": "7312450098812345678" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Which size are you looking for?",
"buttons": ["Small", "Medium", "Large"]
}'
{ "success": true }
Send a Messenger text message
/v1/messages/messenger/sendtextThe contact must already exist in WhautoChat, which happens when the person messages your Facebook Page.
contactobjectrequired{ "id": "..." }: an existing Messenger contactworkspaceobjectrequired{ "id": "..." }: the workspace whose Facebook Page sends ittextMessagestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact.id, workspace.id or textMessage is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Messenger Text Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/messenger/sendtext" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Ms40JdKa7F" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Your table for two is booked for 19:30 tonight."
}'
{ "success": true }
Send Messenger media
/v1/messages/messenger/sendmediaSends an image, video or document to an existing Messenger contact.
contactobjectrequired{ "id": "..." }: an existing Messenger contactworkspaceobjectrequired{ "id": "..." }mediaUrlstringrequiredimage/gif is sent as an image on Messenger.mimeTypestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Messenger Media Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/messenger/sendmedia" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Ms40JdKa7F" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"mediaUrl": "https://example.com/images/dinner-menu.jpg",
"mimeType": "image/jpeg"
}'
{ "success": true }
Send a Messenger generic template
/v1/messages/messenger/sendtemplatecontactobjector recepient{ "id": "..." }: an existing Messenger contactrecepientobjector contact{ "messengerId": "..." }: the contact's Messenger ID, used instead of contactworkspaceobjectrequired{ "id": "..." }elementsarrayrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing or elements is empty |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Contact not found in WhautoChat, ..." } | No Messenger contact matches recepient.messengerId. Get the contact to start the conversation first. |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Messenger Template Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/messenger/sendtemplate" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Ms40JdKa7F" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"elements": [
{
"title": "Weekend brunch",
"subtitle": "Saturday and Sunday, 10:00 to 14:00",
"image_url": "https://example.com/images/brunch.jpg",
"buttons": [
{ "type": "web_url", "url": "https://example.com/book", "title": "Book a table" }
]
}
]
}'
{ "success": true }
Send a live chat text message
/v1/messages/website/sendtextWebsite live chat messages go to visitors who have chatted with you through your website widget.
contactobjectrequired{ "id": "..." }: an existing live chat contactworkspaceobjectrequired{ "id": "..." }: the workspace that owns the widgettextMessagestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact.id, workspace.id or textMessage is missing |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Website Text Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/website/sendtext" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Wb62HtYu3M" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"textMessage": "Thanks for waiting. Your refund was issued today."
}'
{ "success": true }
Send live chat media
/v1/messages/website/sendmediaSends an image, video or document to an existing live chat contact.
contactobjectrequired{ "id": "..." }: an existing live chat contactworkspaceobjectrequired{ "id": "..." }mediaUrlstringrequiredmimeTypestringrequiredscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | A required field is missing |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Website Media Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/website/sendmedia" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Wb62HtYu3M" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"mediaUrl": "https://example.com/files/refund-receipt.pdf",
"mimeType": "application/pdf"
}'
{ "success": true }
Send a live chat message with buttons
/v1/messages/website/sendtemplateSends a message with buttons and an optional header to an existing live chat contact.
contactobjectrequired{ "id": "..." }: an existing live chat contactworkspaceobjectrequired{ "id": "..." }textMessagestringrequiredbuttonsarrayrequiredheaderTypestringheaderTextMessagestringmediaUrlstringmimeTypestringwith mediaUrlscheduleDateTimestring200 OK: { "success": true }, the message is queued.
Errors
| Status | Body | When |
|---|---|---|
400 | { "error": "Invalid parameters" } | contact.id, workspace.id or textMessage is missing, or buttons is empty |
400 | { "error": "Invalid Contact" } | contact.id is not in your account |
400 | { "error": "Error downloading file from the URL" } | WhautoChat could not download mediaUrl |
404 | { "error": "Invalid Workspace" } | The workspace is not in your account |
500 | { "error": "Could not send Website Template Message" } | The request could not be completed |
curl -X POST "https://api.whauto.chat/v1/messages/website/sendtemplate" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact": { "id": "Wb62HtYu3M" },
"workspace": { "id": "Wk7Hs2Pq9L" },
"headerType": "text",
"headerTextMessage": "Your refund",
"textMessage": "Was this answer helpful?",
"buttons": [
{ "type": "web_url", "title": "View order", "url": "https://example.com/orders/1042" }
]
}'
{ "success": true }