Skip to content

Conversations

Needs: conversations:read conversations:write

A 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.

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.

Terminal window
# Chats waiting for a person, longest wait first
curl "https://api.supportaka.com/api/v1/organizations/$ORG/products/$PRODUCT/conversation-queue" \
-H "Authorization: Bearer $SUPPORTAKA_KEY"
# Recently active chats
curl "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:

Terminal window
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',
}),
});
  • Who it’s from. The reply comes from the owner who made the API key.
  • Taking the chat. Replying to a queued chat claims it for that person. If someone else already has the chat, you get 403 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 delivery shows whether the channel accepted it. If the channel is disconnected you get 409 CHANNEL_UNAVAILABLE and nothing is stored.

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:

Terminal window
# Which templates can be used here
curl "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.

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

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.