Schedules
Update recurring sleep schedules
Changes the RECURRING weekly schedule — the lasting way to change nightly behavior (e.g. "bedtime temperature 18°C every night" → one week entry per day, each with phases [{ phase: "bedtime", temp_c: 18 }]).
Send only the days and fields that change; unlisted days stay as they are. A night has four phases, in time order and named as the Orion app shows them: bedtime, night, dawn and alarm. Each phase is { phase: "bedtime" | "night" | "dawn" | "alarm", time?: "HH:MM", temp_c?: number, remove?: true (night / dawn only), shape?: [...] (night / dawn only) }. alarm_enabled turns the alarm phase on (wakes you at the alarm time and turns the bed off after it) or off. Send only what changes. night and dawn keep their distance from bedtime or the alarm (usually night from bedtime, dawn from the alarm), so moving bedtime or the alarm moves them too unless you also send their time. enabled: false turns a day's schedule off. For one night only use override_sleep_schedule_tonight; for a one-off change at a set time use schedule_timeline_event. Returns the user's schedule after the change.
Request parameters
Authorization string requiredYour API key as a bearer token: Bearer os_…. Make one on the API keys page; see Authentication.
weekobject[] required min items 1Days to change: { day: "sunday" … "saturday", enabled?, alarm_enabled?, phases? }.
user_idstring (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
schedulesrecord<string, object> requiredKeyed by user id
Errors
Every error answers { "error": { "code", "message" } }.
update_sleep_schedules