Get Chat History
ethora-chats-history-v2Read the archived messages of a chat room (GET /v2/apps/:appId/chats/:chatId/messages, newest last). Returns results with from, nick, body, ts (ms) plus a nextBefore cursor for older pages. Identify the room by roomJid (${appId}_${chatId}) or bare chatId plus the selected app.
Auth: user auth (default on the hosted server) or B2B; app-token mode is not accepted. Errors: 401 not logged in; 403 not the app owner; 404 unknown app/room; 502 MAM_READ_FAILED or mamUnavailable: true when the deployment has no message archive.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | No | 24-char hex appId. Optional when `roomJid` carries it or an app is selected. | |
| limit | No | Maximum number of most-recent messages to return (default 100). | |
| before | No | Pagination cursor: only messages older than this timestamp (ms), from a previous `nextBefore`. | |
| chatId | No | Bare chat id. Needs an app: pass `appId` or select one with `ethora-app-select`. | |
| roomJid | No | Room JID `${appId}_${chatId}` (optionally with `@conference.<host>`). Either this or `chatId` is required. |