Sync Chat Channel
horizon_sync_chat_channelReads an authorized incremental chat channel snapshot after a subscription resync or explicit user action, returning visible message IDs and messages for the exact cached epoch.
Instructions
Reads an authorized incremental snapshot after subscription resync/event or explicit user action. Use when: explicit hosted chat actions after reading horizon://docs/chat. Not for: automatic sends, repeated polling, rich-text rendering or exposing moderation credentials. Use horizon_get_chat_operation to reconcile original sends, then horizon_send_chat_message only for the explicit identical replay. Requires: userId and the player's session: sign in with horizon_signin_email or horizon_signin_anonymous and pass its accessToken as sessionToken. Side effects: Read-only POST, one HTTP attempt. Complete visible ID order plus unknown immutable text. Known IDs are valid only for the exact cached epoch and complete authorized cache. No periodic polling. Returns: {channel,visibleMessageIds,messages,moderation,serverTime}; hide cache on disconnect/permission change and apply only a complete matching snapshot. Errors: 404 hides private/missing/expired channels or source messages. 409 OPERATION_CONFLICT/OPERATION_EXPIRED or STATE_CONFLICT requires explicit original-intent reconciliation. Never replace an unknown send UUID/time/text. 429 does not schedule a retry. CHAT_MUTED/CHAT_BANNED restrict current chat access. 501 NOT_SUPPORTED means simpleServer has no chat or polling fallback. 401 means the session is missing or expired: sign in again and retry with the new accessToken. 403 for a session means the token belongs to another user: pass the userId that signed in. Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| epoch | Yes | Exact cached channel epoch, or null for an initial complete sync | |
| userId | Yes | Active player matching the current session and project | |
| channelId | Yes | Original canonical lowercase UUID | |
| sessionToken | Yes | Player accessToken sent only as Bearer | |
| knownMessageIds | Yes | Known cached message IDs for the exact original epoch; fixed current wire bound20 matches the largest channel window |