---
title: "Create a new group"
method: POST
path: "/api/admin/groups"
tags: ["Users"]
---

# Create a new group

`POST /api/admin/groups`

**Enterprise feature**

Create a new user group for Role-Based Access Control

## Request body

- CreateGroupSchema — A detailed information about a user group
  - `name` string, required — The name of the group
  - `description` string, nullable — A custom description of the group
  - `mappingsSSO` string[] — A list of SSO groups that should map to this Unleash group
  - `rootRole` number, nullable — A role id that is used as the root role for all users in this group. This can be either the id of the Viewer, Editor or Admin role.
  - `users` object[] — A list of users belonging to this group
    - `user` object, required — A minimal user object
      - `id` integer, required — The user id

## Response `201`

The resource was successfully created.

- GroupWriteResponseSchema — A user group returned after create or update. User membership is intentionally omitted; fetch the group resource when membership details are needed.
  - `id` integer — The group id
  - `name` string, required — The name of the group
  - `description` string, nullable — A custom description of the group
  - `mappingsSSO` string[] — A list of SSO groups that should map to this Unleash group
  - `rootRole` number, nullable — A role id that is used as the root role for all users in this group. This can be either the id of the Viewer, Editor or Admin role.
  - `createdBy` string, nullable — A user who created this group
  - `createdAt` string, date-time, nullable — When was this group created
  - `projects` string[] — A list of projects where this group is used
  - `userCount` integer — The number of users that belong to this group
  - `scimId` string, nullable — The SCIM ID of the group, only present if managed by SCIM

## Other responses

- `400` — The request data does not match what we expect.
- `401` — Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`.
- `403` — The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation
- `409` — The provided resource can not be created or updated because it would conflict with the current state of the resource or with an already existing resource, respectively.

---

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