Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/FerchoSG/healthcare-web/llms.txt

Use this file to discover all available pages before exploring further.

The analytics API exposes aggregated KPI metrics and revenue data for the admin dashboard. Both endpoints are scoped to the clinic identified by the x-clinic-id header, so each clinic sees only its own data. All requests require a valid Authorization bearer token.
Both analytics endpoints are scoped to the active clinic via the x-clinic-id header. Ensure the header is set to the correct clinic UUID before calling these endpoints.

GET /analytics/kpis

Returns high-level KPI counts for the current clinic. These values are used by the CitaBox dashboard home screen to show today’s activity and month-to-date summaries. ResponseKPIs
appointments_today
number
required
Total number of appointments scheduled for today (clinic local date).
new_patients_this_month
number
required
Number of new patient records created in the current calendar month.
revenue_this_month
number
required
Total revenue collected this month, in cents (CRC colones). Calculated from invoices with payment_status: PAID or PARTIAL.
curl --request GET \
  --url http://localhost:3001/analytics/kpis \
  --header "Authorization: Bearer <token>" \
  --header "x-clinic-id: <clinic_id>"
{
  "appointments_today": 14,
  "new_patients_this_month": 37,
  "revenue_this_month": 185000000
}

GET /analytics/revenue

Returns a time-series of daily revenue totals for the current month. This data is used to render the revenue trend chart in the admin dashboard. ResponseRevenueDataPoint[]
date
string
required
Date of the data point in YYYY-MM-DD format.
total
number
required
Total revenue for that date, in cents (CRC colones).
curl --request GET \
  --url http://localhost:3001/analytics/revenue \
  --header "Authorization: Bearer <token>" \
  --header "x-clinic-id: <clinic_id>"
[
  { "date": "2026-05-01", "total": 7500000 },
  { "date": "2026-05-02", "total": 12000000 },
  { "date": "2026-05-03", "total": 0 },
  { "date": "2026-05-04", "total": 0 },
  { "date": "2026-05-05", "total": 9250000 }
]
Revenue values are in cents. Divide by 100 to display in colones (₡). For example, 7500000 represents ₡75,000.00.

Build docs developers (and LLMs) love