Chat & AI Agents (1.0.0)

Download OpenAPI specification:

AI chat sessions, Ask DSM, goal generation, MBC tools and clinical documentation AI

apis

apis_chatsession_create

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.

Authorizations:
cookieAuthbasicAuth
Request Body schema:
userid
integer or null
starttimestamp
string or null <date-time>
endtimestamp
string or null <date-time>

Responses

Request samples

Content type
{
  • "userid": 0,
  • "starttimestamp": "2019-08-24T14:15:22Z",
  • "endtimestamp": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "userid": 0,
  • "starttimestamp": "2019-08-24T14:15:22Z",
  • "endtimestamp": "2019-08-24T14:15:22Z"
}

apis_chatsession_destroy

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.

Authorizations:
cookieAuthbasicAuth
path Parameters
sessionid
required
integer

A unique integer value identifying this chatsession.

Responses

apis_chatsession_new_create

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.

Authorizations:
cookieAuthbasicAuthNone
Request Body schema:
userid
integer or null
start_time
string or null <date-time>
end_time
string or null <date-time>
title
string or null <= 255 characters

Responses

Request samples

Content type
{
  • "userid": 0,
  • "start_time": "2019-08-24T14:15:22Z",
  • "end_time": "2019-08-24T14:15:22Z",
  • "title": "string"
}

Response samples

Content type
application/json
{
  • "userid": 0,
  • "start_time": "2019-08-24T14:15:22Z",
  • "end_time": "2019-08-24T14:15:22Z",
  • "title": "string"
}

apis_chatsession_new_destroy

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
integer

A unique integer value identifying this conversation session.

Responses

apis_chatsession_new_closechatsession_update

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
integer

A unique integer value identifying this conversation session.

Request Body schema:
userid
integer or null
start_time
string or null <date-time>
end_time
string or null <date-time>
title
string or null <= 255 characters

Responses

Request samples

Content type
{
  • "userid": 0,
  • "start_time": "2019-08-24T14:15:22Z",
  • "end_time": "2019-08-24T14:15:22Z",
  • "title": "string"
}

Response samples

Content type
application/json
{
  • "userid": 0,
  • "start_time": "2019-08-24T14:15:22Z",
  • "end_time": "2019-08-24T14:15:22Z",
  • "title": "string"
}

apis_chatsessions_active_userid_create

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
userid
required
integer

Responses

apis_chatsessions_inactive_userid_create

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
userid
required
integer

Responses

apis_chatsessions_new_userid_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_chatsessions_new_userid_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_chatsessions_userid_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_chatsessions_userid_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
sessionid
required
integer

A unique integer value identifying this chatsession.

Responses

apis_clienttherapist_chat_interactions_session_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_clienttherapist_chat_interactions_session_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Responses

apis_clienttherapist_chat_session_create

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.

Authorizations:
cookieAuthbasicAuth
Request Body schema:
therapist_client_id
integer or null
starttimestamp
string or null <date-time>
endtimestamp
string or null <date-time>

Responses

Request samples

Content type
{
  • "therapist_client_id": 0,
  • "starttimestamp": "2019-08-24T14:15:22Z",
  • "endtimestamp": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "therapist_client_id": 0,
  • "starttimestamp": "2019-08-24T14:15:22Z",
  • "endtimestamp": "2019-08-24T14:15:22Z"
}

apis_clienttherapist_chat_session_destroy

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.

Authorizations:
cookieAuthbasicAuth
path Parameters
sessionid
required
integer

A unique integer value identifying this chatsession.

Responses

apis_clienttherapist_chat_session_therapistclient_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_clienttherapist_chat_session_therapistclient_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
sessionid
required
integer

A unique integer value identifying this chatsession.

Responses

apis_clienttherapist_interaction_list

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.

Authorizations:
cookieAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

apis_clienttherapist_interaction_create

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.

Authorizations:
cookieAuthbasicAuth
Request Body 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

Responses

Request samples

Content type
{
  • "sessionid": 0,
  • "userquery": "string",
  • "aianswer": "string",
  • "prompt": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "likedislikeindicator": true
}

