---
title: "Get User Sleep"
method: GET
path: "/v2/summary/sleep/{user_id}"
tags: ["summary"]
---

# Get User Sleep

`GET /v2/summary/sleep/{user_id}`

Get sleep summary for user_id

## Path parameters

- `user_id` string, uuid, required

## Query parameters

- `provider` string — Provider oura/strava etc
- `start_date` string, required — Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00
- `end_date` string, nullable — Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 23:59:59

## Response `200`

Successful Response

- ClientSleepResponse
  - `sleep` ClientFacingSleep[], required
    - `id` string, uuid, required
    - `user_id` string, uuid, required — User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api.
    - `date` string, date-time, required — Date of the specified record, formatted as ISO8601 datetime string in UTC 00:00. Deprecated in favour of calendar_date.
    - `calendar_date` string, date, required — Date of the sleep summary in the YYYY-mm-dd format. This generally matches the sleep end date.
    - `bedtime_start` string, date-time, required — UTC Time when the sleep period started
    - `bedtime_stop` string, date-time, required — UTC Time when the sleep period ended
    - `type` 'long_sleep' | 'short_sleep' | 'acknowledged_nap' | 'unknown', required — ℹ️ This enum is non-exhaustive.
    - `timezone_offset` integer, nullable — Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds
    - `duration` integer, required — Total duration of the sleep period (sleep.duration = sleep.bedtime_end - sleep.bedtime_start)::seconds
    - `total` integer, required — Total amount of sleep registered during the sleep period (sleep.total = sleep.rem + sleep.light + sleep.deep)::seconds
    - `awake` integer, required — Total amount of awake time registered during the sleep period::seconds
    - `light` integer, required — Total amount of light sleep registered during the sleep period::seconds
    - `rem` integer, required — Total amount of REM sleep registered during the sleep period, minutes::seconds
    - `deep` integer, required — Total amount of deep (N3) sleep registered during the sleep period::seconds
    - `score` integer, nullable — A value between 1 and 100 representing how well the user slept. Currently only available for Withings, Oura, Whoop and Garmin::scalar
    - `recovery_readiness_score` integer, nullable — A value between 0 and 100 representing the provider's recovery/readiness proxy. Currently sourced from Oura readiness score, Whoop recovery score, and Ultrahuman recovery::scalar
    - `hr_lowest` integer, nullable — The lowest heart rate (5 minutes sliding average) registered during the sleep period::beats per minute
    - `hr_average` integer, nullable — The average heart rate registered during the sleep period::beats per minute
    - `hr_resting` integer, nullable — Resting heart rate recorded during a sleep session::bpm
    - `efficiency` number, nullable — Sleep efficiency is the percentage of the sleep period spent asleep (100% * sleep.total / sleep.duration)::perc
    - `latency` integer, nullable — Detected latency from bedtime_start to the beginning of the first five minutes of persistent sleep::seconds
    - `temperature_delta` number, nullable — Skin temperature deviation from the long-term temperature average::celcius
    - `skin_temperature` number, nullable — The skin temperature::celcius
    - `hr_dip` number, nullable — Sleeping Heart Rate Dip is the percentage difference between your average waking heart rate and your average sleeping heart rate. In health studies, a greater "dip" is typically seen as a positive indicator of overall health. Currently only available for Garmin::perc
    - `state` 'tentative' | 'confirmed' — ℹ️ This enum is non-exhaustive.
    - `average_hrv` number, nullable — The average heart rate variability registered during the sleep period::rmssd
    - `respiratory_rate` number, nullable — Average respiratory rate::breaths per minute
    - `source` ClientFacingSource, required — Source summarizes where a sample or a summary is sourced from. At minimum, the source provider is always included.
      - `provider` string, required — Provider slug. e.g., `oura`, `fitbit`, `garmin`.
      - `type` string — The type of the data source (app or device) by which the summary or the timeseries data were recorded. This defaults to `unknown` when Vital cannot extract or infer that information
      - `app_id` string, nullable — The identifier of the app which recorded this summary. This is only applicable to multi-source providers like Apple Health and Android Health Connect.
      - `device_id` string, uuid, nullable — The identifier of the device which recorded this summary.
      - `sport` string, nullable — For workout stream timeseries, this is the standard sport slug of the workout with which the timeseries data are associated. For the `distance` timeseries, this is `wheelchair_pushing` if the user is a wheelchair user, or `null` otherwise. For all summary types and non-workout timeseries, this is always `null`.
      - `workout_id` string, uuid, nullable — For workout stream timeseries, this is the workout ID with which the timeseries data are associated. For all other types, this is always `null`.
      - `name` string — Deprecated. Subject to removal after 1 Jan 2024.
      - `slug` string — Deprecated. Use `provider` instead. Subject to removal after 1 Jan 2024.
      - `logo` string — Deprecated. Subject to removal after 1 Jan 2024.
    - `sleep_stream` ClientFacingSleepStream
      - `hrv` ClientFacingHRVTimeseries[], nullable
        - `id` integer, nullable — Deprecated
        - `timezone_offset` integer, nullable — Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
        - `type` string, nullable — Type is always null for this resource.
        - `unit` string, required — Measured in rmssd.
        - `timestamp` string, date-time, required — The timestamp of the measurement.
        - `value` number, required — HRV calculated using rmssd during sleep
      - `heartrate` ClientFacingHeartRateTimeseries[], nullable
        - `id` integer, nullable — Deprecated
        - `timezone_offset` integer, nullable — Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
        - `type` string, nullable — Type is always null for this resource.
        - `unit` string, required — Measured in bpm.
        - `timestamp` string, date-time, required — The timestamp of the measurement.
        - `value` number, required — Heart rate in bpm
      - `hypnogram` ClientFacingHypnogramTimeseries[], nullable
        - `id` integer, nullable — Deprecated
        - `timezone_offset` integer, nullable — Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
        - `type` string, nullable — Type is always null for this resource.
        - `unit` string, required — enum: 1: deep, 2: light, 3: rem, 4: awake, -1: missing_data.
        - `timestamp` string, date-time, required — Depracated. The start time (inclusive) of the interval.
        - `start` string, date-time, required — The start time (inclusive) of the interval.
        - `end` string, date-time, required — The end time (exclusive) of the interval.
        - `value` number, required — Hypnogram for sleep stages {"deep": 1, "light": 2, "rem": 3, "awake": 4, "manual": 5, "missing_data": -1}
      - `respiratory_rate` ClientFacingRespiratoryRateTimeseries[], nullable
        - `id` integer, nullable — Deprecated
        - `timezone_offset` integer, nullable — Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
        - `type` string, nullable — Type is always null for this resource.
        - `unit` string, required — Measured in bpm.
        - `timestamp` string, date-time, required — The timestamp of the measurement.
        - `value` number, required — Average respiratory rate::breaths per minute
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/tryvital/apis/junction-api.md) · [All operations](https://skmtc.net/tryvital/apis/junction-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryvital/junction-api/versions/d28f5cec7d79/schema)
