Docs

Sleep configuration

Assign user to device zones

Assigns a user onto specific zone(s) of a device (e.g. "put me back on zone_b"). device_id and zone ids come from list_devices.

POST
/v1/sleep-configuration/assign

If a requested zone is occupied, push_away_behavior decides what happens to the occupant: switch_zone_first moves them to a free zone when possible (else away); only_away always marks them away.

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
  • device_id string required

    Device id (the "id" field from list_devices, NOT the serial)

  • zone_ids string[] required min items 1

    Zone ids to assign the user to, e.g. ["zone_a"] or ["zone_a","zone_b"]. zone_a is on the right for someone standing at the foot of the bed facing it (the sleeper's left when lying in it); zone_b is the other side.

  • user_id string (uuid)

    Target user id (from list_devices shared_with). Defaults to the authenticated user. Anyone on a bed may move themselves; acting on another user needs the owner or admin role on a shared bed.

  • push_away_behavior enum<string> default switch_zone_first

    How to handle a user already occupying a requested zone. Default: switch_zone_first.

    Possible values: only_away switch_zone_first

Response parameters

200 OK application/json
  • success boolean 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: assign_zone