Back to Eliza

Inbox API

packages/docs/rest/inbox.md

2.0.16.4 KB
Original Source

The inbox API provides a read-only, time-ordered view of messages from every connector channel the agent participates in — iMessage, Telegram, Discord, WhatsApp, WeChat, Slack, Signal, and SMS — merged into a single feed. Dashboard web-chat messages are excluded since they are already accessible via the conversations API.

Endpoints

MethodPathDescription
GET/api/inbox/messagesList recent messages across all connector channels
GET/api/inbox/chatsList connector chat threads (one row per room)
GET/api/inbox/sourcesList distinct connector source tags

GET /api/inbox/messages

List the most recent messages across all connector channels in a time-ordered feed (newest first).

Query parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo100Maximum messages to return (hard cap 500)
sourcesstringNoAll inbox sourcesComma-separated source filter (e.g. discord,telegram)
roomIdstringNoScope to a single room ID for thread-level views

Response

json
{
  "messages": [
    {
      "id": "uuid",
      "role": "user",
      "text": "Hey, check this out!",
      "timestamp": 1718000000000,
      "source": "discord",
      "roomId": "room-uuid",
      "from": "Alice",
      "fromUserName": "alice#1234",
      "avatarUrl": "https://cdn.discordapp.com/avatars/..."
    }
  ],
  "count": 1
}
FieldTypeDescription
messages[].idstringMemory UUID
messages[].rolestringuser or assistant
messages[].textstringMessage text content
messages[].timestampnumberUnix timestamp (ms) when the message was created
messages[].sourcestringConnector source tag (e.g. imessage, telegram, discord)
messages[].roomIdstringExternal chat room ID for threading
messages[].fromstring|undefinedBest-effort display name of the sender entity
messages[].fromUserNamestring|undefinedUsername or handle of the sender (e.g. Discord username)
messages[].avatarUrlstring|undefinedSender avatar URL when the connector provides one

For Discord messages, from, fromUserName, and avatarUrl are enriched from the live Discord user profile when available.


GET /api/inbox/chats

List connector chat threads — one row per external chat room. Used by the sidebar to display a chat list alongside dashboard conversations.

Query parameters

ParameterTypeRequiredDefaultDescription
sourcesstringNoAll inbox sourcesComma-separated source filter

Response

json
{
  "chats": [
    {
      "id": "room-uuid",
      "source": "discord",
      "title": "#general",
      "lastMessageText": "Hey, check this out!",
      "lastMessageAt": 1718000000000,
      "messageCount": 42
    }
  ],
  "count": 1
}
FieldTypeDescription
chats[].idstringRoom ID (stable across polls, used as selection key)
chats[].sourcestringConnector source tag for badge rendering
chats[].titlestringDisplay title — channel name, contact name for DMs, or fallback "<source> chat"
chats[].lastMessageTextstringPreview of the most recent message (truncated to 140 characters)
chats[].lastMessageAtnumberEpoch ms timestamp of the most recent message
chats[].messageCountnumberTotal messages in this room at scan time

Chat titles are resolved in the following priority order:

  1. Live Discord channel name (fetched from the Discord client for Discord sources)
  2. Stored room name (set by the connector plugin when the room was created)
  3. Latest sender name (for DM rooms)
  4. Fallback: "<source> chat"

GET /api/inbox/sources

List the distinct set of connector source tags the agent currently has messages for. Use this to build dynamic source filter chips in the UI without hardcoding connector names.

Response

json
{
  "sources": ["imessage", "telegram", "discord", "whatsapp"]
}
FieldTypeDescription
sourcesstring[]Array of distinct source tags present in agent message history

Supported sources

The inbox includes messages from these connector sources by default:

Source tagPlatform
imessageiMessage
telegramTelegram
discordDiscord
gmailGmail
whatsappWhatsApp
wechatWeChat
slackSlack
signalSignal
smsSMS

Messages from client_chat (dashboard web chat) and internal sources (system events, knowledge ingestion) are excluded from the inbox feed.

Common error codes

StatusCodeDescription
500INTERNAL_ERRORFailed to load inbox data