Response samples

Content type
application/json
{
  • "sessionid": 0,
  • "userquery": "string",
  • "aianswer": "string",
  • "prompt": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "likedislikeindicator": true
}

apis_clienttherapist_interaction_retrieve

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.

Authorizations:
cookieAuthbasicAuth
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Responses

Response samples

Content type
application/json
{
  • "interactionid": 0,
  • "sessionid": 0,
  • "userquery": "string",
  • "aianswer": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "likedislikeindicator": true,
  • "therapist_name": "string",
  • "therapist_image": "string"
}

apis_clienttherapist_interaction_update

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.

Authorizations:
cookieAuthbasicAuth
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Request Body schema:
likedislikeindicator
boolean or null

Responses

Request samples

Content type
{
  • "likedislikeindicator": true
}

Response samples

Content type
application/json
{
  • "likedislikeindicator": true
}

apis_interaction_list

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.

Authorizations:
cookieAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

apis_interaction_create

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.

Authorizations:
cookieAuthbasicAuth
Request Body 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

Responses

Request samples

Content type
{
  • "sessionid": 0,
  • "userquery": "string",
  • "aianswer": "string",
  • "prompt": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "likedislikeindicator": true
}

Response samples

Content type
application/json
{
  • "sessionid": 0,
  • "userquery": "string",
  • "aianswer": "string",
  • "prompt": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "likedislikeindicator": true
}

apis_interaction_retrieve

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.

Authorizations:
cookieAuthbasicAuth
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Responses

Response samples

Content type
application/json
{
  • "interactionid": 0,
  • "sessionid": 0,
  • "userquery": "string",
  • "aianswer": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "likedislikeindicator": true,
  • "therapist_name": "string",
  • "therapist_image": "string"
}

apis_interaction_update

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.

Authorizations:
cookieAuthbasicAuth
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Request Body schema:
likedislikeindicator
boolean or null

Responses

Request samples

Content type
{
  • "likedislikeindicator": true
}

Response samples

Content type
application/json
{
  • "likedislikeindicator": true
}

apis_interaction_destroy

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.

Authorizations:
cookieAuthbasicAuth
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Responses

apis_interaction_new_list

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

Response samples

Content type
application/json
[
  • {
    }
]

apis_interaction_new_create

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.

Authorizations:
cookieAuthbasicAuthNone
Request Body schema:
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

Responses

Request samples

Content type
{
  • "sessionid": 0,
  • "message": "string",
  • "prompt": "string",
  • "likedislikeindicator": true,
  • "create_timestamp": "2019-08-24T14:15:22Z",
  • "userid": 0,
  • "file_content_json": null,
  • "model_messages": null
}

Response samples

Content type
application/json
{
  • "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
}

apis_interaction_new_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
integer

A unique integer value identifying this conversation message.

Responses

Response samples

Content type
application/json
{
  • "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
}

apis_interaction_new_update

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
integer

A unique integer value identifying this conversation message.

Request Body schema:
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

Responses

Request samples

Content type
{
  • "sessionid": 0,
  • "message": "string",
  • "prompt": "string",
  • "likedislikeindicator": true,
  • "create_timestamp": "2019-08-24T14:15:22Z",
  • "userid": 0,
  • "file_content_json": null,
  • "model_messages": null
}

Response samples

Content type
application/json
{
  • "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
}

apis_interaction_new_destroy

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
integer

A unique integer value identifying this conversation message.

Responses

apis_interactions_new_ai_sessionid_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_interactions_new_ai_sessionid_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_interactions_new_sessionid_retrieve

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}.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_interactions_new_sessionid_retrieve_2

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}.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_interactions_new_sessionid_count_retrieve

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}.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_interactions_new_userid_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_interactions_new_userid_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_interactions_sessionid_retrieve

Retrieves all interactions belonging to a specific chat session. Filters Interaction records directly by "sessionid". Send the sessionId as a URL path parameter.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_interactions_sessionid_retrieve_2

