# Conversations

The Conversations API enables the management of conversations between patients and the AI assistant. Each conversation is linked to a specific Patient using the patient_id field. The patient’s unique ID must be provided to associate a conversation correctly.

# Get Conversation List

Retrieve a list of all current conversations associated with the authenticated user's patient profile.

  • URL: patients/conversations/
  • Method: GET
  • Response Example:
    [
      {
        "unique_id": "con123",
        "patient_id": "pat123",
        "status": "current",
        "archived_date": null,
        "date_created": "2023-01-01T12:00:00Z",
        "last_updated": "2023-01-01T12:00:00Z"
      },
      {
        "unique_id": "con456",
        "patient_id": "pat123",
        "status": "current",
        "archived_date": null,
        "date_created": "2023-01-02T12:00:00Z",
        "last_updated": "2023-01-02T12:00:00Z"
      }
    ]
    

# Create a Conversation

Create a new conversation associated with the authenticated user's patient profile.

  • URL: patients/conversations/

  • Method: POST

  • Request Example:

    {
      "status": "current"
    }
    

    Note: The authenticated user’s patient profile will automatically be linked to the conversation.

  • Response Example:

    {
      "unique_id": "con789",
      "patient_id": "pat123",
      "status": "current",
      "archived_date": null,
      "date_created": "2023-01-03T12:00:00Z",
      "last_updated": "2023-01-03T12:00:00Z"
    }
    

# Get a Conversation

Retrieve details of a specific conversation by its unique ID.

  • URL: patients/conversations/<str:unique_id>/
  • Method: GET
  • Response Example:
    {
      "unique_id": "con123",
      "patient_id": "pat123",
      "status": "current",
      "archived_date": null,
      "date_created": "2023-01-01T12:00:00Z",
      "last_updated": "2023-01-01T12:00:00Z"
    }
    

# Update a Conversation

Update the details of a specific conversation by its unique ID. The conversation can be updated to an "archived" status by modifying its status and setting the archived_date.

  • URL: patients/conversations/<str:unique_id>/
  • Method: PUT
  • Request Example:
    {
      "status": "archived"
    }
    
  • Response Example:
    {
      "unique_id": "con123",
      "patient_id": "pat123",
      "status": "archived",
      "archived_date": "2023-01-05T12:00:00Z",
      "date_created": "2023-01-01T12:00:00Z",
      "last_updated": "2023-01-05T12:00:00Z"
    }
    

# Delete a Conversation

Delete a specific conversation by its unique ID.

  • URL: patients/conversations/<str:unique_id>/
  • Method: DELETE
  • Response: 204 No Content