The Sessions API gives you full CRUD control over ChatAgents conversation history. Each session is persisted as a JSON file underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EllisYuan/ChatAgents/llms.txt
Use this file to discover all available pages before exploring further.
data/sessions/<session_id>.json, with a lightweight index at data/sessions/index.json that tracks metadata for all sessions. The API does not require any authentication headers — all endpoints are open. In normal usage, sessions are created and updated automatically by /stream_agent; the management endpoints exist for UI integrations and administrative tooling that need to list, rename, or delete conversations.
GET /api/sessions
Returns the metadata for every session, sorted byupdated_at descending (most recently active first). Individual message histories are not included — use GET /api/sessions/{session_id} to load the full content of a single session.
No request parameters.
Response Body
An array of session metadata objects, sorted by
updated_at descending.Example
GET /api/sessions/{session_id}
Returns the full session object including the complete ordered message history. Use this endpoint to restore a prior conversation in the UI or to export a session’s content.Path Parameters
The unique session identifier. Must match a session that exists in the index.
Response Body
The session’s unique identifier.
The session title.
ISO 8601 creation timestamp.
ISO 8601 timestamp of the last update.
Ordered list of all messages in the conversation.
404 Not Found if no session file exists for the given session_id.
Example
POST /api/sessions
Creates a new, empty session. The session file is written todata/sessions/<session_id>.json and the index at data/sessions/index.json is updated atomically.
Request Body
The identifier to use for the new session. Should be a UUID to avoid collisions with sessions created by
/stream_agent.Optional display title. If omitted, the
session_id string is used as the title.Response Body
Returns the newly created session data object (identical shape toGET /api/sessions/{session_id}), with an empty messages array.
Example
PUT /api/sessions/{session_id}
Renames a session by updating itstitle field in both the session file and the index. The updated_at timestamp is refreshed automatically.
Path Parameters
The identifier of the session to rename.
Request Body
The new display title for the session.
Response Body
true when the rename completed successfully.A confirmation message.
404 Not Found if no session file exists for the given session_id.
Example
DELETE /api/sessions/{session_id}
Permanently deletes a session. Both the session file (data/sessions/<session_id>.json) and its entry in the index (data/sessions/index.json) are removed. This operation cannot be undone.
Path Parameters
The identifier of the session to delete. If the session file does not exist, the endpoint still succeeds after cleaning up the index entry.
Response Body
true when the delete completed without error.A confirmation message.
Example
Sessions are created and updated automatically by the
/stream_agent endpoint at the end of every streaming turn. In most UI integrations you only need to call POST /api/sessions if you want to pre-register a session with a custom title before the first message is sent.