API Reference

Complete REST API documentation for SmartCemic QESA Pro v3.2.0 with 59 endpoints across 9 modules.

Authentication
JWT-based authentication, registration, and password management
9 endpoints
POST /api/v1/auth/register Register a new user account

Request Body

ParameterTypeDescription
emailstring requiredUser email address
passwordstring requiredSecure password (min 8 chars)
first_namestringUser's first name
last_namestringUser's last name
{
  "email": "user@example.com",
  "password": "SecurePass123!",
  "first_name": "John",
  "last_name": "Doe"
}
POST /api/v1/auth/login Authenticate and receive JWT tokens

Request Body

{
  "email": "user@example.com",
  "password": "SecurePass123!"
}

Response

{
  "access_token": "eyJ...",
  "refresh_token": "eyJ...",
  "token_type": "Bearer",
  "expires_in": 3600
}
GET /api/v1/auth/me Get current user profile

๐Ÿงช Try it live

POST/api/v1/auth/logoutInvalidate session

Requires Authorization header with Bearer token.

POST/api/v1/auth/refreshRefresh access token
{ "refresh_token": "eyJ..." }
POST/api/v1/auth/verifyVerify email with token
{ "token": "verification_token" }
POST/api/v1/auth/password/changeChange password
{ "current_password": "old", "new_password": "new" }
POST/api/v1/auth/password/reset/requestRequest password reset
{ "email": "user@example.com" }
POST/api/v1/auth/password/resetReset password with token
{ "token": "reset_token", "new_password": "NewPass123!" }
Analytics
Trend analysis, anomaly detection, risk assessment, and ML predictions
8 endpoints
POST /api/v1/analytics/trend Analyze measurement trends
{
  "user_id": "uuid",
  "analyte": "glucose",
  "period_days": 30
}

๐Ÿงช Try it live

POST/api/v1/analytics/statisticsStatistical summary

Returns mean, median, std_dev, min, max, time_in_range, and percentiles.

POST/api/v1/analytics/anomalyDetect anomalies

Uses statistical analysis to identify outliers in measurement data.

POST/api/v1/analytics/riskRisk assessment

Calculates health risk scores based on glucose variability, time in range, and hypo events.

POST/api/v1/analytics/forecast/{analyte}ML-based forecast

Predicts future values using machine learning models.

POST/api/v1/analytics/correlationCorrelation analysis

Analyzes correlations between different biomarkers.

POST/api/v1/analytics/analyze/{analyte}Full analysis

Comprehensive analysis for a specific analyte.

POST/api/v1/analytics/wellnessWellness score

Generates an overall wellness score based on all available data.

Interoperability
FHIR R4, HL7 v2.5.1, CDA R2 exports with 46 LOINC codes
5 endpoints
GET /api/v1/interop/loinc Get supported LOINC codes

๐Ÿงช Try it live

POST/api/v1/interop/export/fhirExport as FHIR R4 Bundle

Exports data as HL7 FHIR R4 standard for EHR integration.

POST/api/v1/interop/export/hl7Export as HL7 v2.5.1

Traditional healthcare messaging format.

POST/api/v1/interop/export/cdaExport as CDA R2

Clinical Document Architecture format.

POST/api/v1/interop/export/csvExport as CSV

Simple spreadsheet format for analysis.

Cache Management
Redis cache statistics and management
3 endpoints
GET /api/v1/cache/stats Get cache statistics

๐Ÿงช Try it live

POST/api/v1/cache/clearClear entire cache (admin)

Requires admin privileges.

POST/api/v1/cache/invalidate/user/{user_id}Invalidate user cache

Clears cached data for a specific user.

Device Management
BLE device scanning, connection, and measurement
9 endpoints
POST/api/v1/devices-v2/scanScan for BLE devices

Scans for nearby SmartCemic devices.

POST/api/v1/devices-v2/connectConnect to device
{ "serial": "SC-2025-001234" }
POST/api/v1/devices-v2/disconnectDisconnect device

Disconnects from the specified device.

GET/api/v1/devices-v2/connectedList connected devices

Returns list of currently connected devices.

POST/api/v1/devices-v2/{serial}/measureTake measurement

Initiates a measurement on the specified device.

POST/api/v1/devices-v2/{serial}/calibrateCalibrate device

Calibrates device with reference glucose value.

GET/api/v1/devices-v2/{serial}/batteryGet battery status

Returns battery level and charging status.

GET/api/v1/devices-v2/{serial}/diagnosticsRun diagnostics

Runs full device diagnostics.

GET/api/v1/devices-v2/{serial}/firmware/checkCheck firmware

Checks for available firmware updates.

Notifications
Email, SMS, and push notification management
9 endpoints
GET/api/v1/notificationsGet notifications

Returns user notifications with unread count.

GET/api/v1/notifications/preferencesGet preferences

๐Ÿงช Try it live

PUT/api/v1/notifications/preferencesUpdate preferences

Update notification channel preferences and quiet hours.

POST/api/v1/notifications/{id}/readMark as read

Marks a specific notification as read.

POST/api/v1/notifications/readMark multiple as read

Marks multiple notifications as read.

POST/api/v1/notifications/sendSend notification

Send a notification (admin/system use).

GET/api/v1/notifications/templatesGet templates

Returns available notification templates.

POST/api/v1/notifications/test/alertTest alert

Sends a test alert notification.

Integrations
Google Fit, Fitbit, Apple Health, Dexcom, and webhooks
6 endpoints
GET/api/v1/integrations/List integrations

๐Ÿงช Try it live

POST/api/v1/integrations/{service}/connectOAuth connect

Initiates OAuth flow for the specified service.

GET/api/v1/integrations/{service}/callbackOAuth callback

Handles OAuth callback from external service.

POST/api/v1/integrations/{service}/syncSync data

Syncs data with the connected service.

POST/api/v1/integrations/webhooksRegister webhook

Registers a new webhook endpoint.

POST/api/v1/integrations/webhooks/testTest webhook

Tests webhook delivery.

Background Tasks
Job queue and background processing
5 endpoints
POST/api/v1/tasks/submitSubmit task

Submits a new background task.

GET/api/v1/tasks/{task_id}Get task status

Returns status and progress of a task.

POST/api/v1/tasks/{task_id}/cancelCancel task

Cancels a running task.

GET/api/v1/tasks/scheduledList scheduled

Lists all scheduled tasks.

GET/api/v1/tasks/statsQueue stats

Returns task queue statistics.

File Storage
S3/local file storage for reports and exports
5 endpoints
POST/api/v1/storage/uploadUpload file

Uploads a file (multipart/form-data).

GET/api/v1/storage/files/{file_id}Get file metadata

Returns file information.

GET/api/v1/storage/files/{file_id}/urlGet download URL

Returns a temporary signed download URL.

DELETE/api/v1/storage/files/{file_id}Delete file

Permanently deletes a file.

GET/api/v1/storage/user/{user_id}/filesList user files

Returns all files for a user.