---
title: "Create User Group"
url: "https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598/operations/GroupsController_create"
---

> Full API specification: https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598.md

# Create User Group

`POST` `/tenants/groups`

Operation ID: `GroupsController_create`

Creates a new user group with assigned roles and permissions. Groups provide a way to manage multiple users with similar access requirements efficiently.

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Successfully created the group
- `401` - Unauthorized - Invalid or missing authentication token
- `403` - Forbidden - Insufficient permissions to perform this operation.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Cipherscale API
  version: "1.0"
servers:
  - url: https://public-api.cipherscale.com/qa
    description: Cipherscale Public API Server
paths:
  /tenants/groups:
    post:
      operationId: GroupsController_create
      summary: Create User Group
      description: Creates a new user group with assigned roles and permissions.
        Groups provide a way to manage multiple users with similar access
        requirements efficiently.
      requestBody:
        required: true
        description: The group data to create
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateGroupDto"
      responses:
        "201":
          description: Successfully created the group
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GroupDto"
        "401":
          description: Unauthorized - Invalid or missing authentication token
        "403":
          description: Forbidden - Insufficient permissions to perform this operation.
      tags:
        - Groups
      security:
        - ApiKeyAuth: []
security:
  - ApiKeyAuth: []
components:
  schemas:
    CreateGroupDto:
      type: object
      properties:
        roles:
          type: array
          items:
            type: string
        name:
          type: string
        description:
          type: string
      required:
        - roles
        - name
    GroupDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        name:
          type: string
        description:
          type: string
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleDto"
        deleteable:
          type: boolean
        users:
          type: array
          items:
            $ref: "#/components/schemas/GroupUserDto"
        maxDevices:
          type: number
        isSamlDefaultGroup:
          type: boolean
        idpMapping:
          type: array
          items:
            type: string
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - roles
        - deleteable
        - users
        - maxDevices
        - isSamlDefaultGroup
        - idpMapping
    RoleDto:
      type: object
      description: User role definition with specific permissions and capabilities
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the role
        createdAt:
          format: date-time
          type: string
          description: Timestamp when the role was created
        updatedAt:
          format: date-time
          type: string
          description: Timestamp when the role was last modified
        name:
          type: string
          description: Human-readable name of the role
        description:
          type: string
          description: Detailed description of the role's purpose and permissions
        deleteable:
          type: boolean
          description: Whether this role can be deleted (system roles are typically not
            deletable)
        type:
          enum:
            - OWNER
            - ADMIN
            - DEFAULT
            - BASIC
            - BILLING
            - AUDITOR
          type: string
          description: Predefined role type that determines the base permissions
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - deleteable
        - type
    GroupUserDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
      required:
        - id
        - createdAt
        - updatedAt
        - firstName
        - lastName
        - email
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
