Skip to main content
GET
/
v1
/
conversation_history
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Get Conversation History

Retrieves the conversation history for a given user type.

Query Parameters

ParameterTypeRequiredDescription
user_typestringYesThe type of user (Patient, Doctor, Coach)
model_idstringYesThe model ID (openai, gemini)
user_idstringYesThe user identifier (User1-User20)

Headers

ParameterTypeRequiredDescription
authorizationstringYesAPI authorization token

Responses

StatusDescriptionContent Type
200Conversation historyapplication/json
401Unauthorizedapplication/json
422Validation Errorapplication/json

Sample Request

curl -X GET "https://covita.nivara.io/v1/conversation_history?user_type=Patient&model_id=openai&user_id=User1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Sample Response

{
  "conversation": [
    {
      "role": "user",
      "content": "What is my average heart rate?",
      "timestamp": "2023-08-15T14:30:22.123Z"
    },
    {
      "role": "assistant",
      "content": "Based on your recent health data, your average heart rate is 72 beats per minute, which falls within the normal range for adults.",
      "timestamp": "2023-08-15T14:30:25.456Z"
    },
    {
      "role": "user",
      "content": "How about my blood pressure?",
      "timestamp": "2023-08-15T14:31:00.789Z"
    },
    {
      "role": "assistant",
      "content": "Your average blood pressure readings show a systolic pressure of 122 mmHg and a diastolic pressure of 78 mmHg. This falls within the normal range.",
      "timestamp": "2023-08-15T14:31:03.012Z"
    }
  ],
  "user_type": "Patient",
  "model_id": "openai",
  "user_id": "User1",
  "session_id": "session_abcde12345"
}

Notes

The conversation history includes both text and voice interactions, with voice inputs transcribed to text.
For security reasons, conversation history is only accessible with valid authentication and only for the authorized user types and user IDs associated with your account.

Headers

authorization
string
required

Query Parameters

user_type
string
required
model_id
string
required

Response

Successful Response