Download OpenAPI specification:
AI chat sessions, Ask DSM, goal generation, MBC tools and clinical documentation AI
Creates a new legacy chat session or soft-deletes an existing one.
POST — Creates a new Chatsession record, sets starttimestamp, session_timestamp, and update_timestamp to now, and returns the generated sessionid (HTTP 201).
DELETE /{sessionid}/ — Soft-deletes the session by setting is_deleted=True.
Note: This operates on the legacy Chatsession model. New session management uses ConversationSession in conversationController.py.
| userid | integer or null |
| starttimestamp | string or null <date-time> |
| endtimestamp | string or null <date-time> |
{- "userid": 0,
- "starttimestamp": "2019-08-24T14:15:22Z",
- "endtimestamp": "2019-08-24T14:15:22Z"
}{- "userid": 0,
- "starttimestamp": "2019-08-24T14:15:22Z",
- "endtimestamp": "2019-08-24T14:15:22Z"
}Creates a new legacy chat session or soft-deletes an existing one.
POST — Creates a new Chatsession record, sets starttimestamp, session_timestamp, and update_timestamp to now, and returns the generated sessionid (HTTP 201).
DELETE /{sessionid}/ — Soft-deletes the session by setting is_deleted=True.
Note: This operates on the legacy Chatsession model. New session management uses ConversationSession in conversationController.py.
| sessionid required | integer A unique integer value identifying this chatsession. |
Creates or updates a ConversationSession (current-generation chat session model replacing the legacy Chatsession).
POST — Creates a new ConversationSession, stamps start_time, create_timestamp, and update_timestamp to now, and returns the generated sessionid (HTTP 201).
PUT /{id}/ — Updates an existing session record and returns the sessionid (HTTP 200). Returns 404 if the session does not exist.
DELETE /{id}/ — Soft-deletes the session via the inherited destroy action.
| 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"
}Creates or updates a ConversationSession (current-generation chat session model replacing the legacy Chatsession).
POST — Creates a new ConversationSession, stamps start_time, create_timestamp, and update_timestamp to now, and returns the generated sessionid (HTTP 201).
PUT /{id}/ — Updates an existing session record and returns the sessionid (HTTP 200). Returns 404 if the session does not exist.
DELETE /{id}/ — Soft-deletes the session via the inherited destroy action.
| id required | integer A unique integer value identifying this conversation session. |
Closes an active ConversationSession identified by its id in the URL path.
PUT /{id}/ — Marks the session as closed (status=False) and sets end_time and update_timestamp to now.
If the session has at least one ConversationMessage, the endpoint synchronously calls the asyncmessage-worker (ASYNC_MSG_URL/apis/prediction/session_summary/generate) to generate and store a session title. If the worker returns a summary, its title is persisted on the session. If the session has no messages, title is set to None and the session is still marked closed.
Returns the closed sessionid (HTTP 200). GET, POST, and DELETE are excluded from the public schema.
| 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"
}Retrieves active or inactive ConversationSession records for a given userId, with active sessions filtered to exclude those already linked to an open recommendation.
POST (active=True) — Returns open sessions (status=True) for the user. Incomplete RecommendationDetail rows targeting the same user are fetched and their associated session ids are removed from the result, so only sessions without a pending recommendation are returned. Returns 204 if none remain.
POST (active=False) — Returns closed sessions (status=False) for the user, ordered by id descending (most recent first). Returns 204 if none exist.
The active/inactive mode is injected by the URL router via the "active" kwarg.
| userid required | integer |
Retrieves active or inactive ConversationSession records for a given userId, with active sessions filtered to exclude those already linked to an open recommendation.
POST (active=True) — Returns open sessions (status=True) for the user. Incomplete RecommendationDetail rows targeting the same user are fetched and their associated session ids are removed from the result, so only sessions without a pending recommendation are returned. Returns 204 if none remain.
POST (active=False) — Returns closed sessions (status=False) for the user, ordered by id descending (most recent first). Returns 204 if none exist.
The active/inactive mode is injected by the URL router via the "active" kwarg.
| userid required | integer |
Retrieves all ConversationSession records belonging to a specific user, ordered by most recently updated first.
GET /{userid}/ — Returns all non-deleted sessions for the given userid, sorted descending by update_timestamp. Returns an empty list if no sessions exist.
Retrieves all ConversationSession records belonging to a specific user, ordered by most recently updated first.
GET /{userid}/ — Returns all non-deleted sessions for the given userid, sorted descending by update_timestamp. Returns an empty list if no sessions exist.
| id required | string |
Retrieves the history of closed (inactive) chat sessions for a given userId from the legacy Chatsession model. Filters by userid and status=False (closed sessions only). Send the userId as a URL path parameter for a single user's history, or call without a parameter to list all closed sessions.
Retrieves the history of closed (inactive) chat sessions for a given userId from the legacy Chatsession model. Filters by userid and status=False (closed sessions only). Send the userId as a URL path parameter for a single user's history, or call without a parameter to list all closed sessions.
| sessionid required | integer A unique integer value identifying this chatsession. |
Retrieves all Interaction records for a specific client-therapist chat session, ordered chronologically.
GET /{sessionid}/ — Returns all non-deleted interactions for the given sessionid, ordered by interactionid ascending (chronological order). Returns an empty list if no interactions exist.
POST, PUT, and DELETE are excluded from the public schema.
Retrieves all Interaction records for a specific client-therapist chat session, ordered chronologically.
GET /{sessionid}/ — Returns all non-deleted interactions for the given sessionid, ordered by interactionid ascending (chronological order). Returns an empty list if no interactions exist.
POST, PUT, and DELETE are excluded from the public schema.
| interactionid required | integer A unique integer value identifying this interaction. |
Creates a new client-therapist chat session (legacy Chatsession model).
POST — Creates a new Chatsession record, stamps update_timestamp, starttimestamp, and session_timestamp to now, and returns the generated sessionid (HTTP 201). Authentication is currently disabled (permission_classes=[]).
DELETE /{sessionid}/ — Soft-deletes the session via the inherited destroy action.
GET and PUT actions are excluded from the public schema.
| therapist_client_id | integer or null |
| starttimestamp | string or null <date-time> |
| endtimestamp | string or null <date-time> |
{- "therapist_client_id": 0,
- "starttimestamp": "2019-08-24T14:15:22Z",
- "endtimestamp": "2019-08-24T14:15:22Z"
}{- "therapist_client_id": 0,
- "starttimestamp": "2019-08-24T14:15:22Z",
- "endtimestamp": "2019-08-24T14:15:22Z"
}Creates a new client-therapist chat session (legacy Chatsession model).
POST — Creates a new Chatsession record, stamps update_timestamp, starttimestamp, and session_timestamp to now, and returns the generated sessionid (HTTP 201). Authentication is currently disabled (permission_classes=[]).
DELETE /{sessionid}/ — Soft-deletes the session via the inherited destroy action.
GET and PUT actions are excluded from the public schema.
| sessionid required | integer A unique integer value identifying this chatsession. |
Retrieves active client-therapist chat sessions for a specific TherapistClient relationship.
GET /{therapist_client_id}/ — Returns all non-deleted, active (status=True) Chatsession records associated with the given therapist_client_id. Returns HTTP 204 if no active sessions exist.
POST, PUT, and DELETE are excluded from the public schema.
Retrieves active client-therapist chat sessions for a specific TherapistClient relationship.
GET /{therapist_client_id}/ — Returns all non-deleted, active (status=True) Chatsession records associated with the given therapist_client_id. Returns HTTP 204 if no active sessions exist.
POST, PUT, and DELETE are excluded from the public schema.
| sessionid required | integer A unique integer value identifying this chatsession. |
Creates or updates an Interaction record for a client-therapist chat session, and triggers real-time push/web notifications.
POST — Upserts an interaction keyed on userloginname. If a matching record exists it is updated; otherwise a new one is created.
After persisting, if aianswer is present in the payload, a chat_notification_task_app Celery task is dispatched to send an FCM push notification to the client's registered device token.
If userquery is present instead, a process_web_notification Celery task is dispatched to alert the therapist of a new client message via web push.
Returns the interactionid (HTTP 201 for create, HTTP 200 for update).
PUT /{interactionid}/ — If userquery is in the payload, updates the interaction body fields using UpdateTherapistClientInteractionSerializer (userquery field is stripped before saving). Otherwise, updates the like/dislike feedback via UpdateUserInteractionLikeDislikeSerializer.
GET / GET /{interactionid}/ — Lists or retrieves interactions using InteractionGetSerializer.
DELETE is excluded from the public schema.
[- {
- "interactionid": 0,
- "sessionid": 0,
- "userquery": "string",
- "aianswer": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "likedislikeindicator": true,
- "therapist_name": "string",
- "therapist_image": "string"
}
]Creates or updates an Interaction record for a client-therapist chat session, and triggers real-time push/web notifications.
POST — Upserts an interaction keyed on userloginname. If a matching record exists it is updated; otherwise a new one is created.
After persisting, if aianswer is present in the payload, a chat_notification_task_app Celery task is dispatched to send an FCM push notification to the client's registered device token.
If userquery is present instead, a process_web_notification Celery task is dispatched to alert the therapist of a new client message via web push.
Returns the interactionid (HTTP 201 for create, HTTP 200 for update).
PUT /{interactionid}/ — If userquery is in the payload, updates the interaction body fields using UpdateTherapistClientInteractionSerializer (userquery field is stripped before saving). Otherwise, updates the like/dislike feedback via UpdateUserInteractionLikeDislikeSerializer.
GET / GET /{interactionid}/ — Lists or retrieves interactions using InteractionGetSerializer.
DELETE is excluded from the public schema.
| 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
}Creates or updates an Interaction record for a client-therapist chat session, and triggers real-time push/web notifications.
POST — Upserts an interaction keyed on userloginname. If a matching record exists it is updated; otherwise a new one is created.
After persisting, if aianswer is present in the payload, a chat_notification_task_app Celery task is dispatched to send an FCM push notification to the client's registered device token.
If userquery is present instead, a process_web_notification Celery task is dispatched to alert the therapist of a new client message via web push.
Returns the interactionid (HTTP 201 for create, HTTP 200 for update).
PUT /{interactionid}/ — If userquery is in the payload, updates the interaction body fields using UpdateTherapistClientInteractionSerializer (userquery field is stripped before saving). Otherwise, updates the like/dislike feedback via UpdateUserInteractionLikeDislikeSerializer.
GET / GET /{interactionid}/ — Lists or retrieves interactions using InteractionGetSerializer.
DELETE is excluded from the public schema.
| 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"
}Creates or updates an Interaction record for a client-therapist chat session, and triggers real-time push/web notifications.
POST — Upserts an interaction keyed on userloginname. If a matching record exists it is updated; otherwise a new one is created.
After persisting, if aianswer is present in the payload, a chat_notification_task_app Celery task is dispatched to send an FCM push notification to the client's registered device token.
If userquery is present instead, a process_web_notification Celery task is dispatched to alert the therapist of a new client message via web push.
Returns the interactionid (HTTP 201 for create, HTTP 200 for update).
PUT /{interactionid}/ — If userquery is in the payload, updates the interaction body fields using UpdateTherapistClientInteractionSerializer (userquery field is stripped before saving). Otherwise, updates the like/dislike feedback via UpdateUserInteractionLikeDislikeSerializer.
GET / GET /{interactionid}/ — Lists or retrieves interactions using InteractionGetSerializer.
DELETE is excluded from the public schema.
| interactionid required | integer A unique integer value identifying this interaction. |
| likedislikeindicator | boolean or null |
{- "likedislikeindicator": true
}{- "likedislikeindicator": true
}Creates, updates, deletes, and retrieves legacy Interaction records, and handles like/dislike feedback on existing interactions.
POST — Creates a new Interaction record and returns the interactionid (HTTP 201).
GET / GET /{interactionid}/ — Returns all interactions or a single one via InteractionGetSerializer.
PUT /{interactionid}/ — Updates the like/dislike indicator on an existing interaction via UpdateUserInteractionLikeDislikeSerializer and refreshes update_timestamp.
DELETE /{interactionid}/ — Soft-deletes the interaction by setting is_deleted=True.
[- {
- "interactionid": 0,
- "sessionid": 0,
- "userquery": "string",
- "aianswer": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "likedislikeindicator": true,
- "therapist_name": "string",
- "therapist_image": "string"
}
]Creates, updates, deletes, and retrieves legacy Interaction records, and handles like/dislike feedback on existing interactions.
POST — Creates a new Interaction record and returns the interactionid (HTTP 201).
GET / GET /{interactionid}/ — Returns all interactions or a single one via InteractionGetSerializer.
PUT /{interactionid}/ — Updates the like/dislike indicator on an existing interaction via UpdateUserInteractionLikeDislikeSerializer and refreshes update_timestamp.
DELETE /{interactionid}/ — Soft-deletes the interaction by setting is_deleted=True.
| 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
}Creates, updates, deletes, and retrieves legacy Interaction records, and handles like/dislike feedback on existing interactions.
POST — Creates a new Interaction record and returns the interactionid (HTTP 201).
GET / GET /{interactionid}/ — Returns all interactions or a single one via InteractionGetSerializer.
PUT /{interactionid}/ — Updates the like/dislike indicator on an existing interaction via UpdateUserInteractionLikeDislikeSerializer and refreshes update_timestamp.
DELETE /{interactionid}/ — Soft-deletes the interaction by setting is_deleted=True.
| 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"
}Creates, updates, deletes, and retrieves legacy Interaction records, and handles like/dislike feedback on existing interactions.
POST — Creates a new Interaction record and returns the interactionid (HTTP 201).
GET / GET /{interactionid}/ — Returns all interactions or a single one via InteractionGetSerializer.
PUT /{interactionid}/ — Updates the like/dislike indicator on an existing interaction via UpdateUserInteractionLikeDislikeSerializer and refreshes update_timestamp.
DELETE /{interactionid}/ — Soft-deletes the interaction by setting is_deleted=True.
| interactionid required | integer A unique integer value identifying this interaction. |
| likedislikeindicator | boolean or null |
{- "likedislikeindicator": true
}{- "likedislikeindicator": true
}Creates, updates, deletes, and retrieves legacy Interaction records, and handles like/dislike feedback on existing interactions.
POST — Creates a new Interaction record and returns the interactionid (HTTP 201).
GET / GET /{interactionid}/ — Returns all interactions or a single one via InteractionGetSerializer.
PUT /{interactionid}/ — Updates the like/dislike indicator on an existing interaction via UpdateUserInteractionLikeDislikeSerializer and refreshes update_timestamp.
DELETE /{interactionid}/ — Soft-deletes the interaction by setting is_deleted=True.
| interactionid required | integer A unique integer value identifying this interaction. |
Creates or updates a ConversationMessage (an individual turn within a ConversationSession).
POST — If id is present in the request body, updates the existing message and returns the id (HTTP 200). If id is absent, creates a new message, stamps create_timestamp to now, and returns the new id (HTTP 201). Returns 404 if the specified id does not exist.
PUT /{id}/ — Updates the like/dislike feedback on an existing message using UpdateConversationMessageLikeDislikeSerializer, stamps update_timestamp to now, and returns the id (HTTP 200).
DELETE /{id}/ — Soft-deletes the message via the inherited destroy action.
[- {
- "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
}
]Creates or updates a ConversationMessage (an individual turn within a ConversationSession).
POST — If id is present in the request body, updates the existing message and returns the id (HTTP 200). If id is absent, creates a new message, stamps create_timestamp to now, and returns the new id (HTTP 201). Returns 404 if the specified id does not exist.
PUT /{id}/ — Updates the like/dislike feedback on an existing message using UpdateConversationMessageLikeDislikeSerializer, stamps update_timestamp to now, and returns the id (HTTP 200).
DELETE /{id}/ — Soft-deletes the message via the inherited destroy action.
| 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
}Creates or updates a ConversationMessage (an individual turn within a ConversationSession).
POST — If id is present in the request body, updates the existing message and returns the id (HTTP 200). If id is absent, creates a new message, stamps create_timestamp to now, and returns the new id (HTTP 201). Returns 404 if the specified id does not exist.
PUT /{id}/ — Updates the like/dislike feedback on an existing message using UpdateConversationMessageLikeDislikeSerializer, stamps update_timestamp to now, and returns the id (HTTP 200).
DELETE /{id}/ — Soft-deletes the message via the inherited destroy action.
| 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
}Creates or updates a ConversationMessage (an individual turn within a ConversationSession).
POST — If id is present in the request body, updates the existing message and returns the id (HTTP 200). If id is absent, creates a new message, stamps create_timestamp to now, and returns the new id (HTTP 201). Returns 404 if the specified id does not exist.
PUT /{id}/ — Updates the like/dislike feedback on an existing message using UpdateConversationMessageLikeDislikeSerializer, stamps update_timestamp to now, and returns the id (HTTP 200).
DELETE /{id}/ — Soft-deletes the message via the inherited destroy action.
| 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
}Creates or updates a ConversationMessage (an individual turn within a ConversationSession).
POST — If id is present in the request body, updates the existing message and returns the id (HTTP 200). If id is absent, creates a new message, stamps create_timestamp to now, and returns the new id (HTTP 201). Returns 404 if the specified id does not exist.
PUT /{id}/ — Updates the like/dislike feedback on an existing message using UpdateConversationMessageLikeDislikeSerializer, stamps update_timestamp to now, and returns the id (HTTP 200).
DELETE /{id}/ — Soft-deletes the message via the inherited destroy action.
| id required | integer A unique integer value identifying this conversation message. |
Retrieves ConversationMessage records for a specific session using the AI-optimised serializer (ConversationMessageForAiGetSerializer), which returns a subset of fields suited for AI inference context.
GET /{sessionid}/ — Returns all non-deleted messages for the given sessionid ordered by id ascending. NaN values are normalised to null. Returns HTTP 204 if no messages exist.
Retrieves ConversationMessage records for a specific session using the AI-optimised serializer (ConversationMessageForAiGetSerializer), which returns a subset of fields suited for AI inference context.
GET /{sessionid}/ — Returns all non-deleted messages for the given sessionid ordered by id ascending. NaN values are normalised to null. Returns HTTP 204 if no messages exist.
| id required | string |
Retrieves all ConversationMessage records for a specific session, sorted by message id ascending (chronological order).
GET /{sessionid}/ — Returns all non-deleted messages for the given sessionid ordered by id. NaN values are normalised to null. Returns HTTP 204 if no messages exist.
GET /{sessionid}/count/ — Returns the total count of non-deleted messages for the session as {"count": N}.
Retrieves all ConversationMessage records for a specific session, sorted by message id ascending (chronological order).
GET /{sessionid}/ — Returns all non-deleted messages for the given sessionid ordered by id. NaN values are normalised to null. Returns HTTP 204 if no messages exist.
GET /{sessionid}/count/ — Returns the total count of non-deleted messages for the session as {"count": N}.
| id required | string |
Retrieves all ConversationMessage records for a specific session, sorted by message id ascending (chronological order).
GET /{sessionid}/ — Returns all non-deleted messages for the given sessionid ordered by id. NaN values are normalised to null. Returns HTTP 204 if no messages exist.
GET /{sessionid}/count/ — Returns the total count of non-deleted messages for the session as {"count": N}.
| id required | string |
Retrieves all ConversationMessage records authored by a specific user, sorted by message id ascending (chronological order).
GET /{userid}/ — Returns all non-deleted messages for the given userid ordered by id. Returns HTTP 204 if no messages exist.
Retrieves all ConversationMessage records authored by a specific user, sorted by message id ascending (chronological order).
GET /{userid}/ — Returns all non-deleted messages for the given userid ordered by id. Returns HTTP 204 if no messages exist.
| id required | string |
Retrieves all interactions belonging to a specific chat session. Filters Interaction records directly by "sessionid". Send the sessionId as a URL path parameter.
| interactionid required | integer A unique integer value identifying this interaction. |
Retrieves all interactions for a user identified by their userId. Traverses one FK level via "sessionid__userid" to filter Interaction → Chatsession. Send the userId as a URL path parameter.
| interactionid required | integer A unique integer value identifying this interaction. |
Retrieves all interactions for a user identified by their userLoginName. Traverses two FK levels via "sessionid__userid__userloginname" to filter Interaction → Chatsession → Users. Send the userLoginName as a URL path parameter.
Retrieves all interactions for a user identified by their userLoginName. Traverses two FK levels via "sessionid__userid__userloginname" to filter Interaction → Chatsession → Users. Send the userLoginName as a URL path parameter.
| interactionid required | integer A unique integer value identifying this interaction. |
Retrieves all interactions (messages) for a given support chat session, ordered by id (chronological). Filters TherapistSupportInteraction records by therapist_support_session_id. Send the session id as a URL path parameter.
Retrieves all interactions (messages) for a given support chat session, ordered by id (chronological). Filters TherapistSupportInteraction records by therapist_support_session_id. Send the session id as a URL path parameter.
| id required | string |
Opens a new support chat session for a therapist. Accepts a POST request with the therapist user details via SupportChatSessionCreateSerializer and creates a TherapistSupportSession record. Returns the new session id on success (HTTP 201).
| therapist_user_id | integer or null |
| start_time | string or null <date-time> |
| end_time | string or null <date-time> |
{- "therapist_user_id": 0,
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z"
}{- "therapist_user_id": 0,
- "start_time": "2019-08-24T14:15:22Z",
- "end_time": "2019-08-24T14:15:22Z"
}Retrieves all active support chat sessions across all therapists, ordered by most recently created. Filters TherapistSupportSession records where status=True (open sessions). Intended for support staff to view the full queue of open sessions. Returns 204 if no active sessions exist.
Retrieves all active support chat sessions across all therapists, ordered by most recently created. Filters TherapistSupportSession records where status=True (open sessions). Intended for support staff to view the full queue of open sessions. Returns 204 if no active sessions exist.
| id required | string |
Retrieves all active support chat sessions for a given therapist. Filters TherapistSupportSession records by therapist_user_id and status=True (open sessions only). Send the therapist userId as a URL path parameter. Returns 204 if no active sessions are found.
Retrieves all active support chat sessions for a given therapist. Filters TherapistSupportSession records by therapist_user_id and status=True (open sessions only). Send the therapist userId as a URL path parameter. Returns 204 if no active sessions are found.
| id required | string |
Creates or updates a support chat interaction (message) within a support session, and handles like/dislike feedback on existing interactions.
POST — Creates a new TherapistSupportInteraction. After saving, fires a Celery "process_web_notification" task:
PUT /{id}/ — Updates an existing interaction. If "likedislikeindicator" is present in the body, only the like/dislike field is updated via SupportChatInteractionUpdateSerializer. Otherwise a full partial update is performed and the same real-time notifications are dispatched as on create.
| sessionid required | integer |
| user_query | string or null |
| support_answer | string or null |
| query_image required | string |
| answer_image required | string |
| support_userid required | integer |
{- "sessionid": 0,
- "user_query": "string",
- "support_answer": "string",
- "query_image": "string",
- "answer_image": "string",
- "support_userid": 0
}{- "user_query": "string",
- "support_answer": "string",
- "query_image": "string",
- "answer_image": "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"
}nullStreaming version of the ask_DSM chat endpoint that provides real-time status updates
| data required | string (Data) |
Array of Files (strings) or Files (string) or Files (null) (Files) |
null| 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"
}nullGet MBC (Measurement-Based Care) tool recommendations. This endpoint can be called by other services (like AsyncMessage) for tool selection.
Args: request: Contains client_data with clinical information
Returns: MBC tool recommendations with domains, tools, safety flags, and summary
| client_data required | string (Client Data) |
{- "client_data": "string"
}nullGet clinical documentation instructions. This endpoint provides instruction sets for various clinical documentation tasks.
Args: instruction_type: Type of instruction (clinical_notes, safety_plan, etc.) user_id: Optional user ID for personalized instructions
Returns: Instructions for the specified documentation task
| instruction_type required | string (Instruction Type) |
User Id (string) or User Id (null) (User Id) |
nullExecute a clinical documentation task. This endpoint fetches instructions and provides them with clinical data for LLM processing.
Args: request: Contains task_type, clinical_data, user_id, and additional_params
Returns: Task execution result with instructions
| 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