Skip to content
AF
Google Health API reference

Sleep: the Google Health API sleep data type

Read from Google’s documentation on 2026-10-17 · discovery document revision 20261014 · Google’s data-types page last updated 2026-10-06

Sleep (sleep) is a Session data type in the Google Health API. Google's data-types table lists list, get, reconcile, create, update and batchDelete for it under the .sleep.readonly and .sleep.writeonly scopes. The table marks it with webhook support. Google's Fitbit migration table maps the Fitbit Web API's Sleep data to it.

Sleep at a glance

From the Sleep row of Google’s data-types table, joined to the discovery document’s DataPoint schema.

Display name
Sleep
dataType (in endpoint URLs)
sleep
filter parameter
sleepGoogle: “The identifier separated by underscores (for example, active_minutes) used as the value for the dataType filter parameter in daily rollup and rollup requests.”
Record type
Session — Google: “Represents a continuous block of recording, such as a workout or an electrocardiogram (ECG) session.”
Storage resolution
not stated in Google’s table
Webhook support
Yes · automatic-subscription token WEBHOOK_DATA_TYPE_SLEEP
True zeros support
Not marked in Google’s table
Channel
v4
DataPoint field
DataPoint.sleep → SleepIts description: “Optional. Data for points in the sleep session data type collection.”
Compatible devices
27 in Google’s table

Operations and request paths

