Skip to main content
GET
/
v1
/
memory
/
chat
/
history
Chat history
curl --request GET \
  --url https://api.example.com/v1/memory/chat/history \
  --header 'Authorization: <authorization>'

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

Request headers

Authorization
string
required
JWT Bearer token. Format: Bearer <your-jwt>.

Query parameters

sessionId
string
Retrieve a specific session’s messages. If omitted, returns a list of session summaries.
limit
integer
Maximum number of sessions (or messages within a session) to return. Default: 20. Maximum: 100.
cursor
string
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

StatusError codeDescription
401unauthorizedMissing or invalid JWT
403forbiddenCaller lacks required role
404session_not_foundNo 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