---
title: "Create a device group"
method: POST
path: "/enterprise/{enterprise_id}/devicegroup/"
tags: ["esper_cloud_api_Device Group"]
---

# Create a device group

`POST /enterprise/{enterprise_id}/devicegroup/`

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

## Path parameters

- `enterprise_id` string, required

## Response `201`

successful operation

- EsperCloudApiDeviceGroup
  - `id` string, uuid — Group id
  - `name` string, required — Group name
  - `created_on` string, date-time — Date and time of when the group was created
  - `enterprise` string, url — Enterprise url
  - `parent` string, url — Parent group url
  - `device_count` integer — Count of devices in the group
  - `path` string — Path of the group
  - `children_count` integer — Count of child groups
  - `thumbnail` string, uuid — thumbnail associated with the group
  - `blueprint` string, uuid — Blueprint associated with the group.

## Other responses

- `400` — Bad request
- `401` — Authorization information is missing or invalid.
- `403` — Forbidden, no permission to perform this action.
- `500` — Internal server error

---

[API](https://skmtc.net/esper/apis/esper-api-reference.md) · [All operations](https://skmtc.net/esper/apis/esper-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/esper/esper-api-reference/versions/e1f64cbb488e/schema)
