API Documentation

Ideal bedtime

Ideal bedtime is an optimal bedtime window that is calculated based on your sleep data.

If you're new to Oura, it will take a few weeks to receive your first ideal bedtime window. Having an irregular sleep schedule may also result in missing ideal bedtime data.

Note: it is not guaranteed that an ideal bedtime window is calculated for every day. Days may be missing in the requested period.

Example data

{
  "ideal_bedtimes": [
    {
      "date": "2020-03-17",
      "bedtime_window": {
        "start": -3600,
        "end": 0
      },
      "status": "IDEAL_BEDTIME_AVAILABLE"
    },
    {
      "date": "2020-03-18",
      "bedtime_window": {
        "start": null,
        "end": null
      },
      "status": "LOW_SLEEP_SCORES"
    }
  ]
}

https://api.ouraring.com/v1/bedtime?start=YYYY-MM-DD&end=YYYY-MM-DD

The start and end date (inclusive) define the period for the requested data period. If you omit the start date, it will be set to one week ago. If you omit the end date, it will be set to the current day.

Fields

date

  • Type: String
  • Format: YYYY-MM-DD

Date for which the ideal bedtime window was calculated

bedtime_window.start

  • Type: Int or null
  • Unit: seconds
  • Range: -43200 – 43200, or null if not available

The beginning of the ideal bedtime window. The number represents an offset in seconds relative to midnight. A negative number is before midnight and a positive number is after midnight.

bedtime_window.end

  • Type: Int or null
  • Unit: seconds
  • Range: -43200 – 43200, or null if not available

The end of the ideal bedtime window. The number represents an offset in seconds relative to midnight. A negative number is before midnight and a positive number is after midnight.

status

  • Type: String

The status indicates whether an ideal bedtime window is available and a reason if not.

  • NOT_ENOUGH_DATA: Not enough data to calculate an ideal bedtime
  • LOW_SLEEP_SCORES: Your sleep has been too irregular to calculate an ideal bedtime
  • IDEAL_BEDTIME_AVAILABLE: Bedtime guidance was calculated