Skip to content

Team Inbox API

The Team Inbox provides a unified, real-time shared inbox across all messaging channels. Agents can view, reply to, and manage conversations from WhatsApp, Telegram, SMS, and RCS in one place.

MethodEndpointDescription
GET/team-inbox/api/messages/List inbox messages
GET/team-inbox/api/messages/{id}/Get message details
GET/team-inbox/api/stats/Inbox statistics
GET/team-inbox/api/export-pdf/Export conversation as PDF
GET/team-inbox/websocket/info/WebSocket connection info

Connect to the real-time inbox:

ws://your-domain.com/ws/team-inbox/{tenant_id}/

Pass JWT token as a query parameter:

ws://your-domain.com/ws/team-inbox/{tenant_id}/?token=eyJhbGci...

Incoming events (server → client):

EventDescription
new_messageNew message received from any channel
message_statusDelivery status update (sent, delivered, read)
typing_indicatorContact is typing
assignment_updateContact assigned/reassigned
ticket_updateTicket opened/closed

Outgoing events (client → server):

EventDescription
send_messageSend a reply to a contact
mark_readMark messages as read
typingSend typing indicator
assignAssign contact to agent

Each message in the inbox has:

FieldTypeDescription
platformenumWHATSAPP, TELEGRAM, SMS, RCS, VOICE
directionenumINCOMING, OUTGOING
author_typeenumUSER, CONTACT, BOT
contentJSONMessage content (text, media, etc.)
is_readbooleanRead by agent
wa_messageFKLinked WhatsApp message (for status tracking)
expires_atdatetime24-hour expiry for WhatsApp conversations
Terminal window
curl http://localhost:8000/team-inbox/api/stats/ \
-H "Authorization: Bearer <token>"

Returns:

  • Total conversations
  • Unread count
  • Open tickets
  • Conversations by channel
  • Agent workload distribution

Export a conversation thread as a formatted PDF:

Terminal window
curl http://localhost:8000/team-inbox/api/export-pdf/?contact_id={id} \
-H "Authorization: Bearer <token>" \
-o conversation.pdf
SettingDefaultDescription
WEBSOCKET_ACCEPT_ALLTrueAccept WebSocket connections from all origins
WEBSOCKET_TOKEN_EXPIRY3600WebSocket token expiry (seconds)
TEAM_INBOX_MESSAGE_LIMITMax messages per query
TEAM_INBOX_TYPING_TIMEOUTTyping indicator timeout