Skip to main content

Metadata API Documentation

This page provides interactive documentation for the Eli Health API metadata structures.

View Interactive API Documentation →

The interactive Swagger UI documentation is available at /api-docs.html where you can:

  • Explore all API endpoints
  • View detailed schema definitions
  • See request/response examples
  • Try out API calls directly

Key Points About the Metadata

Known Issues

Dual Storage Pattern

The system has a confusing pattern where fields exist in two places:

  • Database columns: record.startDate, record.endDate
  • JSON metadata: record.metadata.startDate, record.metadata.endDate

This requires defensive programming with fallback logic throughout the codebase.

Metadata Structure

The record table contains a JSONB metadata field with all measurement-specific data:

  • Hormone measurements: value, unit, classification, interpretation
  • Time fields: startDate, endDate, wakeUpTime (duplicated from columns)
  • Health data: score, recommendations, population percentiles
  • Context: tags, heart rate data, batch numbers

Security Note

The record table with full metadata is replicated to BigQuery. Access is controlled through IAM permissions, not data exclusion. Most users should access this data through the KPI service rather than direct BigQuery queries.