- [HTTP request](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#body.request_body)
  - [JSON representation](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#body.response_body)
  - [JSON representation](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#body.DailyRollUpDataPointsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#body.aspect)
- [CivilTimeInterval](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#CivilTimeInterval)
  - [JSON representation](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#CivilTimeInterval.SCHEMA_REPRESENTATION)
- [DailyRollupDataPoint](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#DailyRollupDataPoint)
  - [JSON representation](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#DailyRollupDataPoint.SCHEMA_REPRESENTATION)
- [RestingHeartRatePersonalRangeRollupValue](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#RestingHeartRatePersonalRangeRollupValue)
  - [JSON representation](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#RestingHeartRatePersonalRangeRollupValue.SCHEMA_REPRESENTATION)
- [HeartRateVariabilityPersonalRangeRollupValue](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#HeartRateVariabilityPersonalRangeRollupValue)
  - [JSON representation](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#HeartRateVariabilityPersonalRangeRollupValue.SCHEMA_REPRESENTATION)
- [Examples](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#examples)
- [Try it!](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#try-it)

Roll up data points over civil time intervals for supported data types.

### HTTP request

`POST https://health.googleapis.com/v4/{parent=users/*/dataTypes/*}/dataPoints:dailyRollUp`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the [service error catalog](https://developers.google.com/health/reference/rest/v4/errors)

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. Parent data type of the Data Point collection. Format: `users/{user}/dataTypes/{dataType}`, e.g.: - `users/me/dataTypes/steps` - `users/me/dataTypes/distance` For a list of the supported data types see the `https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#DailyRollupDataPoint` union field. It takes the form `users/{user}/dataTypes/{datatype}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "range": { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#CivilTimeInterval`) }, "windowSizeDays": integer, "pageSize": integer, "pageToken": string, "dataSourceFamily": string } ``` |

| Fields ||
|---|---|
| `range` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#CivilTimeInterval`)`` Required. Closed-open range of data points that will be rolled up. The start time must be aligned with the aggregation window. The maximum range for `calories-in-heart-rate-zone`, `heart-rate`, `active-minutes` and `total-calories` is 14 days. The maximum range for all other data types is 90 days. |
| `windowSizeDays` | `integer` Optional. Aggregation window size, in number of days. Defaults to 1 if not specified. If the requested range is not an exact multiple of `windowSizeDays`, the final bucket chronologically will be truncated at the upper endpoint of the range and will cover a duration shorter than `windowSizeDays`. |
| `pageSize` | `integer` Optional. The maximum number of data points to return. If unspecified, at most 90 data points will be returned. The maximum page size is 90. For `calories-in-heart-rate-zone`, `heart-rate`, `active-minutes`, and `total-calories`, the default and maximum page size is 14. |
| `pageToken` | `string` Optional. The `nextPageToken` from a previous request, if any. All other request fields need to be the same as in the initial request when the page token is specified. |
| `dataSourceFamily` | `string` Optional. The data source family name to roll up. If empty, data points from all available data sources will be rolled up. Format: `users/me/dataSourceFamilies/{dataSourceFamily}` The supported values are: - `users/me/dataSourceFamilies/all-sources` - Default value. Includes data from all available data sources. - `users/me/dataSourceFamilies/google-wearables` - Includes data from Google and Fitbit tracker devices (such as Fitbit trackers and Pixel Watch). Excludes manually logged data. - `users/me/dataSourceFamilies/google-sources` - Includes first-party Google data, such as data from tracker devices, manually logged data, and Health Connect. - `users/me/dataSourceFamilies/self-sources` - Includes only the data the calling client wrote through this API, that is, data points whose data source was registered through this API with the same OAuth client ID as the caller. Callers that were only granted write scopes for the requested data type may only read the data they wrote themselves: their requests are implicitly restricted to `self-sources`, and requesting any other data source family fails with `PERMISSION_DENIED`. If no data point matches the requested data source family, the response is an empty list rather than an error. |

### Response body

Response containing the list of rolled up data points.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "rollupDataPoints": [ { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#DailyRollupDataPoint`) } ] } ``` |

| Fields ||
|---|---|
| `rollupDataPoints[]` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#DailyRollupDataPoint`)`` Values for each aggregation time window. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.location.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.nutrition.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.sleep.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.reproductive_health.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.logged_symptoms.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.mindfulness.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.ecg.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.irn.readonly`
- `
  https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly`
- `
  https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.writeonly`
- `
  https://www.googleapis.com/auth/googlehealth.nutrition.writeonly`
- `
  https://www.googleapis.com/auth/googlehealth.sleep.writeonly`
- `
  https://www.googleapis.com/auth/googlehealth.reproductive_health.writeonly`
- `
  https://www.googleapis.com/auth/googlehealth.logged_symptoms.writeonly`
- `
  https://www.googleapis.com/auth/googlehealth.mindfulness.writeonly`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).

## CivilTimeInterval

Counterpart of `https://developers.google.com/health/reference/rest/Shared.Types/Interval`, but using `https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`.

| JSON representation |
|---|
| ``` { "start": { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`) }, "end": { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`) } } ``` |

| Fields ||
|---|---|
| `start` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`)`` Required. The inclusive start of the range. |
| `end` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`)`` Required. The exclusive end of the range. |

## DailyRollupDataPoint

Value of a daily rollup for a single civil time interval (aggregation window) of reconciled data points from all data sources, excluding those data points that are identified as recorded by wearables in intervals when they were not actually worn.

| JSON representation |
|---|
| ``` { "civilStartTime": { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`) }, "civilEndTime": { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "steps": { object (`https://developers.google.com/health/reference/rest/v4/StepsRollupValue`) }, "floors": { object (`https://developers.google.com/health/reference/rest/v4/FloorsRollupValue`) }, "heartRate": { object (`https://developers.google.com/health/reference/rest/v4/HeartRateRollupValue`) }, "restingHeartRatePersonalRange": { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#RestingHeartRatePersonalRangeRollupValue`) }, "heartRateVariabilityPersonalRange": { object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#HeartRateVariabilityPersonalRangeRollupValue`) }, "weight": { object (`https://developers.google.com/health/reference/rest/v4/WeightRollupValue`) }, "altitude": { object (`https://developers.google.com/health/reference/rest/v4/AltitudeRollupValue`) }, "distance": { object (`https://developers.google.com/health/reference/rest/v4/DistanceRollupValue`) }, "bodyFat": { object (`https://developers.google.com/health/reference/rest/v4/BodyFatRollupValue`) }, "totalCalories": { object (`https://developers.google.com/health/reference/rest/v4/TotalCaloriesRollupValue`) }, "activeZoneMinutes": { object (`https://developers.google.com/health/reference/rest/v4/ActiveZoneMinutesRollupValue`) }, "sedentaryPeriod": { object (`https://developers.google.com/health/reference/rest/v4/SedentaryPeriodRollupValue`) }, "runVo2Max": { object (`https://developers.google.com/health/reference/rest/v4/RunVO2MaxRollupValue`) }, "caloriesInHeartRateZone": { object (`https://developers.google.com/health/reference/rest/v4/CaloriesInHeartRateZoneRollupValue`) }, "activityLevel": { object (`https://developers.google.com/health/reference/rest/v4/ActivityLevelRollupValue`) }, "nutritionLog": { object (`https://developers.google.com/health/reference/rest/v4/NutritionLogRollupValue`) }, "hydrationLog": { object (`https://developers.google.com/health/reference/rest/v4/HydrationLogRollupValue`) }, "timeInHeartRateZone": { object (`https://developers.google.com/health/reference/rest/v4/TimeInHeartRateZoneRollupValue`) }, "activeMinutes": { object (`https://developers.google.com/health/reference/rest/v4/ActiveMinutesRollupValue`) }, "swimLengthsData": { object (`https://developers.google.com/health/reference/rest/v4/SwimLengthsDataRollupValue`) }, "coreBodyTemperature": { object (`https://developers.google.com/health/reference/rest/v4/CoreBodyTemperatureRollupValue`) }, "activeEnergyBurned": { object (`https://developers.google.com/health/reference/rest/v4/ActiveEnergyBurnedRollupValue`) }, "bloodGlucose": { object (`https://developers.google.com/health/reference/rest/v4/BloodGlucoseRollupValue`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `civilStartTime` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`)`` Start time of the window this value aggregates over |
| `civilEndTime` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints#CivilDateTime`)`` End time of the window this value aggregates over |
| Outcome of a rollup of the requested roll-up type. `{RollUpType}RollupValue` messages for each data type contain aggregated values for all supported fields. The field names usually follow the format `{original_field_name}_{aggregation_function}`. For example: `confidence_min`, `confidence_sum`. If there were no manual, on-wrist data points in this interval, the value will not be set. When the value is set, but the data shows zero, e.g. `steps.count_sum = 0`, it means that a device was worn but it did not record any data points for this data type. These messages represent the aggregated data payload for each data type and are embedded within the `DailyRollupDataPoint`. They are not standalone resources themselves. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `steps` | ``object (`https://developers.google.com/health/reference/rest/v4/StepsRollupValue`)`` Returned by default when rolling up data points from the `steps` data type, or when requested explicitly using the `steps` rollup type identifier. |
| `floors` | ``object (`https://developers.google.com/health/reference/rest/v4/FloorsRollupValue`)`` Returned by default when rolling up data points from the `floors` data type, or when requested explicitly using the `floors` rollup type identifier. |
| `heartRate` | ``object (`https://developers.google.com/health/reference/rest/v4/HeartRateRollupValue`)`` Returned by default when rolling up data points from the `heart-rate` data type, or when requested explicitly using the `heart-rate` rollup type identifier. |
| `restingHeartRatePersonalRange` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#RestingHeartRatePersonalRangeRollupValue`)`` Returned by default when rolling up data points from the `daily-resting-heart-rate` data type, or when requested explicitly using the `resting-heart-rate-personal-range` rollup type identifier. |
| `heartRateVariabilityPersonalRange` | ``object (`https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints/dailyRollUp#HeartRateVariabilityPersonalRangeRollupValue`)`` Returned by default when rolling up data points from the `daily-heart-rate-variability` data type, or when requested explicitly using the `heart-rate-variability-personal-range` rollup type identifier. |
| `weight` | ``object (`https://developers.google.com/health/reference/rest/v4/WeightRollupValue`)`` Returned by default when rolling up data points from the `weight` data type, or when requested explicitly using the `weight` rollup type identifier. |
| `altitude` | ``object (`https://developers.google.com/health/reference/rest/v4/AltitudeRollupValue`)`` Returned by default when rolling up data points from the `altitude` data type, or when requested explicitly using the `altitude` rollup type identifier. |
| `distance` | ``object (`https://developers.google.com/health/reference/rest/v4/DistanceRollupValue`)`` Returned by default when rolling up data points from the `distance` data type, or when requested explicitly using the `distance` rollup type identifier. |
| `bodyFat` | ``object (`https://developers.google.com/health/reference/rest/v4/BodyFatRollupValue`)`` Returned by default when rolling up data points from the `body-fat` data type, or when requested explicitly using the `body-fat` rollup type identifier. |
| `totalCalories` | ``object (`https://developers.google.com/health/reference/rest/v4/TotalCaloriesRollupValue`)`` Returned by default when rolling up data points from the `total-calories` data type, or when requested explicitly using the `total-calories` rollup type identifier. |
| `activeZoneMinutes` | ``object (`https://developers.google.com/health/reference/rest/v4/ActiveZoneMinutesRollupValue`)`` Returned by default when rolling up data points from the `active-zone-minutes` data type, or when requested explicitly using the `active-zone-minutes` rollup type identifier. |
| `sedentaryPeriod` | ``object (`https://developers.google.com/health/reference/rest/v4/SedentaryPeriodRollupValue`)`` Returned by default when rolling up data points from the `sedentary-period` data type, or when requested explicitly using the `sedentary-period` rollup type identifier. |
| `runVo2Max` | ``object (`https://developers.google.com/health/reference/rest/v4/RunVO2MaxRollupValue`)`` Returned by default when rolling up data points from the `run-vo2-max` data type, or when requested explicitly using the `run-vo2-max` rollup type identifier. |
| `caloriesInHeartRateZone` | ``object (`https://developers.google.com/health/reference/rest/v4/CaloriesInHeartRateZoneRollupValue`)`` Returned by default when rolling up data points from the `calories-in-heart-rate-zone` data type, or when requested explicitly using the `calories-in-heart-rate-zone` rollup type identifier. |
| `activityLevel` | ``object (`https://developers.google.com/health/reference/rest/v4/ActivityLevelRollupValue`)`` Returned by default when rolling up data points from the `activity-level` data type, or when requested explicitly using the `activity-level` rollup type identifier. |
| `nutritionLog` | ``object (`https://developers.google.com/health/reference/rest/v4/NutritionLogRollupValue`)`` Returned by default when rolling up data points from the `nutrition-log` data type, or when requested explicitly using the `nutrition-log` rollup type identifier. |
| `hydrationLog` | ``object (`https://developers.google.com/health/reference/rest/v4/HydrationLogRollupValue`)`` Returned by default when rolling up data points from the `hydration-log` data type, or when requested explicitly using the `hydration-log` rollup type identifier. |
| `timeInHeartRateZone` | ``object (`https://developers.google.com/health/reference/rest/v4/TimeInHeartRateZoneRollupValue`)`` Returned by default when rolling up data points from the `time-in-heart-rate-zone` data type, or when requested explicitly using the `time-in-heart-rate-zone` rollup type identifier. |
| `activeMinutes` | ``object (`https://developers.google.com/health/reference/rest/v4/ActiveMinutesRollupValue`)`` Returned by default when rolling up data points from the `active-minutes` data type, or when requested explicitly using the `active-minutes` rollup type identifier. |
| `swimLengthsData` | ``object (`https://developers.google.com/health/reference/rest/v4/SwimLengthsDataRollupValue`)`` Returned by default when rolling up data points from the `swim-lengths-data` data type, or when requested explicitly using the `swim-lengths-data` rollup type identifier. |
| `coreBodyTemperature` | ``object (`https://developers.google.com/health/reference/rest/v4/CoreBodyTemperatureRollupValue`)`` Returned by default when rolling up data points from the `core-body-temperature` data type, or when requested explicitly using the `core-body-temperature` rollup type identifier. |
| `activeEnergyBurned` | ``object (`https://developers.google.com/health/reference/rest/v4/ActiveEnergyBurnedRollupValue`)`` Returned by default when rolling up data points from the `active-energy-burned` data type. |
| `bloodGlucose` | ``object (`https://developers.google.com/health/reference/rest/v4/BloodGlucoseRollupValue`)`` Returned by default when rolling up data points from the `blood-glucose` data type. |
| End of mutually exclusive fields. ||

## RestingHeartRatePersonalRangeRollupValue

Represents the rollup value for the daily resting heart rate data type.

| JSON representation |
|---|
| ``` { "beatsPerMinuteMin": number, "beatsPerMinuteMax": number } ``` |

| Fields ||
|---|---|
| `beatsPerMinuteMin` | `number` The lower bound of the user's daily resting heart rate personal range. |
| `beatsPerMinuteMax` | `number` The upper bound of the user's daily resting heart rate personal range. |

## HeartRateVariabilityPersonalRangeRollupValue

Represents the result of the rollup of the user's daily heart rate variability personal range.

| JSON representation |
|---|
| ``` { "averageHeartRateVariabilityMillisecondsMin": number, "averageHeartRateVariabilityMillisecondsMax": number } ``` |

| Fields ||
|---|---|
| `averageHeartRateVariabilityMillisecondsMin` | `number` The lower bound of the user's average heart rate variability personal range. |
| `averageHeartRateVariabilityMillisecondsMax` | `number` The upper bound of the user's average heart rate variability personal range. |