Sleep sessions (instance admin, one tenant)
GET /v1/users/{id}/sleep (listSleep) for the tenant of tenant_id, read with an
instance admin key: the same parameters and the same answer as the tenant's own key
gets. Read only. Recorded in the caller's audit log and, actor admin, in the tenant's.
See docs/admin-api.md.
tenantKeyAuthorizationBearer <token>Tenant API key, ohs_sk_ + 43 base62 characters.
tenant_id*stringThe id of a tenant; any other value is a 404.
uuidid*stringuuidstart?|Inclusive lower bound, RFC 3339 or YYYY-MM-DD.
end?|Exclusive upper bound, RFC 3339 or YYYY-MM-DD. Must not be before start.
view?stringmerged (the default): when several sources recorded the same thing (a ring and a
watch the same night, a phone and a watch the same steps, one sample directly and
through an aggregator), only the best ranked source's record is listed, so nothing
counts twice. The order of sources is the user's (see source-priorities). all:
every stored record of every source.
"merged""merged""all"cursor?stringThe next_cursor of the previous page.
limit?integer1 <= value <= 1000100One page, by bedtime_start.
application/json- response
data*array<>next_cursor*|Null on the last page.
curl -X GET 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/sleep' \ -H 'Authorization: Bearer ohs_sk_...'{ "next_cursor": "string", "data": [ { "provider": "string", "source": "string", "device": "string", "ingested_at": "2019-08-24T14:15:22Z", "id": 0, "bedtime_start": "2019-08-24T14:15:22Z", "bedtime_end": "2019-08-24T14:15:22Z", "total_sleep_seconds": 0, "deep_sleep_seconds": 0, "rem_sleep_seconds": 0, "light_sleep_seconds": 0, "awake_seconds": 0, "sleep_score": 0, "hrv_avg_ms": 0, "resting_hr": 0, "respiratory_rate": 0, "spo2_avg": 0, "external_id": "string", "metadata": {} } ]}