Skip to main content
POST
/
api
/
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 (Bearer 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, Researcher). Default: Patient
model_idstringNoThe AI model to use (openai, gemini). Default: openai

Responses

StatusDescriptionContent Type
200Successful Responseapplication/json
422Validation Errorapplication/json

Sample Request

curl -X POST "https://api.covita.com/api/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.",
  "user_type": "Patient"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Represents a message in the chat system with user identification and model selection.

Attributes: text: The content of the message user_id: Identifier for the user sending the message user_type: The role of the user (Patient, Doctor, Coach, or Researcher) model_id: The AI model to use for generating responses

text
string
required
user_id
enum<string>
default:User1
Available options:
User1,
User2,
User3,
User4,
User5,
User6,
User7,
User8,
User9,
User10,
User11,
User12,
User13,
User14,
User15,
User16,
User17,
User18,
User19,
User20
user_type
enum<string>
default:Patient
Available options:
Patient,
Doctor,
Coach,
Researcher
model_id
enum<string>
default:openai
Available options:
openai,
gemini

Response

Successful Response