Get Sleep Totals
Changed onReturns the count, naps, time asleep, time in bed and mean efficiency of the sessions.
The same filters as the sleep list, so it adds up exactly what that would page through.
Added up in the database, so it covers every matching session however many there are, without paging through them.
Request
- Base URL: https://api.openwearables.io (the document declares no server; this is the origin it was published from)
- URL: https://api.openwearables.io/api/v1/users/{user_id}/events/sleep/totals
- Auth: OAuth 2 (password, token URL /api/v1/auth/login)
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.
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
Response
Successful Response
Example response
{
"count": 30,
"naps": 4,
"sleep_duration_seconds": 799200,
"time_in_bed_seconds": 871200,
"avg_efficiency_percent": 91.4
}Changes
- info
endpoint added
- info