Heart rate variability
get_hrvDecrypt and return HRV (SDNN) records from Apple Health, with hourly buckets for trend analysis or raw samples for precise spikes. Includes coverage metadata and owner filter.
Instructions
Decrypt recent HRV (SDNN in ms) — returns records plus average over the window.
granularity selects between two backing kinds:
"hourly"(default) — routes tohrv_hourlykind: one bucket per UTC hour (arithmetic mean of every raw SDNN sample in the hour). 30-day rolling window, ≤720 records, includessample_countper bucket. Records also carry asdnn_msalias equal to the hourly mean, so callers migrating from the pre-build-77 raw default keep working without a field rename. Right for trend / aggregate queries — SAVES CONTEXT vs raw."raw"— routes tohrvkind: one record per SDNN sample (Apple Watch emits every 5-15min). 3-day rolling window; older raw history lives in prior-recipient envelopes plus theVaultbeatHistoryBackfillCoordinator-driven historical push (advances 30d/24h on device wake-ups, up to 5 years). Use for spike-precision questions (e.g. "HRV during the 3 minutes I opened a stressful message"). Note: single-day count is often 30-100+ records.
⚠️ average_sdnn_ms from the two granularities is NOT directly
comparable — they observe different windows (3d vs 30d) and, on
the raw side, also include legacy per-sample blobs from before
build 77. Use hourly for "what has my HRV been lately?" trend
answers; use raw only when you need per-sample precision inside
the last ~3 days. The equivalence claim in previous doc versions
was retracted 2026-07-22 after an adversarial review pointed out
the window mismatch.
Use owner prefix to filter by person — take it from
vaultbeat_status (owner_user_id_prefix is the paired user; server
0.7.1+), or vaultbeat_doctor for every owner present in the data.
Carries a coverage block: quote coverage.days_covered (distinct days, not
the row count) and coverage.span_days beside any average or trend, and read
coverage.window_satisfied: false as a shorter history than asked, not as a
missing kind. 🔴 Before saying how far back someone's data goes, read
coverage.more_available: true means this server can decrypt days OLDER
than first_day that your limit left behind — re-read with a larger
limit, or quote coverage.oldest_available as the real start of their
history. Never report a limit-shaped window as the extent of their data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | ||
| limit | No | ||
| owner | No | ||
| granularity | No | hourly |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||