Conversations
conversations:read conversations:writeA conversation is a live chat: from the website widget, or from a connected channel (WhatsApp, Instagram, Messenger, Telegram). Your team answers them all from one queue in the dashboard. With the API your systems can read them, reply (for example from your own bot or order system), and pass chats to people.
How a chat moves
Section titled “How a chat moves”status |
Who has it |
|---|---|
bot_active |
Supportaka’s bot or a bot flow is answering |
queued |
Waiting for a person |
assigned |
A person has it (assignee) |
closed |
Finished. It takes no more messages |
channel tells you where it came from (null for the website widget), and customer who it is, when known.
List and read
Section titled “List and read”# Chats waiting for a person, longest wait firstcurl "https://api.supportaka.com/api/v1/organizations/$ORG/products/$PRODUCT/conversation-queue" \ -H "Authorization: Bearer $SUPPORTAKA_KEY"
# Recently active chatscurl "https://api.supportaka.com/api/v1/organizations/$ORG/products/$PRODUCT/conversations?sort=activity&status=assigned" \ -H "Authorization: Bearer $SUPPORTAKA_KEY"Messages are numbered in order (sequence 1, 2, 3…). To read a chat, or catch up on what’s new since you last looked, pass the last number you have:
curl "https://api.supportaka.com/api/v1/organizations/$ORG/products/$PRODUCT/conversations/$CHAT/messages?after_sequence=12" \ -H "Authorization: Bearer $SUPPORTAKA_KEY"The answer includes the conversation’s last_sequence, so you know when you’ve caught up. Each message has a sender (visitor, agent or bot), a body and any attachments.
import { randomUUID } from 'node:crypto';
const res = await fetch(`${base}/conversations/${chatId}/messages`, { method: 'POST', headers, body: JSON.stringify({ client_message_id: randomUUID(), // keep it until the send succeeds; resending it never posts twice body: 'Your order #1042 left our warehouse this morning. Tracking: https://example.com/t/1042', }),});import uuid
res = session.post(f"{base}/conversations/{chat_id}/messages", json={ "client_message_id": str(uuid.uuid4()), # keep it until the send succeeds; resending it never posts twice "body": "Your order #1042 left our warehouse this morning. Tracking: https://example.com/t/1042",})- Who it’s from. The reply comes from the owner who made the API key.
- Taking the chat. Replying to a
queuedchat claims it for that person. If someone else already has the chat, you get403 CONVERSATION_NOT_YOURS, so you never talk over a colleague. - Channels. On WhatsApp, Instagram, Messenger and Telegram the reply goes back through that channel. The answer comes when it’s stored; its
deliveryshows whether the channel accepted it. If the channel is disconnected you get409 CHANNEL_UNAVAILABLEand nothing is stored.
The WhatsApp 24-hour window
Section titled “The WhatsApp 24-hour window”WhatsApp only allows a free-form reply within 24 hours of the customer’s last message (channel.reply_window_ends_at). After that, replies answer 409 CHANNEL_REPLY_WINDOW_CLOSED. Send an approved template instead:
# Which templates can be used herecurl "https://api.supportaka.com/api/v1/organizations/$ORG/products/$PRODUCT/conversations/$CHAT/templates" \ -H "Authorization: Bearer $SUPPORTAKA_KEY"Then send one with POST …/conversations/{conversationID}/template-messages. The API reference shows the body for the template’s parameters.
Hand over and finish
Section titled “Hand over and finish”| To… | Call |
|---|---|
| Take the chat that has waited longest | POST …/conversation-queue/claim-next |
| Take a particular waiting chat | POST …/conversations/{conversationID}/claim |
| Pass it to a colleague or department | POST …/conversations/{conversationID}/transfer |
| Stop the bot answering this customer for a while | PUT …/conversations/{conversationID}/bot-pause with hours |
| Turn it into a ticket for follow-up | POST …/conversations/{conversationID}/ticket |
| Close it | POST …/conversations/{conversationID}/close |
Know when something happens
Section titled “Know when something happens”Subscribe a webhook to conversation.created, conversation.message_created (with the message’s sequence and sender) and conversation.closed.
Real-time typing indicators and read receipts aren’t part of the API; they’re for the dashboard and widget only.