Wearables
Wearable connections: the link to connect a device, connections, daily and period data, the metric catalog and selection, disconnect.
List connected wearables
Fetch connected wearable/health providers (from Junction) and aggregate them by brand. Includes resource availability info when available.
Get today's wearable data
Get current day's metric value (or fallback to yesterday if no data). Supports optional provider filter. Special handling: sleep fetches last 3 days to capture previous night; steps/hrv/glucose try today then yesterday.
Connect a demo wearable
Connect a demo data provider (for testing/demo purposes). Limited to: apple_health_kit, fitbit, freestyle_libre, oura.
Disconnect a wearable
Disconnect a wearable provider (deregister from Junction).
Create a wearable link token
Create or retrieve a Junction link token for OAuth provider connection flow.
Get the current value of a metric
The most recent value of a metric: today's when there is one, otherwise yesterday's for vitals.
Get a metric time series
Fetch time series data for a specific metric over a date range. Supports bucketing by period (day/week/month/year) and aggregation (sum/avg depending on metric type).
List a brand's metrics
The metrics a connected wearable brand can supply (`available`) and the ones shown first (`selected`, up to ten). A person's earlier selection is kept where it is still available.
Choose a brand's metrics
Save user's selected metrics for a provider brand (max 10, must be subset of available).
Get a wearable summary
Fetch aggregated health data summary for a given metric type (sleep, activity, steps, hrv, glucose, workouts, body). Supports filtering by provider and optional bucketing.
Create the wearable user
Makes sure the person has a wearables profile, creating it on the first call. Safe to repeat: later calls return the same profile.