Sleep

GET /v2/activity/sleep

Changed on

Get all sleeps for a user, paginated. Results are sorted by start time in descending order.

Request

Query parameters

limitinteger

Limit on the number of sleeps returned

startstring date-time

Return sleeps that occurred after or during (inclusive) this time. If not specified, the response will not filter sleeps by a minimum time.

endstring date-time

Return sleeps that intersect this time or ended before (exclusive) this time. If not specified, end will be set to now.

nextTokenstring

Optional next token from the previous response to get the next page. If not provided, the first page in the collection is returned

Response

Successful request

next_tokenstring

A token that can be used on the next request to access the next page of records. If the token is not present, there are no more records in the collection.

Example response

{
  "records": [
    {
      "id": "ecfc6a15-4661-442f-a9a4-f160dd7afae8",
      "cycle_id": 93845,
      "v1_id": 93845,
      "user_id": 10129,
      "created_at": "2022-04-24T11:25:44.774Z",
      "updated_at": "2022-04-24T14:25:44.774Z",
      "start": "2022-04-24T02:25:44.774Z",
      "end": "2022-04-24T10:25:44.774Z",
      "timezone_offset": "-05:00",
      "score_state": "SCORED",
      "score": {
        "stage_summary": {
          "total_in_bed_time_milli": 30272735,
          "total_awake_time_milli": 1403507,
          "total_light_sleep_time_milli": 14905851,
          "total_slow_wave_sleep_time_milli": 6630370,
          "total_rem_sleep_time_milli": 5879573,
          "sleep_cycle_count": 3,
          "disturbance_count": 12
        },
        "sleep_needed": {
          "baseline_milli": 27395716,
          "need_from_sleep_debt_milli": 352230,
          "need_from_recent_strain_milli": 208595,
          "need_from_recent_nap_milli": -12312
        },
        "respiratory_rate": 16.11328125,
        "sleep_performance_percentage": 98,
        "sleep_consistency_percentage": 90,
        "sleep_efficiency_percentage": 91.69533848
      }
    }
  ],
  "next_token": "MTIzOjEyMzEyMw"
}

Changes