Skip to main content
POST
/
v1
/
memory
/
chat
Chat with memory
curl --request POST \
  --url https://api.example.com/v1/memory/chat \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "<string>",
  "sessionId": "<string>",
  "incidentId": "<string>"
}
'

Overview

Sends a message to the CauseFlow AI assistant. The assistant has access to your tenant’s full incident history, extracted knowledge patterns, and runbooks — providing context-aware answers about past incidents, root causes, and best practices. Required role: admin or member

Request headers

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

Request body

message
string
required
The question or prompt. Maximum 4,000 characters.
sessionId
string
Optional session ID to continue an existing conversation. If omitted, a new session is started.
incidentId
string
Optional incident ID to anchor the conversation to a specific incident context.

Response

Returns 200 OK with the assistant’s reply.
{
  "sessionId": "sess_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "messageId": "msg_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "reply": "Based on your incident history, connection pool exhaustion has occurred 3 times in the past 90 days — always following a deploy that increased concurrent database queries. The pattern shows scaling the pool by 3× resolves within 90 seconds.",
  "sources": [
    {
      "type": "incident",
      "id": "inc_EXAMPLE_01JX",
      "title": "Checkout 503s — EU payment processor"
    },
    {
      "type": "pattern",
      "id": "ptn_01HX9VTPQR3KF8MZWBYD5N6JCE",
      "title": "Connection pool exhaustion under high throughput"
    }
  ],
  "timestamp": "2024-04-01T16:00:00Z"
}
FieldTypeDescription
sessionIdstringSession identifier for multi-turn conversations
messageIdstringUnique ID for this message exchange
replystringAI assistant response
sourcesarrayIncidents and patterns referenced in the reply
timestampstringISO 8601 timestamp

Error responses

StatusError codeDescription
400validation_errormessage is empty or exceeds character limit
401unauthorizedMissing or invalid JWT
403forbiddenCaller lacks required role
429quota_exceededMonthly chat quota exhausted

Examples

curl https://api.causeflow.ai/v1/memory/chat \
  -X POST \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What are the most common root causes for checkout service incidents in the last 90 days?"
  }'

Chat history

Retrieve past conversation sessions

Runbooks

Browse AI-generated runbooks from your incident history