When creating a group you can use the following format:
Please note that Name is the name of the new group and Path is the full path of where this group resides in your folder hierarchy including itself.
Once you run that you should get the following response:
Please note that it auto generates a ReferenceId which is a unique identifier for the group. You can get this reference ID later by using a GET /Devicegroups API.
If you want to move devices to this new group you can use the API as follows:
Note we're using a referenceId in the path, that is preferable over a group path name due to the fact that group names might change, but a reference ID will stay the same after the group has been created. The deviceIDs must be listed within square brackets and double quotes with a comma separating each one as shown above two devices are being moved to the new group I just created. If successful you should just get a response of 204.