Health Connect historical data and the 30-day limit
By default an app can read Health Connect data from up to 30 days before the user first granted it any permission. Reading older records needs the history permission, and without it Health Connect returns an error. HC Sync's Android SDK backfills 30 days by default (opt-in history permission, SDK 0.4.0-beta.1 beta, for older data) and is free for 5 synced users in public beta.
Last updated: 2026-11-08. Limits quoted from Google's Android developer documentation, checked 2026-11-07.
Key facts (as of 2026-11)
- Default window: 30 days before any permission was first granted, per Google.
- Android 14 and higher: no historical limit on an app reading its own data; 30-day limit on other data.
- Android 13 and lower: 30-day limit on reading any data.
- The extra permission is PERMISSION_READ_HEALTH_DATA_HISTORY (manifest name android.permission.health.READ_HEALTH_DATA_HISTORY).
- HC Sync Android SDK: backfillDays 1 to 30, default 30, and it does not request the history permission unless you opt in. Opt-in (requires SDK 0.4.0-beta.1; beta, not yet device-tested by us): history = true allows a longer backfillDays, subject to your Play Console declaration.
What is the 30-day limit?
Google's documentation says: "By default, all applications can read data from Health Connect for up to 30 days prior to when any permission was first granted." Health Connect is an on-device store, so this limit applies on each user's phone, not to a server. If your backend wants a year of heart-rate samples, the phone-side app has to be allowed to read them first.
The window is measured from the first permission grant, not from today. A user who granted access in March can still be read back to February; the app does not lose older data as time passes, it simply never gained the right to read before that start point unless the history permission is granted.
When does the limit not apply?
On Android 14 and higher, Google lists no historical limit when an app reads data that it wrote itself, and a 30-day limit for data written by other apps. On Android 13 and lower the 30-day limit applies to any data. Apps that only read what other apps and watches wrote, which is the HC Sync case, are in the 30-day group.
How do you read older data?
Google says you can extend reads beyond the default restrictions by requesting PERMISSION_READ_HEALTH_DATA_HISTORY. In its words, "without this permission, an attempt to read records older than 30 days results in an error." Declare it in the manifest and request it with the other Health Connect permissions, then handle the case where the user declines.
<uses-permission android:name="android.permission.health.READ_HEALTH_DATA_HISTORY" /> <uses-permission android:name="android.permission.health.READ_STEPS" />
Treat the history permission like any sensitive health permission: ask only if your feature needs it, explain why, and keep working with the shorter window if it is refused. Check Google's current Play requirements for declaring the extra access.
What happens when a user reinstalls your app?
Google states that deleting your app revokes all permissions, including the history permission. After reinstalling and granting again, the same defaults apply and the app can read up to 30 days before the new grant date. Google's example: delete on 10 May 2023, reinstall on 15 May 2023, and the earliest readable date becomes 15 April 2023.
How does HC Sync backfill history?
When sync starts, the HC Sync SDK reads the last backfillDays, then switches to Health Connect change tokens so it uploads only what changed. Google notes that an unused changes token expires within 30 days; when that happens the SDK re-reads the same window and reports rebackfilled. Deletions made while a token was expired cannot be detected, so those records stay on the HC Sync server until you delete them there.
HcSync.configure(context, userToken, types = setOf("steps", "sleep"), backfillDays = 30)By default the SDK does not request the history permission, so it imports at most 30 days. To go further, opt in with SDK 0.4.0-beta.1 (implementation("dev.hcsync:hcsync:0.4.0-beta.1"); the default 0.3.0 has no history option): HcSync.configure(context, userToken, backfillDays = 365, history = true) (or ConnectOptions(history = true), and history: true in the Expo plugin so the manifest declares it; the Expo option ships in the next React Native archive, not the 0.3.0 download). The SDK asks for READ_HEALTH_DATA_HISTORY only if the device reports FEATURE_READ_HEALTH_DATA_HISTORY as available, reads older data in windows of at most 30 days with pauses and retries to respect Health Connect rate limits, and falls back to 30 days if the user declines or the device does not support it. This is beta and not yet tested on real devices: test on yours. Publishing an app that declares the permission needs the Health apps declaration in Play Console, including justification for the history access; check Google's current requirements. The React Native runtime still backfills 30 days. It also does not import Google Fit cloud history. If your product needs longer history, your own app has to request the permission, and you would need to check that the records can be uploaded through our REST API. Uploaded records are stored in the US and deleted after 13 months.
How should you design around the limit?
- Sync from the day a user signs up, so your backend becomes the long-term store.
- Tell users that older data may be missing, and do not promise a full lifetime history.
- Use the sync pass state, including rebackfilled, to show when a gap was refilled.
- Verify real devices: an empty result can also mean no source app wrote data.
Official sources
- Android Developers: Read Health Connect data (read limits, history, background reads)
- Android Developers: Sync data with Health Connect (changes tokens, foreground and background reads)
Common questions
What is the Health Connect 30-day limit?
Apps can read Health Connect data from up to 30 days before the user first granted any permission, unless they hold the history permission.
Which permission removes the 30-day limit?
Request PERMISSION_READ_HEALTH_DATA_HISTORY, whose manifest name is android.permission.health.READ_HEALTH_DATA_HISTORY. Without it, reading records older than 30 days results in an error.
Does HC Sync read more than 30 days of Health Connect history?
By default no: it backfills 1 to 30 days and does not request the history permission. Integrators can opt in with history = true (requires SDK 0.4.0-beta.1; beta, not yet device-tested by us); the SDK then requests READ_HEALTH_DATA_HISTORY when the device reports the feature as available, and falls back to 30 days if it is declined or unsupported. Your app needs the Play health declaration for it.
Does an app lose access when it is reinstalled?
Permissions are revoked on deletion. After reinstalling and granting again, the app can read up to 30 days before the new grant date.
Health Connect sync frequency · Health Connect REST API · Kotlin Health Connect sync · Google Fit API replacement · HC Sync documentation