List Sleep Sessions
Changed onReturns sleep sessions (including naps).
Request
- Base URLhttps://api.openwearables.io (the document declares no server; this is the origin it was published from)
- AuthOAuth 2PasswordToken URL/api/v1/auth/login
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Query parameters
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 cover the whole day, so a date-only range includes both boundary days.
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 cover the whole day, so a date-only range includes both boundary days.
Supported data providers.
When true, return only naps; when false, only main sleep. Omit to return both.
all returns every source's sessions. per_session drops a session when the sessions of one source ranked higher by provider, then device type priority, cover at least SESSION_DUPLICATE_OVERLAP of it (default 0.5); sessions nothing better covers stay, and equally ranked sources never hide each other. Source filters narrow which sessions compete. Defaults to all.
Same as source_selection=per_session.
Headers
Response
Successful Response
Example response
{
"data": [
{
"source": {
"provider": "apple",
"source": "Connect",
"device": "iPhone15,2",
"device_id": "R9ZW30ABC12"
},
"duration_seconds": 28800,
"sleep_duration_seconds": 25800,
"time_in_bed_seconds": 28200,
"is_final": true
}
],
"pagination": {
"next_cursor": "eyJpZCI6IjEyMzQ1Njc4OTAiLCJ0cyI6MTcwNDA2NzIwMH0",
"total_count": 150
}
}Changes
- info
added the required property
//to the response with the status
- info
- breaking
the
response's property type changed fromarraytostringfor status - info
media type
application/jsonwas changed to a more specific media typeapplication/problem+jsonfor the response status - info
the response property
became required for the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- breaking