Shortcuts
The app publishes one Shortcuts action. It runs the same export the Export Now button runs — same time ranges, same destination, same format, same bytes — with no screen, so an automation can export on a schedule you choose. What arrives at your endpoint is exactly the JSON or CSV described on those pages.
If you read nothing else:
- The action throws on failure. A failed export and an empty time range never look alike.
- On a local-network destination, export once in the app first. Until you have, the action refuses and sends nothing.
- One export runs at a time. An action that fires while an export is running is refused, not queued.
- The action’s name, its parameter and the range identifiers are frozen, so a saved Shortcut keeps working.
The action
| Field | Value |
|---|---|
| Action name | Export Health Data |
| Parameter name | Time Range |
Find it in the Shortcuts action library under the app’s name. It runs on the iPhone that has the app; there is no web or Mac counterpart. It does not open the app when it runs.
Time Range
| Time Range | Saved identifier | What it exports |
|---|---|---|
| Last 3 hours | last3Hours | the 3 hours ending when the action runs |
| Last 24 hours | last24Hours | the 24 hours ending when the action runs |
| Last 7 days | last7Days | the 7 days ending when the action runs |
| Last 30 days | last30Days | the 30 days ending when the action runs |
A range is a fixed span back from the moment the action fires, not a calendar range: “Last 24 hours” is not “since midnight”. It includes its start and excludes its end, so back-to-back runs tile. There is no custom date range. “Last 3 hours” is the narrowest: a Shortcut that runs less often than every three hours leaves gaps with it.
Every run of the action is a basis window export: overlapping runs resend the overlap
by design, and a receiver that upserts on uuid absorbs it.
What it returns
- Result — an integer: how many samples the receiver accepted.
0when the range held nothing. An empty range is not an error, and sends no request at all. - Dialog — the export’s own headline, such as
Sent 220 samplesorNothing to send.
Errors
Every failure throws: your Shortcut stops and shows the app’s own message. Wrap the action in an error handler to handle it yourself.
| Situation | What it means |
|---|---|
| No destination yet | Set the receiver’s address in the app first. Nothing was read or sent. |
| No metrics chosen yet | Turn on at least one group in the app first. |
| Local network not explained yet | The one-time in-app export has not happened. Open the app and export once. |
| An export is already running | Nothing was read or sent. Safe to retry — after a moment, not in a tight loop. |
| Nothing arrived | The first batch was refused or unanswered; the message carries the status. Nothing was delivered, so re-running is safe. |
| Partly sent | Some batches landed, then one failed. The failed batch is retried later on the app’s schedule; the batches after it were never built. |
| Couldn’t read from Health | Usually a locked phone. The message counts what had already arrived. |
| Couldn’t read its own settings | The phone restarted and has not been unlocked yet. Unlock it and run again. |
After Partly sent or Couldn’t read from Health, the run is not resumed: exporting the same range again is what fetches the rest, and it resends what already arrived.
What the action does not do
No schedule of its own, no retry or backoff inside the run, no queue in front of it, no entry in a log of its own, no format or metric-group parameter (both come from the app’s settings), no custom date range, and no Siri phrase. It sends nothing anywhere but your endpoint.
A worked automation
Export every hour over the last 24 hours. A missed run — a locked phone, a restart, an
export already running — is covered by the next ones, and uuid deduplication makes the
overlap free.
Automation: Time of Day, every hour
1. Export Health Data
Time Range: Last 24 hours
(on error: show notification with the error, stop)
2. If Result is 0
(nothing to do)
Otherwise
Add "Result" samples to a running log