This endpoint can update multiple unit groups at once by providing a unit_groups
array of objects with the id
parameter. Attributes that are not provided will not be updated. Asymmetric updates are supported. For example, it is possible to update the name of one unit group and the reference unit of another unit group in the same request.
A unit group's reference unit is a unit that serves as a representative unit for the group, often encapsulating the "why" behind the grouping of units. For example, a unit group comprised of 9 10x10 units and 1 10x11 unit would likely want to set one of the 10x10 units as the reference unit. The reference unit's attributes are used in many places in the storEDGE UI where a unit group is displayed. For example, the unit selector in the move-in process.
Updating a unit group's reference unit will update the following "unit level" attributes that are memoized on the unit group:
- access_type
- area
- door_height
- door_width
- floor
- height
- length
- size
- standard_rate
- unit_type_id
- width
Common errors that may be encountered:
- Unit groups must have unique names across the facility. If non-unique names are provided, or a new name will conflict with an existing unit group, a list of errors will be returned under 'errors'
-> 'name_assignments'
.
- Reference unit ids being assigned to a unit group must correspond to units that belong to the unit group. If a reference unit id is provided that does not belong to the unit group, a list of errors will be returned under 'errors'
-> 'reference_unit_assignments'
.
Param name | Description |
---|---|
unit_groups
required |
Array of Unit Group objects Validations:
|
unit_groups[fully_enclosed]
optional |
Whether or not the unit group is fully enclosed Validations:
|
unit_groups[id]
required |
Uuid of the Unit Group Validations:
|
unit_groups[name]
optional |
New name of the Unit Group Validations:
|
unit_groups[reference_unit_id]
optional |
Uuid of the new reference unit for the Unit Group. The reference unit must belong to the Unit Group. Validations:
|
PATCH /v1/ce3440cc-87d4-44c3-a4db-493ded0e2b14/unit_groups { "unit_groups": [ { "id": "84411e66-63fa-4105-b4be-e03fd76f410e", "name": "New Group Name #1", "reference_unit_id": "34def4ac-1595-4e64-b0b7-8df4de56570a", "fully_enclosed": true }, { "id": "9fdc7cff-8aca-44d7-9100-3b0764166a5a", "name": "New Group Name #2" } ], "unit_group": {} } 200 { "unit_groups": [ { "uuid": "84411e66-63fa-4105-b4be-e03fd76f410e", "name": "New Group Name #1", "fully_enclosed": true, "reference_unit_id": "34def4ac-1595-4e64-b0b7-8df4de56570a", "length": 100.0, "width": 100.0, "height": 100.0, "floor": 1, "unit_type_id": 3139, "standard_rate": 50.0, "area": 10000.0, "door_width": 1.0, "door_height": 10.0, "access_type": "indoor", "size": "100x100x100" }, { "uuid": "9fdc7cff-8aca-44d7-9100-3b0764166a5a", "name": "New Group Name #2" } ], "meta": { "status_code": 200, "status_message": "OK", "status_cat": "https://http.cat/200", "request_method": "PATCH", "request_id": null, "parameters": { "unit_groups": [ { "id": "84411e66-63fa-4105-b4be-e03fd76f410e", "name": "New Group Name #1", "reference_unit_id": "34def4ac-1595-4e64-b0b7-8df4de56570a", "fully_enclosed": true }, { "id": "9fdc7cff-8aca-44d7-9100-3b0764166a5a", "name": "New Group Name #2" } ], "facility_id": "ce3440cc-87d4-44c3-a4db-493ded0e2b14", "unit_group": {} } } }