Group Management

Group Management

🚫
NOTE: This part of the API does not exist yet.

Create, update, delete groups and move rooms between them.

The id returned by these endpoints can be used as <groupId> in Group State.

List Groups

Endpoint

GET /care-homes/<locationId>/groups

Response

200 OK

[
  {
    "id": "6a7b8c9d-0e1f-4234-5678-9abcdef01234",
    "name": "Apartment 101",
    "rooms": ["f3e1c2d4-5b6a-4c7d-8e9f-0a1b2c3d4e5f"]
  }
]
  • id: Unique identifier of the group.
  • name: Name of the group.
  • rooms: List of room IDs currently assigned to this group.

Create Group

Endpoint

POST /care-homes/<locationId>/groups

Body

{
  "name": "Apartment 101"
}
  • name: Name of the group. Must be a trimmed utf-8 string of 1 to 120 characters.

Response

201 Created

{
  "id": "6a7b8c9d-0e1f-4234-5678-9abcdef01234",
  "name": "Apartment 101",
  "rooms": []
}
  • id: Unique identifier of the group.
  • name: Name of the group.
  • rooms: List of room IDs currently assigned to this group. Will be empty for a newly created group.

Update Group

Endpoint

PATCH /care-homes/<locationId>/groups/<groupId>

Body

{
  "name": "Apartment 102"
}
  • name: New name of the group. Must be a trimmed utf-8 string of 1 to 120 characters.

Response

200 OK

{
  "id": "6a7b8c9d-0e1f-4234-5678-9abcdef01234",
  "name": "Apartment 102",
  "rooms": ["f3e1c2d4-5b6a-4c7d-8e9f-0a1b2c3d4e5f"]
}
  • id: Unique identifier of the group.
  • name: Updated name of the group.
  • rooms: List of room IDs currently assigned to this group.

Delete Group

Endpoint

DELETE /care-homes/<locationId>/groups/<groupId>

Response

  • 204 - group was deleted
  • 409 - group cannot be deleted because it still has rooms assigned to it. Move the rooms first and try again.

Move Room

Endpoint

POST /care-homes/<locationId>/groups/<groupId>/rooms/<roomId>/move

Body

{
  "targetGroupId": "9b8a7c6d-5e4f-4321-8765-fedcba987654"
}
  • targetGroupId: ID of the group to move the room to.

Response

  • 204: Room was successfully moved to the target group.
  • 403: Lacking permissions for one of the involved groups.