> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nivara.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Covita v0.3 API Reference

> Complete API reference for the Covita v0.3 application.

<Callout type="info" emoji="🎉">
  Welcome to Covita v0.3! This version introduces comprehensive patient data analytics and enhanced AI conversation capabilities.
</Callout>

## What's New in v0.3

Covita v0.3 introduces significant enhancements to both AI capabilities and patient data analytics:

### AI Assistant Enhancements

* **Enhanced User Types**: Support for Patient, Doctor, Coach, and Researcher roles
* **Multi-Model Support**: Choose between OpenAI and Gemini AI models
* **Improved Conversation Management**: Better conversation history tracking and reset capabilities

### Comprehensive Patient Data Analytics

* **Detailed Patient Information**: Access comprehensive patient profiles with medical history
* **Health Metrics Time Series**: Track heart rate, sleep patterns, and respiratory data over time
* **Advanced Sleep Analytics**: Detailed sleep stage analysis, efficiency metrics, and recovery data
* **Cardiovascular Monitoring**: Heart rate statistics and respiratory rate tracking
* **Demographic Insights**: Population-level demographic filters and analytics
* **Patient Management**: Pagination support for large patient datasets

## API Endpoints Overview

### AI Assistant

* **Send Message** - Interact with the AI assistant for health-related queries
* **Get Conversation History** - Retrieve previous conversations
* **Reset Conversation History** - Clear conversation history for a fresh start

### Patient Data

* **Get Patient Info** - Comprehensive patient information and recent metrics
* **Get All Patients** - List and manage multiple patients with pagination
* **Get Demographic Filters** - Population-level demographic analytics
* **Get Heart Rate Timeseries** - Detailed cardiovascular time series data
* **Get Sleep Timeseries** - Sleep duration and quality metrics over time
* **Get Sleep Metrics** - Advanced sleep stage analysis and recovery metrics
* **Get Cardio Respiratory Metrics** - Heart rate and breathing statistics

## Migration from v0.2

Key changes when migrating from v0.2 to v0.3:

1. **New User Types**: The `user_type` field now supports an additional role (Researcher)
2. **Enhanced Patient Data**: New endpoints provide much richer patient analytics
3. **API Paths**: All endpoints now use the `/api/v1/` prefix
4. **Authentication**: Continues to use Bearer token authentication

## Authentication

All endpoints require Bearer token authentication. Include your API token in the Authorization header:

```bash theme={null}
Authorization: Bearer YOUR_API_TOKEN
```
