Download OpenAPI specification:
AI chat sessions, Ask DSM, goal generation, MBC tools and clinical documentation AI
Start a new AI-powered conversation session for a client. Sessions are the container for all messages exchanged between a client and Kana's AI companion. Each session maintains clinical context and generates a session summary when closed.
Use this when:
Returns: sessionid of the new session (HTTP 201). Pass this sessionid when sending messages via the conversation message endpoint.
| userid | integer or null |
| start_time | string or null <date-time> |
| end_time | string or null <date-time> |
| title | string or null <= 255 characters |
{- "userid": 0,
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z",
- "title": "string"
}{- "userid": 0,
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z",
- "title": "string"
}Start a new AI-powered conversation session for a client. Sessions are the container for all messages exchanged between a client and Kana's AI companion. Each session maintains clinical context and generates a session summary when closed.
Use this when:
Returns: sessionid of the new session (HTTP 201). Pass this sessionid when sending messages via the conversation message endpoint.
| id required | integer A unique integer value identifying this conversation session. |
Close an active AI conversation session for a client. When closed, Kana automatically generates an AI session summary and title from the conversation history, which is stored and can be used for clinical review or follow-up.
Use this when:
PUT /{id}/ — Marks the session closed and triggers AI session summary generation.
Returns: The closed sessionid (HTTP 200).
| id required | integer A unique integer value identifying this conversation session. |
| userid | integer or null |
| start_time | string or null <date-time> |
| end_time | string or null <date-time> |
| title | string or null <= 255 characters |
{- "userid": 0,
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z",
- "title": "string"
}{- "userid": 0,
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z",
- "title": "string"
}Retrieve all AI conversation sessions for a client, ordered by most recent first. Each session contains a title (AI-generated summary) and timestamps. Use this to display a client's full conversation history or build a session timeline in your application.
Use this when:
GET /{userid}/ — Returns all sessions for the client, sorted by most recent first.
Retrieve all AI conversation sessions for a client, ordered by most recent first. Each session contains a title (AI-generated summary) and timestamps. Use this to display a client's full conversation history or build a session timeline in your application.
Use this when:
GET /{userid}/ — Returns all sessions for the client, sorted by most recent first.
| id required | string |
Send or update a message in a client-therapist chat session. Kana automatically delivers real-time push notifications to the recipient — an FCM push to the client's device when the AI responds, or a web push to the therapist when the client sends a query.
Use this when:
POST — Send a new message (or update an existing one). Triggers real-time notifications automatically. PUT /{interactionid}/ — Update message content or submit like/dislike feedback. GET / GET /{interactionid}/ — Retrieve messages for display.
Returns: interactionid (HTTP 201 for create, HTTP 200 for update).
[- {
- "interactionid": 0,
- "sessionid": 0,
- "userquery": "string",
- "aianswer": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "likedislikeindicator": true,
- "therapist_name": "string",
- "therapist_image": "string"
}
]Send or update a message in a client-therapist chat session. Kana automatically delivers real-time push notifications to the recipient — an FCM push to the client's device when the AI responds, or a web push to the therapist when the client sends a query.
Use this when:
POST — Send a new message (or update an existing one). Triggers real-time notifications automatically. PUT /{interactionid}/ — Update message content or submit like/dislike feedback. GET / GET /{interactionid}/ — Retrieve messages for display.
Returns: interactionid (HTTP 201 for create, HTTP 200 for update).
| sessionid | integer or null |
| userquery | string or null |
| aianswer | string or null |
| prompt | string or null |
| timestamp | string or null <date-time> |
| likedislikeindicator | boolean or null |
{- "sessionid": 0,
- "userquery": "string",
- "aianswer": "string",
- "prompt": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "likedislikeindicator": true
}{- "sessionid": 0,
- "userquery": "string",
- "aianswer": "string",
- "prompt": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "likedislikeindicator": true
}Send or update a message in a client-therapist chat session. Kana automatically delivers real-time push notifications to the recipient — an FCM push to the client's device when the AI responds, or a web push to the therapist when the client sends a query.
Use this when:
POST — Send a new message (or update an existing one). Triggers real-time notifications automatically. PUT /{interactionid}/ — Update message content or submit like/dislike feedback. GET / GET /{interactionid}/ — Retrieve messages for display.
Returns: interactionid (HTTP 201 for create, HTTP 200 for update).
| interactionid required | integer A unique integer value identifying this interaction. |
{- "interactionid": 0,
- "sessionid": 0,
- "userquery": "string",
- "aianswer": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "likedislikeindicator": true,
- "therapist_name": "string",
- "therapist_image": "string"
}Send or update a message in a client-therapist chat session. Kana automatically delivers real-time push notifications to the recipient — an FCM push to the client's device when the AI responds, or a web push to the therapist when the client sends a query.
Use this when:
POST — Send a new message (or update an existing one). Triggers real-time notifications automatically. PUT /{interactionid}/ — Update message content or submit like/dislike feedback. GET / GET /{interactionid}/ — Retrieve messages for display.
Returns: interactionid (HTTP 201 for create, HTTP 200 for update).
| interactionid required | integer A unique integer value identifying this interaction. |
| likedislikeindicator | boolean or null |
{- "likedislikeindicator": true
}{- "likedislikeindicator": true
}Retrieves video content URLs grouped by topic and content category. Content is filtered by user role and organized into a nested structure.
Used when:
Input:
role (query parameter, optional): User role filter, defaults to "User"Returns: Content grouped by content_group and topic_group
Common errors:
[- {
- "topic_group": "string",
- "video_link": "string",
- "title": "string",
- "thumbnail": "string",
- "duration": "string",
- "content_group": "string",
- "role": "string"
}
]Send a message within an active AI conversation session. Each message represents one turn in the conversation — either from the client or from Kana's AI. Messages are the raw conversation data that Kana uses to generate session summaries and clinical insights.
Use this when:
POST — Send a new message (omit id) or update an existing one (include id).
PUT /{id}/ — Submit feedback (like/dislike) on an AI response.
Returns: Message id (HTTP 201 for new, HTTP 200 for update).
[- {
- "id": 0,
- "sessionid": 0,
- "message": "string",
- "prompt": "string",
- "likedislikeindicator": true,
- "create_timestamp": "2019-08-24T14:15:22Z",
- "userid": 0,
- "file_content_json": null,
- "model_messages": null
}
]Send a message within an active AI conversation session. Each message represents one turn in the conversation — either from the client or from Kana's AI. Messages are the raw conversation data that Kana uses to generate session summaries and clinical insights.
Use this when:
POST — Send a new message (omit id) or update an existing one (include id).
PUT /{id}/ — Submit feedback (like/dislike) on an AI response.
Returns: Message id (HTTP 201 for new, HTTP 200 for update).
| sessionid | integer or null |
| message | string or null |
| prompt | string or null |
| likedislikeindicator | boolean or null |
| create_timestamp | string or null <date-time> |
| userid | integer or null |
| file_content_json | any or null |
| model_messages | any or null |
{- "sessionid": 0,
- "message": "string",
- "prompt": "string",
- "likedislikeindicator": true,
- "create_timestamp": "2019-08-24T14:15:22Z",
- "userid": 0,
- "file_content_json": null,
- "model_messages": null
}{- "id": 0,
- "sessionid": 0,
- "message": "string",
- "prompt": "string",
- "likedislikeindicator": true,
- "create_timestamp": "2019-08-24T14:15:22Z",
- "userid": 0,
- "file_content_json": null,
- "model_messages": null
}Send a message within an active AI conversation session. Each message represents one turn in the conversation — either from the client or from Kana's AI. Messages are the raw conversation data that Kana uses to generate session summaries and clinical insights.
Use this when:
POST — Send a new message (omit id) or update an existing one (include id).
PUT /{id}/ — Submit feedback (like/dislike) on an AI response.
Returns: Message id (HTTP 201 for new, HTTP 200 for update).
| id required | integer A unique integer value identifying this conversation message. |
{- "id": 0,
- "sessionid": 0,
- "message": "string",
- "prompt": "string",
- "likedislikeindicator": true,
- "create_timestamp": "2019-08-24T14:15:22Z",
- "userid": 0,
- "file_content_json": null,
- "model_messages": null
}Send a message within an active AI conversation session. Each message represents one turn in the conversation — either from the client or from Kana's AI. Messages are the raw conversation data that Kana uses to generate session summaries and clinical insights.
Use this when:
POST — Send a new message (omit id) or update an existing one (include id).
PUT /{id}/ — Submit feedback (like/dislike) on an AI response.
Returns: Message id (HTTP 201 for new, HTTP 200 for update).
| id required | integer A unique integer value identifying this conversation message. |
| sessionid | integer or null |
| message | string or null |
| prompt | string or null |
| likedislikeindicator | boolean or null |
| create_timestamp | string or null <date-time> |
| userid | integer or null |
| file_content_json | any or null |
| model_messages | any or null |
{- "sessionid": 0,
- "message": "string",
- "prompt": "string",
- "likedislikeindicator": true,
- "create_timestamp": "2019-08-24T14:15:22Z",
- "userid": 0,
- "file_content_json": null,
- "model_messages": null
}{- "id": 0,
- "sessionid": 0,
- "message": "string",
- "prompt": "string",
- "likedislikeindicator": true,
- "create_timestamp": "2019-08-24T14:15:22Z",
- "userid": 0,
- "file_content_json": null,
- "model_messages": null
}Send a message within an active AI conversation session. Each message represents one turn in the conversation — either from the client or from Kana's AI. Messages are the raw conversation data that Kana uses to generate session summaries and clinical insights.
Use this when:
POST — Send a new message (omit id) or update an existing one (include id).
PUT /{id}/ — Submit feedback (like/dislike) on an AI response.
Returns: Message id (HTTP 201 for new, HTTP 200 for update).
| id required | integer A unique integer value identifying this conversation message. |
Retrieve the full chronological message history for a specific conversation session. Returns all client and AI messages in order — useful for displaying session transcripts, clinical review, or feeding session content into downstream workflows.
Use this when:
GET /{sessionid}/ — Returns all messages in chronological order. HTTP 204 if no messages exist. GET /{sessionid}/count/ — Returns the message count for the session.
Retrieve the full chronological message history for a specific conversation session. Returns all client and AI messages in order — useful for displaying session transcripts, clinical review, or feeding session content into downstream workflows.
Use this when:
GET /{sessionid}/ — Returns all messages in chronological order. HTTP 204 if no messages exist. GET /{sessionid}/count/ — Returns the message count for the session.
| id required | string |
Retrieve the full chronological message history for a specific conversation session. Returns all client and AI messages in order — useful for displaying session transcripts, clinical review, or feeding session content into downstream workflows.
Use this when:
GET /{sessionid}/ — Returns all messages in chronological order. HTTP 204 if no messages exist. GET /{sessionid}/count/ — Returns the message count for the session.
| id required | string |
Retrieve all conversation messages across all sessions for a specific client. Returns the complete message history in chronological order — useful for building a full longitudinal view of a client's AI interactions or for clinical audit.
Use this when:
GET /{userid}/ — Returns all messages for the client in chronological order. HTTP 204 if no messages exist.
Retrieve all conversation messages across all sessions for a specific client. Returns the complete message history in chronological order — useful for building a full longitudinal view of a client's AI interactions or for clinical audit.
Use this when:
GET /{userid}/ — Returns all messages for the client in chronological order. HTTP 204 if no messages exist.
| id required | string |
Queries the GraphRAG knowledge index for DSM diagnosis-related information. Uses graph-based retrieval augmented generation to provide clinically relevant answers.
Used when:
Input:
query_text (required): The clinical querymethod (optional): Query method to usedefault_response_type (optional): Response format preferenceReturns: GraphRagResponse with the answer and any error messages
Common errors:
| query_text required | string (Query Text) |
| method | string (Method) Default: "local" |
Default Response Type (string) or Default Response Type (null) (Default Response Type) |
{- "query_text": "string",
- "method": "local",
- "default_response_type": "string"
}{- "response": "string",
- "error": "string"
}Generates structured therapy goals from a treatment plan using AI. Supports two modes: 'llm' (default) uses a language model for direct generation, 'agent' uses an AI agent workflow for more detailed goal creation.
Used when:
Input:
treatment_plan (required): Treatment plan content as JSONmode (optional): 'llm' (default) or 'agent'Returns: Generated goals structured for the Kana goal tracking system
Common errors:
required | object (Treatment Plan) |
| mode | string (Mode) Default: "llm" |
{- "treatment_plan": { },
- "mode": "llm"
}nullSend a clinical question to Kana's AI assistant powered by the DSM knowledge base. Kana synthesizes the client's full clinical context — diagnosis, treatment history, session notes, mood logs, and goals — to provide clinically grounded, real-time streaming responses. Supports file attachments for in-context document analysis.
Use this when:
Input:
data (required, form field): JSON string with user_query, session_id, user_id, model_provider (optional)files (optional): PDF or document attachments for context-aware responsesReturns: Streaming text response (Server-Sent Events format)
| data required | string (Data) |
Array of Files (strings) or Files (string) or Files (null) (Files) |
nullSend a message to Kana's AI mental health companion on behalf of a client. The AI maintains full conversational context across the session and responds with empathetic, evidence-based mental health support grounded in the client's clinical history, goals, mood trends, and past interactions.
Use this when:
Input:
user_query (required): The client's message or questionsession_id (required): Active session IDuser_id (required): Client's Kana user IDmodel_provider (optional): AI model to use (default: groq)Returns: {"response": "<AI response text>"}
| user_query required | string (User Query) |
| session_id required | string (Session Id) |
| user_id required | integer (User Id) |
Model Provider (string) or Model Provider (null) (Model Provider) Default: "groq" | |
Api Version (string) or Api Version (null) (Api Version) Default: "v1" |
{- "user_query": "string",
- "session_id": "string",
- "user_id": 0,
- "model_provider": "groq",
- "api_version": "v1"
}nullSubmit client clinical data and receive AI-powered recommendations for Measurement-Based Care (MBC) assessment tools. Kana's AI analyzes the clinical presentation and recommends the most appropriate standardized instruments (e.g. PHQ-9, GAD-7, PCL-5) across relevant clinical domains, along with safety flag indicators.
Use this when:
Input:
client_data (required): Clinical summary or structured data describing the client's presentation, symptoms, and historyReturns: Recommended MBC tools with clinical domains, tool names, safety flags, and a recommendation summary
| client_data required | string (Client Data) |
{- "client_data": "string"
}nullExecute an AI-powered clinical documentation task using Kana's large language model pipeline. Provide clinical data and a task type, and Kana returns structured, AI-generated clinical output — such as progress notes, safety plans, treatment summaries, or risk assessments.
Use this when:
Supported task types include:
clinical_notes: Generate structured progress notes from session datasafety_plan: Generate a client safety planInput:
task_type (required): The documentation task to executeclinical_data (required): Raw clinical content (notes, transcript, client data)user_id (optional): Client's Kana user ID for personalized contextadditional_params (optional): Extra parameters for the taskReturns: AI-generated clinical documentation output for the specified task
| task_type required | string (Task Type) |
| clinical_data required | string (Clinical Data) |
User Id (string) or User Id (null) (User Id) | |
Additional Params (object) or Additional Params (null) (Additional Params) |
{- "task_type": "string",
- "clinical_data": "string",
- "user_id": "string",
- "additional_params": { }
}null