Docs

Sleep sessions

Rate nights good or bad

Rates your own nights as good or bad (the session ids come from get_insights).

POST
/v1/sleep-sessions/ratings

Send session_id (one) or session_ids (several) with one rating. Each id gets its own result { session_id, ok, status }: status rated, not_found (not one of your nights) or deleted.

Request parameters

Headers
Authorization string required

Your API key as a bearer token: Bearer os_…. Make one on the API keys page; see Authentication.

Body application/json
  • rating enum<string> required

    good or bad

    Possible values: good bad

  • session_id string (uuid)

    One night: a session_id from get_insights.

  • session_ids string[] (uuid) min items 1max items 200

    Several nights: session_ids from get_insights.

Response parameters

200 OK application/json
  • results object[] required

Errors

Every error answers { "error": { "code", "message" } }.

StatusCodeMeaning
400invalidInvalid input.
401unauthorizedMissing or unsupported API key.
403forbiddenNot allowed on this device or user.
429rate_limitedRate limit exceeded.
503unavailableNot available for this account.
Also an MCP tool: rate_sleep_sessions