moveGroup #
Moves a group to a new parent group.
This endpoint updates the group's path and cascades the changes to all descendant groups, assets, and devices.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/device-manager/:engineId/groups/:_id/_move
Method: PUTOther protocols #
{
"controller": "device-manager/groups",
"action": "moveGroup",
"engineId": "<engineId>",
"_id": "<group id>",
"body": {
"targetGroupId": "<target group id>" // use null to move to root
}
}Arguments #
engineId: Engine ID (required)_id: ID of the group to move (required)
Body properties #
targetGroupId: ID of the destination parent group (required). Usenullto move the group to the root level.
Response #
{
"status": 200,
"error": null,
"controller": "device-manager/groups",
"action": "moveGroup",
"requestId": "<unique request identifier>",
"result": {
"_id": "<groupId>",
"_source": {
"name": "<group name>",
"model": "<group model>",
"path": "<new path>",
"metadata": {},
"lastUpdate": "<timestamp>"
}
}
}Errors #
- Returns an error if the group is already at the root and
targetGroupIdisnull. - Returns an error if
targetGroupIdis the same as_id(cannot move a group into itself). - Returns an error if
targetGroupIdis a descendant of the group being moved. - Returns an error if the group is already a direct child of the target group.