Skip to main content
Stored chat transcripts, one session at a time. The server stores most chat turns here itself as they happen, the dashboard also saves entries through POST, and it reads a chat back a page at a time. Use this page when you read or archive conversations outside the dashboard. Examples use the default port 18790 and no access token. With STUDIO_ACCESS_TOKEN set, add -b 'clawboo_access=<token>' to each curl. All four routes are on the general rate limit described in the REST API overview. Errors use { "error": "<message>" }.

Routes

Sessions and entries

Each stored row belongs to one session key. The keys the server reads for itself: Other chats, such as an OpenClaw agent’s 1:1 chat, use the session key the dashboard already holds for them. Each row stores one transcript entry as JSON:

Three ways a conversation ends

All three also clear the saved resume points of the sessions involved. A resume point is the saved session an agent continues from on its next turn. Clawboo Native, Claude Code, Codex and Hermes agents keep one for a 1:1 chat, and Clawboo Native and Codex team leaders keep one per team chat. Clear chat is documented in the Teams API.

GET /api/chat-history

Returns the newest page of a session, oldest first within the page. Pass nextBefore back as before to walk further back. Rows whose stored JSON cannot be parsed are left out.
  • Query params:

Responses

200 OK:
400 Bad Request: no sessionKey:
500 Internal Server Error: a database failure, { "error": "<message>" }.

Example

POST /api/chat-history

Saves transcript entries for one session. Saving is idempotent: an entry whose entryId is already stored is ignored, and an entry with no entryId is skipped.
  • Request body:
Each entry is stored exactly as sent. When it has no timestampMs, only the row’s own timestamp column gets the time it arrived; the entry that GET returns is unchanged.

Responses

200 OK: saved counts the entries received, not the rows written:
400 Bad Request: the body is not a JSON object:
400 Bad Request: no sessionKey, or entries is not a non-empty array:
500 Internal Server Error: a database failure, { "error": "<message>" }.

Example

POST /api/chat-history/reset-context

Writes one divider entry and clears the saved resume point of every listed session, so an agent that resumes from one (see above) starts its next turn fresh. No message is moved, re-keyed or deleted. This is what /reset and /new call. The route does not reach the OpenClaw Gateway: for an OpenClaw agent, the dashboard also sends /reset to the agent’s Gateway session. A team chat passes every teammate’s session key plus one noticeSessionKey, so the person sees one divider in the merged timeline rather than one per teammate.
  • Request body:

Responses

200 OK: the divider that was written, ready to show:
400 Bad Request: no usable session key:
400 Bad Request: noticeSessionKey is not in the list:
500 Internal Server Error: a database failure, { "error": "<message>" }.

Example

DELETE /api/chat-history

Deletes every message of one session and clears its resume point. The dashboard calls this when it deletes an agent. To end a conversation and keep the messages, use reset-context instead.
  • Query params: sessionKey (required).

Responses

200 OK:
400 Bad Request: no sessionKey:
500 Internal Server Error: a database failure, { "error": "<message>" }.

Example

Source of truth: apps/web/server/api/chatHistory.ts; the entry type is TranscriptEntry in packages/protocol/src/index.ts.
  • Team chat: General, rooms, Clear chat and /reset in the dashboard
  • Teams API: Clear chat, stop, and the team chat stream
  • Agents API: 1:1 chat with a Clawboo Native, Claude Code, Codex or Hermes agent and its live stream
  • Database schema: the chat_messages table
Last modified on October 31, 2026