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"/v1/conversationsList conversationsmessages:read
Newest first, each with its last message, unread count and 24 hour window. Filter with:
| Filter | Keeps |
|---|---|
channel | one channel, such as whatsapp or instagram |
status | open, closed or escalated |
unread=true | conversations with unread messages |
waiting=true | conversations where the customer wrote last |
window=open | conversations inside the 24 hour reply window |
q | a 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."}'/v1/conversations/{conversation}/messagesReply in conversationmessages:send
The reply goes on the conversation's own channel, in that channel's shape:
- WhatsApp:
typeistext(withcontent),image,document,videooraudio(with an httpsurl), ortemplate. 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
/v1/conversationsGETGet conversation/v1/conversations/{conversation}GETList conversation messages/v1/conversations/{conversation}/messagesPOSTReply in conversation/v1/conversations/{conversation}/messagesPOSTRead conversation/v1/conversations/{conversation}/readGETGet takeover/v1/conversations/{conversation}/takeover-statusPOSTTake over conversation/v1/conversations/{conversation}/takeoverPOSTResume conversation/v1/conversations/{conversation}/resumeGETStream events/v1/conversations/events