GET /api/chat/history returns the recent conversation. It is the only read path for chat
content.
The window
The endpoint returns the last 60 messages, oldest first. It is not paginated, and there is no query parameter. Older messages exist in the database, but the API does not expose them. The model sees the same 60-message window, plus rolling summaries of what came before.The fixed window is a decision, not a gap. An unpaged read of a growing table was the most common
source of silent data loss in the previous backend. Read
The API contract.
Message fields
When to call it
Call the endpoint at these four moments:- When the chat screen opens.
- When the application returns to the foreground.
- After the student opens a push notification. Lala writes messages on its own.
- After an SSE
errorevent, to resynchronize the local list.