The operations Google’s table lists for sleep, each matched to its users.dataTypes.dataPoints method in the discovery document. The path is the documented path template (the method’s flatPath on https://health.googleapis.com/) with {dataTypesId} filled in as sleep. Google on {user}: “The {user} can be either the alias me or the authenticated user's numeric Health User ID (retrieved via GetIdentity).”

Table listsMethodDocumented path template
listlistGET https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints
getgetGET https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints/{dataPointsId}
reconcilereconcileGET https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints:reconcile
createcreatePOST https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints
updatepatchvia Google’s endpoint-mapping table (flagged below)PATCH https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints/{dataPointsId}
batchDeletebatchDeletePOST https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints:batchDelete

Every method, and how many of the data types list it: the methods overview.

Scopes

The scopes Google’s table lists for sleep, as full URLs, with the consent text Google’s Scopes page gives each. Every Google Health API scope.

ScopeAccessGoogle’s permission text
https://www.googleapis.com/auth/googlehealth.sleep.readonlyreadSee your Google Health sleep data.
https://www.googleapis.com/auth/googlehealth.sleep.writeonlywriteAdd sleep data to Google Health, and edit or delete the data it adds.

Fields of Sleep

The schema the discovery document gives DataPoint.sleep, required fields first. Types are as the discovery document states them; the label is the word Google’s description opens with. The schemas its fields refer to follow, one level deep.

Sleep — Google: “A sleep session possibly including stages.”

FieldTypeGoogle’s description
intervalRequiredSessionTimeIntervalRequired. Observed sleep interval.
createTimeOutput onlystring/google-datetimeOutput only. Creation time of this sleep observation.
metadataOptionalSleepMetadataOptional. Sleep metadata: processed, main_sleep, manually_edited, and stages_status.
outOfBedSegmentsOptionalarray<OutOfBedSegment>Optional. “Out of bed” segments that can overlap with sleep stages.
shortAwakeningsOutput onlyarray<SleepStage>Output only. List of short awake segments (under a set threshold) that are part of the sleep session. These can overlap with sleep stages.
stagesOptionalarray<SleepStage>Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.
summaryOutput onlySleepSummaryOutput only. Sleep summary: metrics and stages summary.
typeOptionalstringOptional. SleepType: classic or stages.
  • SLEEP_TYPE_UNSPECIFIED — Sleep type is unspecified.
  • CLASSIC — Classic sleep is a sleep with 3 stages types: AWAKE, RESTLESS and ASLEEP.
  • STAGES — On top of "classic" sleep stages an additional processing pass can calculate stages more precisely, overwriting the prior stages with AWAKE, LIGHT, REM and DEEP.
updateTimeOutput onlystring/google-datetimeOutput only. Last update time of this sleep observation.

SessionTimeInterval

Google: “Represents a time interval of session data point, which bundles multiple observed metrics together.”

FieldTypeGoogle’s description
endTimeRequiredstring/google-datetimeRequired. The end time of the observed session.
endUtcOffsetRequiredstring/google-durationRequired. The offset of the user's local time at the end of the session relative to the Coordinated Universal Time (UTC).
startTimeRequiredstring/google-datetimeRequired. The start time of the observed session.
startUtcOffsetRequiredstring/google-durationRequired. The offset of the user's local time at the start of the session relative to the Coordinated Universal Time (UTC).
civilEndTimeOutput onlyCivilDateTimeOutput only. Session end time in civil time in the timezone the subject is in at the end of the session.
civilStartTimeOutput onlyCivilDateTimeOutput only. Session start time in civil time in the timezone the subject is in at the start of the session.

SleepMetadata

Google: “Additional information about how the sleep was processed.”

FieldTypeGoogle’s description
externalIdOptionalstringOptional. Sleep identifier relevant in the context of the data source.
mainSleepOutput onlybooleanOutput only. main_sleep: the longest sleep session with stages within one day. If no sleep session has stages, then the longest sleep is the main_sleep. If there are multiple days of sleep in the response, there is one main_sleep per day.
manuallyEditedOutput onlybooleanOutput only. Some sleeps autodetected by algorithms can be manually edited by users.
napOutput onlybooleanOutput only. Naps are sleeps without stages and relatively short durations.
processedOutput onlybooleanOutput only. Sleep and sleep stages algorithms finished processing. A true value indicates whether all data processing for the session is complete. A false value means sleep period is detected but sleep stages is still processing.
stagesStatusOutput onlystringOutput only. Sleep stages algorithm processing status.
  • STAGES_STATE_UNSPECIFIED — Output only. Sleep stages status is unspecified.
  • REJECTED_COVERAGE — Output only. Sleep stages cannot be computed due to low RR coverage.
  • REJECTED_MAX_GAP — Output only. Sleep stages cannot be computed due to the large middle gap (2h).
  • REJECTED_START_GAP — Output only. Sleep stages cannot be computed due to the large start gap (1h).
  • REJECTED_END_GAP — Output only. Sleep stages cannot be computed due to the large end gap (1h).
  • REJECTED_NAP — Output only. Sleep stages cannot be computed because the sleep log is a nap (has < 3h duration).
  • REJECTED_SERVER — Output only. Sleep stages cannot be computed because input data is not available (PPGV2, wake magnitude, etc).
  • TIMEOUT — Output only. Sleep stages cannot be computed due to server timeout.
  • SUCCEEDED — Output only. Sleep stages successfully computed.
  • PROCESSING_INTERNAL_ERROR — Output only. Sleep stages cannot be computed due to server internal error.

OutOfBedSegment

Google: “A time interval to represent an out-of-bed segment.”

FieldTypeGoogle’s description
endTimeRequiredstring/google-datetimeRequired. Segment end time.
endUtcOffsetRequiredstring/google-durationRequired. The offset of the user's local time at the end of the segment relative to the Coordinated Universal Time (UTC).
startTimeRequiredstring/google-datetimeRequired. Segment tart time.
startUtcOffsetRequiredstring/google-durationRequired. The offset of the user's local time at the start of the segment relative to the Coordinated Universal Time (UTC).

SleepStage

Google: “Sleep stage segment.”

FieldTypeGoogle’s description
endTimeRequiredstring/google-datetimeRequired. Sleep stage end time.
endUtcOffsetRequiredstring/google-durationRequired. The offset of the user's local time at the end of the sleep stage relative to the Coordinated Universal Time (UTC).
startTimeRequiredstring/google-datetimeRequired. Sleep stage start time.
startUtcOffsetRequiredstring/google-durationRequired. The offset of the user's local time at the start of the sleep stage relative to the Coordinated Universal Time (UTC).
typeRequiredstringRequired. Sleep stage type: AWAKE, DEEP, REM, LIGHT etc.
  • SLEEP_STAGE_TYPE_UNSPECIFIED — The default unset value.
  • AWAKE — Sleep stage AWAKE.
  • LIGHT — Sleep stage LIGHT.
  • DEEP — Sleep stage DEEP.
  • REM — Sleep stage REM.
  • ASLEEP — Sleep stage ASLEEP.
  • RESTLESS — Sleep stage RESTLESS.
createTimeOutput onlystring/google-datetimeOutput only. Creation time of this sleep stages segment.
updateTimeOutput onlystring/google-datetimeOutput only. Last update time of this sleep stages segment.

SleepSummary

Google: “ Sleep summary: metrics and stages summary.”

FieldTypeGoogle’s description
minutesAfterWakeUpOutput onlystring/int64Output only. Minutes after wake up calculated by restlessness algorithm.
minutesAsleepOutput onlystring/int64Output only. Total number of minutes asleep. For classic sleep it is the sum of ASLEEP stages (excluding AWAKE and RESTLESS). For "stages" sleep it is the sum of LIGHT, REM and DEEP stages (excluding AWAKE).
minutesAwakeOutput onlystring/int64Output only. Total number of minutes awake. It is a sum of all AWAKE stages.
minutesInSleepPeriodOutput onlystring/int64Output only. Delta between wake time and bedtime. It is the sum of all stages.
minutesToFallAsleepOutput onlystring/int64Output only. Minutes to fall asleep calculated by restlessness algorithm.
stagesSummaryOutput onlyarray<StageSummary>Output only. List of summaries (total duration and segment count) per each sleep stage type.

Fitbit Web API predecessor

Google’s Fitbit Web API → Google Health API data-type table maps Sleep to sleep.

Fitbit Web API scopes Google maps to sleep’s scopes: sleep.

Google’s full Fitbit Web API mapping tables · the migration playbook

Where Google’s guides name sleep

  • “Variable page sizes: Capping limits depend on the endpoint and data type. For most data types, page sizes are capped at a maximum of 10,000. However, for certain data types like exercise and sleep, the default and maximum page size is capped at 25. For example, if a client requests all sleep data for the past 10 years, the API will still return only 25 sleep sessions on the first page.”Google's endpoints guide, “Query historical data”

Where Google’s pages disagree

Published as found, with the texts that disagree; nothing here is corrected by us.

  • Operation name differs

    The table lists "update" for sleep, but the discovery document has no method named update; Google's endpoint-mapping table points updates at patch.

    • Google's Fitbit migration API specifications: “CREATE & UPDATE Logs”
    • Google's Fitbit migration API specifications: “patch method”
    • the v4 discovery document: “Updates a single identifiable data point. If a data point with the specified name is not found, the request will fail.”

Compatible devices

The 27 devices Google’s table lists as able to record and sync sleep.

  • Fitbit Air
  • Fitbit Alta
  • Fitbit Alta HR
  • Fitbit Blaze
  • Fitbit Charge 2
  • Fitbit Charge 3
  • Fitbit Charge 4
  • Fitbit Charge 5
  • Fitbit Charge 6
  • Fitbit Flex 2
  • Fitbit Inspire
  • Fitbit Inspire 2
  • Fitbit Inspire 3
  • Fitbit Inspire HR
  • Fitbit Ionic
  • Fitbit Luxe
  • Pixel Watch
  • Pixel Watch 2
  • Pixel Watch 3
  • Pixel Watch 4
  • Fitbit Sense
  • Fitbit Sense 2
  • Fitbit Versa
  • Fitbit Versa 2
  • Fitbit Versa 3
  • Fitbit Versa 4
  • Fitbit Versa Lite

Google’s documentation

Related on this site

Questions

Which OAuth scopes does the Google Health API sleep data type need?

Google's data-types table (read 2026-10-17) lists https://www.googleapis.com/auth/googlehealth.sleep.readonly and https://www.googleapis.com/auth/googlehealth.sleep.writeonly for sleep. The Scopes page's consent text: .sleep.readonly, "See your Google Health sleep data."; .sleep.writeonly, "Add sleep data to Google Health, and edit or delete the data it adds."

Can apps write sleep data to the Google Health API?

Yes. Google's data-types table lists create, update and batchDelete for sleep. create is POST https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints. The table's "update" has no method of that name in the discovery document; Google's endpoint-mapping table points updates at patch, which is PATCH https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints/{dataPointsId}. batchDelete is POST https://health.googleapis.com/v4/users/{usersId}/dataTypes/sleep/dataPoints:batchDelete. Writes need https://www.googleapis.com/auth/googlehealth.sleep.writeonly.

How do you aggregate sleep data with the Google Health API?

Not with rollUp or dailyRollUp, going by Google's data-types table: it lists only list, get, reconcile, create, update and batchDelete for sleep. Read the data points with list (or reconcile, where listed) and compute any summary yourself.

What did the Google Health API sleep data type replace in the Fitbit Web API?

Google's Fitbit Web API migration table maps the Fitbit Web API's "Sleep" to sleep. The Fitbit Web API scope Google maps to its scopes: sleep.

Sources checked

Google’s text is quoted for identification; each guide page’s footer reads: “Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.”. Generated from Google’s pages by scripts/fetch-google-health-api.mjs, not typed by hand; Google’s documentation remains the authority.

← All Google Health API data types