Arrows to move, Enter to openSee all results →

Standards / health@1

PublishedVersion 1.4.02026-12-01MITDeveloper reference

health@1 daily body metrics, sleep sessions with stages, workouts, food eaten and body measurements from wearables, scales and health apps

One row of sleep_sessions is one sleep (a night or a nap) as one device recorded it; one row of daily_metrics is one value of one metric code on one local day from one device; one row of workouts is one workout; one row of nutrition (1.2) is one diary day of food from one app; one row of body is one day's weigh-in (and body fat, waist) from one scale or app. The Apple Health export fills all three (it also carries Apple Watch data and every app that writes to Apple Health: Oura, WHOOP, AutoSleep and others); a folder of health@1 CSV files is the generic lane-1 format any tool can write.

Tables165 requiredFields170no viewsVocabularies9shared word listsDashboards5read it
JSON Schema/spec/health/1.4.0/health@1.schema.jsonSQL tables (SQLite)/spec/health/1.4.0/schema.sqlREADME/spec/health/1.4.0/README.mdChangelog/spec/health/CHANGELOG.md

Check a database or a board against it: dashremix spec check. Start a new board on it: dashremix new <id> --schema health@1. Hash 272b80037e9ab069…

Dashboards that read it

Tables and fields

Required tables must exist in every database that says it follows health@1; required fields must be filled. Columns a board adds start with x_.

metarequired table

Key/value facts about this database. Required: schema, schema_version, as_of, data_hash. Recommended (checked at warn): source_built_at (ISO 8601 UTC instant the importer wrote it).

FieldTypeRequiredMeaning
keyTEXTno
valueTEXTno

metric_codesrequired table

The metric codes this database uses, copied from vocab/metric_codes.csv (the controlled list), so metrics can read units and aggregation rules with a join. HRV is two codes that are never mixed: hrv_sdnn (Apple) and hrv_rmssd (Oura, WHOOP).

FieldTypeRequiredMeaning
codeTEXTmetric_codesyese.g. rhr, hrv_sdnn, hrv_rmssd, resp_rate, spo2, wrist_temp, steps
nameTEXTyesdisplay name, e.g. Resting heart rate
unitTEXTunitsyesthe unit every value of this code is stored in: bpm | ms | breaths_min | share | degC | count | kcal | s | kg | ml_kg_min
aggTEXTyeshow samples within one day become the day's value: sum | avg | last | min | max
sourcesTEXTnosource identifiers that map to this code, separated by spaces (HKQuantityTypeIdentifierRestingHeartRate ...)

daily_metricsrequired table

One metric value per local day, code and device. A board's source priority picks one device per day and code.