Retrieves all interactions belonging to a specific chat session. Filters Interaction records directly by "sessionid". Send the sessionId as a URL path parameter.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Responses

apis_interactions_userid_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_interactions_userid_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Responses

apis_interactions_userloginname_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_interactions_userloginname_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
interactionid
required
integer

A unique integer value identifying this interaction.

Responses

apis_support_chat_interactions_session_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_support_chat_interactions_session_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_support_chat_session_create

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).

Authorizations:
cookieAuthbasicAuthNone
Request Body schema:
therapist_user_id
integer or null
start_time
string or null <date-time>
end_time
string or null <date-time>

Responses

Request samples

Content type
{
  • "therapist_user_id": 0,
  • "start_time": "2019-08-24T14:15:22Z",
  • "end_time": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "therapist_user_id": 0,
  • "start_time": "2019-08-24T14:15:22Z",
  • "end_time": "2019-08-24T14:15:22Z"
}

apis_support_chat_session_all_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_support_chat_session_all_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_support_chat_session_therapistuser_retrieve

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.

Authorizations:
cookieAuthbasicAuthNone

Responses

apis_support_chat_session_therapistuser_retrieve_2

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.

Authorizations:
cookieAuthbasicAuthNone
path Parameters
id
required
string

Responses

apis_support_interaction_create

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:

  • If "support_answer" is set: sends a "support-chat" notification to the therapist informing them of a new reply from the support team.
  • If "user_query" is set: sends a "therapist-support-chat" notification to the support user informing them of a new message from the therapist.

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.

Authorizations:
cookieAuthbasicAuthNone
Request Body schema:
required
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

Responses

Request samples

Content type
{
  • "sessionid": 0,
  • "user_query": "string",
  • "support_answer": "string",
  • "query_image": "string",
  • "answer_image": "string",
  • "support_userid": 0
}

Response samples

Content type
application/json
{
  • "user_query": "string",
  • "support_answer": "string",
  • "query_image": "string",
  • "answer_image": "string"
}

external

Generate Goals from Treatment Plan

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:

  • Therapist wants to auto-generate goals from a treatment plan
  • Creating structured, trackable goals from clinical documentation

Input:

  • treatment_plan (required): Treatment plan content as JSON
  • mode (optional): 'llm' (default) or 'agent'

Returns: Generated goals structured for the Kana goal tracking system

Common errors:

  • 500: AI service error during goal generation
Request Body schema: application/json
required
required
object (Treatment Plan)
mode
string (Mode)
Default: "llm"

Responses

Request samples

Content type
application/json
{
  • "treatment_plan": { },
  • "mode": "llm"
}

Response samples

Content type
application/json
null

Chat Stream Feature For Ask Dsm With Form Data

Streaming version of the ask_DSM chat endpoint that provides real-time status updates

Request Body schema: multipart/form-data
required
data
required
string (Data)
Array of Files (strings) or Files (string) or Files (null) (Files)

Responses

Response samples

Content type
application/json
null

Chat Feature For User

Request Body schema: application/json
required
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"

Responses

Request samples

Content type
application/json
{
  • "user_query": "string",
  • "session_id": "string",
  • "user_id": 0,
  • "model_provider": "groq",
  • "api_version": "v1"
}

Response samples

Content type
application/json
null

Recommend Mbc Tools

Get 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

Request Body schema: application/json
required
client_data
required
string (Client Data)

Responses

Request samples

Content type
application/json
{
  • "client_data": "string"
}

Response samples

Content type
application/json
null

Get Documentation Instructions

Get 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

path Parameters
instruction_type
required
string (Instruction Type)
query Parameters
User Id (string) or User Id (null) (User Id)

Responses

Response samples

Content type
application/json
null

Execute Clinical Task

Execute 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

Request Body schema: application/json
required
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)

Responses

Request samples

Content type
application/json
{
  • "task_type": "string",
  • "clinical_data": "string",
  • "user_id": "string",
  • "additional_params": { }
}

Response samples

Content type
application/json
null