v3

latestOpenAPI 3.1.02026-07-31121144224.9 KB
External: Events

List Sleep Sessions

Returns sleep sessions (including naps).

get/api/v1/users/{user_id}/events/sleep

Path parameters

user_idstring uuid required

Query parameters

start_datestring date-time required

ISO 8601 datetime (e.g. 2023-11-07T05:31:56Z) or Unix timestamp in seconds. Date-only strings (e.g. 2023-11-07) are also accepted and normalized to midnight UTC.

Example:2023-11-07T05:31:56Z

ISO 8601 datetime (e.g. 2023-11-07T05:31:56Z) or Unix timestamp in seconds. Date-only strings (e.g. 2023-11-07) are also accepted and normalized to midnight UTC.

end_datestring date-time required

ISO 8601 datetime (e.g. 2023-11-07T05:31:56Z) or Unix timestamp in seconds. Date-only strings (e.g. 2023-11-07) are also accepted and normalized to midnight UTC.

Example:2023-11-07T05:31:56Z

ISO 8601 datetime (e.g. 2023-11-07T05:31:56Z) or Unix timestamp in seconds. Date-only strings (e.g. 2023-11-07) are also accepted and normalized to midnight UTC.

cursorstring nullable
limitinteger
filter_by_priorityboolean

When true, keep only the highest-priority source's sessions per sleep date (provider/device priority, same ranking as summaries). Defaults to false for backwards compatibility.

When true, keep only the highest-priority source's sessions per sleep date (provider/device priority, same ranking as summaries). Defaults to false for backwards compatibility.

Headers

X-Open-Wearables-API-Keystring nullable

Response

Successful Response

Example response

{
  "data": [
    {
      "source": {
        "provider": "apple_health",
        "device": "Apple Watch Series 9"
      }
    }
  ],
  "pagination": {
    "next_cursor": "eyJpZCI6IjEyMzQ1Njc4OTAiLCJ0cyI6MTcwNDA2NzIwMH0",
    "total_count": 150
  }
}