Room Management
Room Management
🚫
NOTE: This part of the API does not exist yet.
Create, update, delete rooms and move devices between them.
The id returned by these endpoints can be used as <roomId> in Room State.
List Rooms
Endpoint
GET /care-homes/<locationId>/rooms
Response
200 OK
[
{
"id": "f3e1c2d4-5b6a-4c7d-8e9f-0a1b2c3d4e5f",
"name": "Bedroom",
"groupId": "6a7b8c9d-0e1f-4234-5678-9abcdef01234",
"devices": ["123e4567-e89b-12d3-a456-426614174000"]
}
]id: Unique identifier of the room.name: Name of the room.groupId: Unique identifier of the group this room belongs to, ornullif the room is not assigned to a group.devices: List of device IDs currently assigned to this room.
Create Room
Endpoint
POST /care-homes/<locationId>/rooms
Body
{
"name": "Bedroom",
"groupId": "6a7b8c9d-0e1f-4234-5678-9abcdef01234"
}name: Name of the room. Must be a trimmed utf-8 string of 1 to 120 characters.groupId: Optional. ID of the group this room should belong to.
Response
201 Created
{
"id": "f3e1c2d4-5b6a-4c7d-8e9f-0a1b2c3d4e5f",
"name": "Bedroom",
"groupId": "6a7b8c9d-0e1f-4234-5678-9abcdef01234",
"devices": []
}id: Unique identifier of the room.name: Name of the room.groupId: Unique identifier of the group this room belongs to, ornullif the room is not assigned to a group.devices: List of device IDs currently assigned to this room. Will be empty for a newly created room.
Update Room
Endpoint
PATCH /care-homes/<locationId>/rooms/<roomId>
Body
{
"name": "East Bedroom",
"groupId": "6a7b8c9d-0e1f-4234-5678-9abcdef01234"
}name: New name of the room. Must be a trimmed utf-8 string of 1 to 120 characters.groupId: Optional. ID of the group this room should belong to.
Response
200 OK
{
"id": "f3e1c2d4-5b6a-4c7d-8e9f-0a1b2c3d4e5f",
"name": "East Bedroom",
"groupId": "6a7b8c9d-0e1f-4234-5678-9abcdef01234",
"devices": ["123e4567-e89b-12d3-a456-426614174000"]
}id: Unique identifier of the room.name: Updated name of the room.groupId: Unique identifier of the group this room belongs to, ornullif the room is not assigned to a group.devices: List of device IDs currently assigned to this room.
Delete Room
Endpoint
DELETE /care-homes/<locationId>/rooms/<roomId>
Response
204- room was deleted409- room cannot be deleted because it still has devices assigned to it. Move or delete the devices first and try again.
Move Device
Endpoint
POST /care-homes/<locationId>/devices/<deviceId>/move
Body
{
"targetRoomId": "2c4e6f80-1234-4abc-9def-1234567890ab"
}targetRoomId: ID of the room to move the device to.
Response
204: Device was successfully moved to the target room.403: Lacking permissions for the location.