Docs

Schedules

Revert one night's changes

Takes a night's own values away (tonight by default, or a later sleep_day), so it follows the weekly schedule again.

DELETE
/v1/schedules/nights

No-op when the night has none. Returns the user's schedule after the change.

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
  • sleep_day string pattern ^\d{4}-\d{2}-\d{2}$

    The sleep day (YYYY-MM-DD, the date the night starts in the bed's timezone): today or later. Defaults to tonight (the today of get_sleep_schedules).

  • user_id string (uuid)

    Whose schedule (from list_devices shared_with). Defaults to you. Editing another user needs the owner or admin role on a shared bed.

Response parameters

200 OK application/json
  • schedules record<string, object> required

    Keyed by user id

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: revert_sleep_schedule_override