Skip to main content
This documentation provides comprehensive details about all available endpoints, request parameters, and response formats for the Covita Alpha v0.1 API.

🌐 Base URL

All API endpoints are relative to the base URL: https://covita.nivara.io

🤖 Chatbot API

The Chatbot API provides three main endpoints:

Send Message

POST /v1/send_message Sends a message to the chatbot and receives a response. Request Parameters:
  • text (string, required): The message text
  • user_type (string, optional, default: “Patient”): User type, one of: “Patient”, “Doctor”, “Coach”
  • model_id (string, optional, default: “openai”): Model to use, one of: “openai”, “gemini”

Get Conversation History

GET /v1/conversation_history Retrieves the conversation history for a given user type. Query Parameters:
  • user_type (string, required): User type
  • model_id (string, required): Model ID

Reset Conversation History

GET /v1/reset_conversation_history Resets the conversation history for a given user type. Query Parameters:
  • user_type (string, required): User type
  • model_id (string, required): Model ID

⚠️ Error Handling

The API uses standard HTTP status codes to indicate the success or failure of requests.
Status CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Validation Error
500Server Error
When an error occurs, the response will include details about what went wrong in a standardized format.
{
  "status": 400,
  "code": "INVALID_PARAMETERS",
  "message": "The request contains invalid parameters",
  "details": {
    "field": "email",
    "issue": "Must be a valid email address"
  }
}

Validation Errors

For validation errors (status code 422), the response format follows this structure:
{
  "detail": [
    {
      "loc": ["body", "field_name"],
      "msg": "error message",
      "type": "error_type"
    }
  ]
}