Skip to content

Multiple Sleep Time Documents

GET
/v2/usercollection/sleep_time
curl --location --request GET 'https://api.ouraring.com/v2/usercollection/sleep_time?start_date=2021-11-01&end_date=2021-12-01&fields=day,score' \
--header 'Authorization: Bearer <token>'
start_date
Start Date
string format: date
end_date
End Date
string format: date
next_token
Any of:
string
fields
Any of:
string

Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.

Successful Response

Media typeapplication/json
MultiDocumentResponse[PublicSleepTime]
object
data
required
Data
Array<object>
PublicSleepTime

Suggested bedtime for the user.

object
id
required

Unique identifier of the object.

string
>= 1 characters
day
required

Corresponding day for the sleep time.

string
optimal_bedtime
Any of:
PublicSleepTimeWindow

Object defining sleep time window

object
day_tz
required

Timezone offset in second from GMT of the day

integer
end_offset
required

End offset from midnight in second

integer
start_offset
required

Start offset from midnight in second

integer
recommendation
Any of:
PublicSleepTimeRecommendation

Possible public SleepTime recommendation.

string
Allowed values: improve_efficiency earlier_bedtime later_bedtime earlier_wake_up_time later_wake_up_time follow_optimal_bedtime
status
Any of:
PublicSleepTimeStatus

Possible public SleepTime status.

string
Allowed values: not_enough_nights not_enough_recent_nights bad_sleep_quality only_recommended_found optimal_found
next_token
required
Any of:
string
Example
{
"data": [
{
"recommendation": "improve_efficiency",
"status": "not_enough_nights"
}
]
}

Client Exception

Unauthorized access exception. Usually means the access token is expired, malformed or revoked.

Access forbidden. Usually means the user’s subscription to Oura has expired and their data is not available via the API.

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}

Request Rate Limit Exceeded.