Conversations and AI

Inbox and replies

Read every channel's conversations in one inbox, answer customers, and take over from the bot.

Every message a customer sends, on WhatsApp or Instagram, lands in one inbox. Your integration reads it and answers in the same thread, on the customer's own channel.

List conversations

curl "https://v3.ghala.io/v1/conversations?channel=whatsapp&waiting=true" \
  -H "Authorization: Bearer $GHALA_KEY"
GET/v1/conversationsList conversationsmessages:read

Newest first, each with its last message, unread count and 24 hour window. Filter with:

FilterKeeps
channelone channel, such as whatsapp or instagram
statusopen, closed or escalated
unread=trueconversations with unread messages
waiting=trueconversations where the customer wrote last
window=openconversations inside the 24 hour reply window
qa name or a number, in any spelling

Read a conversation

GET/v1/conversations/{conversation}/messagesList conversation messagesmessages:read

Messages come newest first. Reading the first page marks the conversation read; add mark_read=false to leave it unread.

Answer the customer

curl https://v3.ghala.io/v1/conversations/$CONVERSATION_ID/messages \
  -H "Authorization: Bearer $GHALA_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-$CONVERSATION_ID-1" \
  -d '{"type": "text", "content": "Karibu! Your order is on its way."}'
POST/v1/conversations/{conversation}/messagesReply in conversationmessages:send

The reply goes on the conversation's own channel, in that channel's shape:

  • WhatsApp: type is text (with content), image, document, video or audio (with an https url), or template. Outside the 24 hours after the customer last wrote, only a template goes.
  • Instagram: the Instagram types. An API key replies only within 24 hours of the person's last message.

Send an Idempotency-Key: a retry with it answers the first reply and is never sent or charged twice.

Take over from the bot

When a bot answers a number, a person can step in:

POST/v1/conversations/{conversation}/takeoverTake over conversationmessages:send

This quiets the bot for the number's takeover window and answers an escalation. Hand the conversation back with:

POST/v1/conversations/{conversation}/resumeResume conversationmessages:send

A reply from a person also pauses the bot.

Follow the inbox live

GET /v1/conversations/events is a stream of server-sent events: message.* and conversation.*. Reconnect with Last-Event-ID to resume where you left off. To be posted events instead, use webhooks.

All endpoints

On this page