Overview
Returns a list of past chat sessions with the CauseFlow AI assistant. Each session contains the full message thread. Useful for reviewing previous analyses and sharing context with teammates.
Required role: admin or member
JWT Bearer token. Format: Bearer <your-jwt>.
Query parameters
Retrieve a specific session’s messages. If omitted, returns a list of session summaries.
Maximum number of sessions (or messages within a session) to return. Default: 20. Maximum: 100.
Pagination cursor from a previous response.
Response
Returns 200 OK.
Session list (no sessionId):
{
"items": [
{
"sessionId": "sess_01HX9VTPQR3KF8MZWBYD5N6JCE",
"summary": "Root cause analysis for checkout 503 incidents",
"messageCount": 6,
"lastMessageAt": "2024-04-01T16:05:00Z"
}
],
"nextCursor": null
}
Session messages (?sessionId=...):
{
"sessionId": "sess_01HX9VTPQR3KF8MZWBYD5N6JCE",
"messages": [
{
"messageId": "msg_01HX9VTPQR3KF8MZWBYD5N6JCE",
"role": "user",
"content": "What caused the checkout 503 errors this morning?",
"timestamp": "2024-04-01T16:00:00Z"
},
{
"messageId": "msg_01HX9VTPQR3KF8MZWBYD5N6JCF",
"role": "assistant",
"content": "The root cause was a connection pool exhaustion triggered by the 14:25 deploy...",
"timestamp": "2024-04-01T16:00:02Z"
}
]
}
Error responses
| Status | Error code | Description |
|---|
401 | unauthorized | Missing or invalid JWT |
403 | forbidden | Caller lacks required role |
404 | session_not_found | No session with the given sessionId |
Examples
# List sessions
curl "https://api.causeflow.ai/v1/memory/chat/history" \
-H "Authorization: Bearer eyJhbGc..."
# Get messages for a session
curl "https://api.causeflow.ai/v1/memory/chat/history?sessionId=sess_01HX9VTPQR3KF8MZWBYD5N6JCE" \
-H "Authorization: Bearer eyJhbGc..."
Chat with memory
Start or continue a conversation
Memory insights
AI-generated insights from your history