Creates a new device group within the enterprise. Device groups organize devices into logical collections for policy assignment, app deployment, Blueprint application, and bulk command targeting. Groups can be nested — pass a parent group ID to create a subgroup within an existing group hierarchy.
Request body fields
name (required) — Display name for the new group parent (optional) — UUID of the parent group; omit to create a top-level group device_ids (optional) — Array of device UUIDs to add to the group at creation time
Common Use Cases
Setting up a new group before provisioning a batch of devices into it Creating subgroups to represent locations, departments, or device roles within a larger fleet segment Programmatically building out a group hierarchy as part of an onboarding or deployment Workflow
Best Practices
Group names should be descriptive and consistent with your naming convention — they appear throughout the Console and API responses You can add devices at creation via device_ids, or add them later using the update endpoint Store the id from the 201 response immediately — it's required for all subsequent group operations (policy assignment, commands, Blueprint targeting, etc.) Use GET /enterprise/{enterprise_id}/devicegroup/ first to confirm the group doesn't already exist before creating a duplicate
- Mock serverhttps://api.esper.io/_mock/openapi/enterprise/{enterprise_id}/devicegroup/
- https://develop-api.esper.cloud/apihttps://develop-api.esper.cloud/api/enterprise/{enterprise_id}/devicegroup/
curl -i -X POST \
'https://api.esper.io/_mock/openapi/enterprise/{enterprise_id}/devicegroup/' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: */*' \
-d '{
"name": "string",
"parent": "42e2bc1b-6741-4e2e-b138-97b4a342c999",
"device_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}'successful operation
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "created_on": "2019-08-24T14:15:22Z", "enterprise": "string", "parent": "string", "device_count": 0, "path": "string", "children_count": 0, "thumbnail": "dec11f24-4767-4257-ac7d-bde137bc173e", "blueprint": "f63e6a96-31ed-4c31-b384-a8046257f34c" }