FieldTypeRequiredMeaning
dateTEXTdateyesthe local calendar date the samples were taken (YYYY-MM-DD)
codeTEXTmetric_codesyesmetric code (vocab metric_codes)
valueREALyesin metric_codes.unit, after the code's agg over that day's samples
unitTEXTnothe unit, repeated for readers that do not join metric_codes
deviceTEXTyesthe device or app that measured it, as the source names it (Sam's Apple Watch, Oura); '' when unknown
n_samplesINTEGERnohow many source samples made the value (1 for a source that reports daily values)
sourceTEXTsourcesyesconnector id that wrote the row (vocab sources): apple-health | health-csv | oura | whoop ...
source_refTEXTnowhere it came from: the file (and record type), or the API object id
imported_atTEXTinstantnoISO 8601 UTC instant of the import (left out of meta.data_hash)

sleep_sessionsrequired table

One sleep as one device recorded it: the night's main sleep, or a nap. Stage seconds are measured on a timeline in which overlapping samples from the same device are merged (an interval union), never added: asleep_s = light_s + deep_s + rem_s + asleep_unspecified_s, and in_bed_s >= asleep_s. night_of is the local date of the evening the night began: a sleep belongs to the noon-to-noon window it starts in, in local time.

FieldTypeRequiredMeaning
sleep_idTEXTyesthe source's id when it has one, else sha1 of source|device|night_of|is_nap|start_utc (first 16 hex)
start_utcTEXTinstantyesfirst moment in bed or asleep (ISO 8601 UTC)
end_utcTEXTinstantyeslast moment in bed or asleep (ISO 8601 UTC)
tzTEXTyesthe local time zone: an IANA name (Europe/London), or a fixed offset (+01:00) when the source gives only an offset
start_localTEXTnolocal wall-clock time it started (YYYY-MM-DDTHH:MM:SS, no zone), for bedtimes
end_localTEXTnolocal wall-clock time it ended (YYYY-MM-DDTHH:MM:SS), for wake times; across a DST change the two zones differ
night_ofTEXTdateyesthe local date of the evening the sleep belongs to (noon-to-noon window)
in_bed_sINTEGERnoseconds in bed: the union of every in-bed, asleep and awake interval of this device
asleep_sINTEGERnoseconds asleep (any stage); NULL when the device only knows in bed
awake_sINTEGERnoseconds awake in bed (in_bed_s - asleep_s)
light_sINTEGERnolight sleep seconds (Apple calls it Core)
deep_sINTEGERnodeep sleep seconds
rem_sINTEGERnoREM sleep seconds
asleep_unspecified_sINTEGERnoasleep seconds with no stage (older devices and apps, Apple before iOS 16)
latency_sINTEGERnoseconds from getting into bed to first sleep, when the device knows both
efficiencyREALnoasleep_s / in_bed_s (0..1)
hr_minREALnolowest heart rate during the sleep, bpm
hrv_sdnn_msREALnoaverage HRV as SDNN during the sleep, ms (Apple); never an RMSSD value
hrv_rmssd_msREALnoaverage HRV as RMSSD during the sleep, ms (Oura, WHOOP); never an SDNN value
rhrREALnoresting heart rate the device gave for this sleep, bpm
resp_rateREALnoaverage breaths per minute during the sleep
scoreREALnothe device's own sleep score (0..100) when it gives one; boards never compute it
is_napINTEGERyes1 for a nap (a short daytime sleep apart from the night's main sleep)
n_segmentsINTEGERnohow many source samples made the session (Apple sleep records)
deviceTEXTyesthe device or app that recorded it, as the source names it
sourceTEXTsourcesyesconnector id (vocab sources)
source_refTEXTnowhere it came from: file (and record type), or file:line, or API id
imported_atTEXTinstantnoISO 8601 UTC instant of the import (left out of meta.data_hash)

workoutsrequired table

One workout as one source recorded it. Training Log reads this table; Sleep & Recovery uses it to compare nights after workout days. The same real workout often arrives from two sources (an Apple Watch run that Strava also holds): every source keeps its own row, and a board counts one row per real workout by the person's source priority (the workout rules in README.md). Rows from two sources are never added or merged field by field.

FieldTypeRequiredMeaning
workout_idTEXTyesthe source's id, else sha1 of source|device|start_utc|sport (first 16 hex)
start_utcTEXTinstantyesISO 8601 UTC
end_utcTEXTinstantnoISO 8601 UTC
tzTEXTyesIANA name or fixed offset, as sleep_sessions.tz
dateTEXTdatenolocal date it started (YYYY-MM-DD)
sportTEXTsportsyesrun | ride | swim | walk | hike | strength | yoga | row | ski | other (vocab sports)
duration_sINTEGERyeselapsed seconds
moving_sINTEGERnomoving seconds when the source gives them
distance_mREALnometres
elev_gain_mREALnometres climbed
kcalREALnoactive kilocalories
avg_hrREALnobpm
max_hrREALnobpm
loadREALnotraining load (TRIMP or the source's own), unitless
rpeREALnoperceived effort 1..10
nameTEXTnothe source's title
gearTEXTnoshoes, bike
is_raceINTEGERno1 for a race
route_refTEXTnopath to a GPX/FIT file for the route (never embedded)
external_idTEXTnothe source's own activity id (Strava Activity ID, Garmin activityId, a FIT file's serial + time) (1.1)
sport_rawTEXTnothe source's activity type as written (Running, Run, running, Weight Training) (1.1)
indoorINTEGERno1 indoors (treadmill, trainer, pool), 0 outdoors, NULL unknown (1.1)
laps_nINTEGERnolaps the source recorded (1.1)
deviceTEXTyesthe device or app that recorded it
sourceTEXTsourcesyesconnector id (vocab sources)
source_refTEXTnowhere it came from
imported_atTEXTinstantnoISO 8601 UTC instant of the import

workout_zones

Optional (1.1): seconds in each heart-rate zone of one workout, as the source measured them from its own heart-rate samples (a Garmin summary, a FIT file's records). Zones are numbered 1 (easiest) to 5. A board that works zones out itself (from avg_hr) keeps that in its own d_ tables, never here.

FieldTypeRequiredMeaning
workout_idTEXTyesworkouts.workout_id
zoneINTEGERyes1..5
secondsINTEGERyesseconds in this zone
lo_bpmREALnothe zone's lower bound in bpm, when the source says
hi_bpmREALnothe zone's upper bound in bpm, when the source says
sourceTEXTsourcesyesconnector id (vocab sources)
source_refTEXTnowhere it came from
imported_atTEXTinstantnoISO 8601 UTC instant of the import

workout_laps

Optional (1.1): the laps (or splits) of one workout, when the source records them.

FieldTypeRequiredMeaning
workout_idTEXTyesworkouts.workout_id
lap_nINTEGERyes1, 2, ... in order
start_utcTEXTinstantnoISO 8601 UTC
duration_sINTEGERyeselapsed seconds of the lap
distance_mREALnometres
avg_hrREALnobpm
max_hrREALnobpm
elev_gain_mREALnometres climbed
sourceTEXTsourcesyesconnector id (vocab sources)
source_refTEXTnowhere it came from
imported_atTEXTinstantnoISO 8601 UTC instant of the import

workout_streams

Optional (1.3): what one stream of a workout's samples measured (power, heart rate, speed or cadence, second by second, from a FIT, GPX or TCX activity file or from Apple Health samples), summarised. The samples themselves are never stored, and neither is any position: a reader works distances out in memory and keeps only these summaries (workout rule 6). Time is measured on the workout's own clock: a gap between samples longer than the reader's max gap is a pause, counted in no stream's seconds.

FieldTypeRequiredMeaning
workout_idTEXTyesworkouts.workout_id
streamTEXTstreamsyespower | heart_rate | speed | cadence (vocab streams)
secondsINTEGERnoseconds of the workout covered by samples (pauses left out); NULL when the source gave only a summary
avgREALnotime-weighted average over those seconds, in the stream's unit (W, bpm, m/s, rpm)
maxREALnohighest sample, in the stream's unit
weightedREALnopower only: the 4th root of the mean of the 30-second rolling average to the 4th power (W); NULL for other streams
max_gap_sINTEGERnothe longest gap between samples the reader held a value across (longer gaps are pauses)
sourceTEXTsourcesyesconnector id (vocab sources)
source_refTEXTnowhere it came from (the activity file)
imported_atTEXTinstantnoISO 8601 UTC instant of the import

workout_efforts

Optional (1.3): a workout's best efforts, worked out from its streams by the reader: the highest average power, speed or heart rate held for `span` seconds, and the fewest seconds needed to cover `span` metres. The window runs on the elapsed clock: a pause inside it counts as standing still (no power, no distance), so a pause never improves an effort.

FieldTypeRequiredMeaning
workout_idTEXTyesworkouts.workout_id
measureTEXTeffort_measuresyespower | speed | heart_rate (best average over span seconds) | time (fewest seconds over span metres) (vocab effort_measures)
spanREALyesseconds (power, speed, heart_rate) or metres (time), e.g. 1200 or 5000
valueREALyesW (power), m/s (speed), bpm (heart_rate) or seconds (time)
offset_sINTEGERnoseconds from the workout's start to the start of the effort
sourceTEXTsourcesyesconnector id (vocab sources)
source_refTEXTnowhere it came from (the activity file)
imported_atTEXTinstantnoISO 8601 UTC instant of the import

workout_histograms

Optional (1.3): seconds a workout spent in each bin of one stream (power in 5 W bins, heart rate in 1 bpm bins, speed in 0.1 m/s bins, or wider bins a source chose), so a board can count time in zones of any threshold without the samples. A bin holds lo <= value < lo + width. A workout's seconds over all bins of a stream equal workout_streams.seconds.

FieldTypeRequiredMeaning
workout_idTEXTyesworkouts.workout_id
streamTEXTstreamsyespower | heart_rate | speed | cadence (vocab streams)
loREALyesthe bin's lower bound, in the stream's unit
widthREALyesthe bin's width, in the stream's unit (> 0)
secondsINTEGERyesseconds in this bin
sourceTEXTsourcesyesconnector id (vocab sources)
source_refTEXTnowhere it came from (the activity file)
imported_atTEXTinstantnoISO 8601 UTC instant of the import

body

Optional body measurements: one row per local day, device and source. The row holds the day's FIRST measurement of each kind (the morning weigh-in is the comparable one); later measurements that day are counted in n_samples, never averaged or added. Stored in kilograms, shares and metres whatever the scale or app showed (lb, st, %, cm, in converted on import).

FieldTypeRequiredMeaning
dateTEXTdateyeslocal date (YYYY-MM-DD)
weight_kgREALnokilograms
body_fatREALnoshare (0.21)
waist_mREALnometres
deviceTEXTyesscale or app
sourceTEXTsourcesyesconnector id
source_refTEXTnowhere it came from
imported_atTEXTnoISO 8601 UTC instant of the import
measured_atTEXTinstantno1.2: ISO 8601 UTC instant of the day's first measurement, when the source gives a time
n_samplesINTEGERno1.2: measurements this device and source took that day (the row holds the first of each kind)

nutrition

1.2, optional: food eaten, one row per local day, device (the app) and source. A day's totals as the app logged them for that diary date. A day with nothing logged has NO row (never a row of zeros): an unlogged day is unknown, not zero intake. Two apps or files holding the same day (MyFitnessPal's own export and the copy it wrote to Apple Health) give two rows; a board counts one per day by the person's source priority and never adds them. Food names and notes are never stored.

FieldTypeRequiredMeaning
dateTEXTdateyesthe diary date (local YYYY-MM-DD) the food was logged for
kcalREALnoenergy eaten, kilocalories (kilojoules / 4.184 on import)
protein_gREALnoprotein, grams
carbs_gREALnocarbohydrates (total, not net), grams
fat_gREALnofat (total), grams
fiber_gREALnofibre, grams
n_entriesINTEGERyessource rows or records that made the day (meals, servings, daily rows, Apple dietary samples)
completedINTEGERno1 when the person marked the diary day complete in the app, 0 when the app says not complete, NULL when the app has no such flag
deviceTEXTyesthe app that logged it (MyFitnessPal, Cronometer; for Apple Health the app that wrote the samples)
sourceTEXTsourcesyesconnector id (vocab sources): myfitnesspal | cronometer | apple-health | health-csv ...
source_refTEXTnowhere it came from: the file (and record type)
imported_atTEXTinstantnoISO 8601 UTC instant of the import

import_counts

Source accounting: for every input file and record type, how many rows or records were read and what happened to each. n_read = n_used + n_duplicate + n_skipped + n_out_of_scope always. raw_sum is the sum over every record read of its value (quantities) or its seconds (sleep), so an independent reader can confirm nothing vanished.

FieldTypeRequiredMeaning
fileTEXTyesthe input file as written in the board's inputs (data/files/export.zip)
record_typeTEXTyesHKCategoryTypeIdentifierSleepAnalysis, a CSV file's table, ...
sourceTEXTsourcesyesconnector id (vocab sources)
n_readINTEGERyesrecords or rows read
n_usedINTEGERyesthat went into a row of this database
n_duplicateINTEGERyesexact repeats of a record already read (same type, device, times and value)
n_skippedINTEGERyesthat could not be read (a bad date, value or unit): counted, never guessed
n_out_of_scopeINTEGERyesof a type this importer does not use
raw_sumREALnosum of value (quantity records) or seconds (sleep records) over all n_read

data_issues

What the importer could not read or decided: skipped records, unknown values, gaps, files it could not open.

FieldTypeRequiredMeaning
issue_idTEXTyesstable id
severityTEXTseveritiesyesinfo | warn | error (vocab severities)
kindTEXTyesrows_skipped | unknown_value | unknown_unit | duplicates | file | ...
titleTEXTyesone line
detailTEXTyeswhat and where (file, record type), never a value from the person's data
source_refTEXTnofile, or file:line
handlingTEXTyeswhat the importer did about it

annotations

Notes on metrics and pages (platform table). Numbers only through {{metric:...}} placeholders.

FieldTypeRequiredMeaning
annotation_idTEXTyesstable id
targetTEXTyesmetric id or page id
kindTEXTyesnote | caveat | flag | decision | open_item
bodyTEXTyesthe note text
authorTEXTnoperson or assistant
source_refTEXTnowhere it came from
created_atTEXTnoISO 8601 instant
data_hashTEXTnohash of the cited metric values when written (stale when they change)
statusTEXTnoactive | stale | retired

metric_registry

FieldTypeRequiredMeaning
metric_idTEXTyese.g. sleep.nightly
versionINTEGERnothe metric's own version
unitTEXTnorows | pct | count | hours ...
paramsTEXTnocomma list of parameters it honours
descriptionTEXTnothe @desc line
sqlTEXTnoexpanded SQL
testTEXTnothe @test line (check that covers it)

Vocabularies

Shared word lists, so every board and connector means the same thing by the same word.

effort_measures4 values

power · speed · heart_rate · time

metric_codes15 values

rhr · hrv_sdnn · hrv_unverified · hrv_rmssd · resp_rate · spo2 · wrist_temp · skin_temp_dev · steps · active_kcal · exercise_time · weight · vo2max · sleep_score …

severities3 values

info · warn · error

sleep_stages6 values

in_bed · asleep_unspecified · light · deep · rem · awake

sources14 values

apple-health · health-csv · oura · whoop · google-health · strava-archive · garmin-archive · fit-file · manual · myfitnesspal · cronometer · withings · weigh-ins-csv · neverchill-export

sport_map0 values

sports10 values

run · ride · swim · walk · hike · strength · yoga · row · ski · other

streams4 values

power · heart_rate · speed · cadence

units11 values

bpm · ms · breaths_min · share · degC · count · kcal · s · kg · ml_kg_min · score

Changelog

1.4.0 (2026-12-01), minor

  • For NeverChill Athlete (published by NeverChill). New vocabulary values only: source neverchill-export (the NeverChill account export: ZIP parts and manifest, read in place) and its rows in sport_map.csv (NeverChill's sport and sub-sport, e.g. cycling/virtual -> ride, indoor). No table or column changes: NeverChill's own concepts (its fitness model and freshness bands, durability, Rider DNA, plans, baselines) stay in that board's x_neverchill_ tables, as the extension rule says, until a second board needs one.
  • No migration: the DDL is unchanged (schema.sql hash unchanged). Boards pinned to 1.3.0 re-pin to 1.4.0.

1.3.0 (2026-11-30), minor

  • For Athlete Performance. New optional tables, all summaries of a workout's sample streams (the samples themselves and any position are never stored, workout rule 6): workout_streams (per stream: covered seconds, time-weighted average, maximum, weighted power, the reader's max gap), workout_efforts (best average power, speed or heart rate over a span of seconds, fewest seconds over a span of metres, with the offset into the workout) and workout_histograms (seconds per bin of a stream, so a board counts time in zones of any threshold without the samples).
  • Workout rule 6 (1.3): streams are summarised, never stored; a gap longer than max_gap_s is a pause; a pause inside an effort's window counts as standing still, so it never raises an effort; summaries stay with the row of the source whose file they came from.
  • Vocabularies: new streams.csv (power, heart_rate, speed, cadence with units) and effort_measures.csv.
  • New conformance checks at warn: streams_valid, efforts_valid (including a monotone curve within a workout), histograms_valid (bins add up to the stream's seconds).
  • Fixtures: the Strava archive run's file summarised. Migration migrations/1.2-to-1.3.sql for a stored 1.2 database (boards rebuild theirs on every import).

1.2.0 (2026-11-30), minor

  • For Nutrition & Weight. New optional table nutrition: one diary day of food per app and source (kcal, protein, carbs, fat, fibre, entries, the app's "day complete" flag). body: optional measured_at and n_samples.
  • Food and body rules written once (README): the diary date is the day; an unlogged day has no row (never zero intake); one source per day by the person's priority, never added; the day's first weigh-in; units at the door (lb, st, kJ, %, cm, in); food names and notes never stored.
  • Sources myfitnesspal, cronometer, withings, weigh-ins-csv. New conformance checks at warn: nutrition_plausible, body_plausible. Fixtures: one food day from MyFitnessPal and its Apple Health copy, a Cronometer day marked complete, one weigh-in from Withings and Apple Health.
  • Migration migrations/1.1-to-1.2.sql for a stored 1.1 database (boards rebuild theirs on every import).

1.1.0 (2026-11-30), minor

  • For Training Log. workouts: optional external_id (the source's activity id), sport_raw (the source's own activity type), indoor, laps_n.
  • New optional tables workout_zones (seconds per heart-rate zone 1..5, as the source measured them) and workout_laps (laps or splits).
  • Workout rules written once (README): one row per source, a board counts one row per real workout by source priority (matched by start time, sport and duration; never added or merged), units at the door, zones and laps are the source's.
  • Vocabularies: sources strava-archive, garmin-archive, fit-file; new sport_map.csv (each source's activity types and the sport they map to).
  • New conformance checks at warn: zones_valid, laps_valid, workouts_plausible.
  • Fixtures: the same run from an Apple Watch and the Strava archive, with zones and laps. No migration: boards rebuild their database from the person's files on every import.

1.0.0 (2026-11-30)

  • First published version, for Sleep & Recovery (Training Log reads workouts next): metric_codes (the controlled code list with units and day aggregation; HRV as two codes, hrv_sdnn and hrv_rmssd, never mixed), daily_metrics (one value per day, code, device and source), sleep_sessions (nights and naps with in bed, asleep, awake, light/deep/REM/unspecified stages, latency, efficiency, HRV, resting HR, breathing, local times and a time zone), workouts, optional body, import_counts (source accounting per file and record type), data_issues, annotations, metric_registry.
  • hrv_unverified: HRV a non-Apple source wrote as SDNN, kept apart from hrv_sdnn.
  • Night rules written once (README): awake wins where one device's samples overlap; periods formed on each device's timeline before night_of (a sleep past noon stays one); pieces 15 minutes apart for naps and evening dozes; interval union per device, one device per night chosen by the board, noon-to-noon night_of, sessions split by a gap, naps.
  • Conformance checks: codes, units, HRV kinds, ranges, session arithmetic, the noon rule, time zones, one main sleep (warn), workouts, import counts, meta (warn). Fictional fixtures covering every check.

Other standards