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

Send Message

Sends a message to the chatbot and receives a response.

Headers

ParameterTypeRequiredDescription
authorizationstringYesAPI authorization token

Request Body

{
  "text": "string",
  "user_id": "User1",
  "user_type": "Patient",
  "model_id": "openai"
}
PropertyTypeRequiredDescription
textstringYesThe message text to send
user_idstringNoUser identifier, one of: “User1” through “User20”. Default: User1
user_typestringNoThe type of user (Patient, Doctor, Coach). Default: Patient
model_idstringNoThe model ID (openai, gemini). Default: openai

Responses

StatusDescriptionContent Type
200Chatbot responseapplication/json
401Unauthorizedapplication/json
422Validation Errorapplication/json

Sample Request

curl -X POST "https://covita.nivara.io/v1/send_message" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "text": "What is my average heart rate?",
    "user_id": "User1",
    "user_type": "Patient",
    "model_id": "openai"
  }'

Sample Response

{
  "response": "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:32:45.123Z",
  "message_id": "msg_12345abcde"
}

Headers

authorization
string
required

Body

application/json
text
string
required
user_type
enum<string>
default:Patient
Available options:
Patient,
Doctor,
Coach
model_id
enum<string>
default:openai
Available options:
openai,
gemini

Response

Successful Response