> ## Documentation Index
> Fetch the complete documentation index at: https://docs.connectedfleet.michelin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add group

> POST request to add a new group. The identifier for the newly added group is included in the JSON object returned as the response. The request will fail when the group name contains illegal characters.



## OpenAPI

````yaml /api-reference/fleet-management.json post /public/v1/customer/{customerId}/group
openapi: 3.0.1
info:
  title: Fleet management
  description: >-
    A comprehensive administration pack enabling full control over fleet
    structures, users, drivers, vehicles and operational data.
  contact:
    name: Masternaut
    url: https://www.masternaut.com
    email: support@masternautconnect.com
  version: 124.0.2607160821
servers:
  - url: https://api.masternautconnect.com/connect-webservices/services
    description: Product Server
security:
  - basicAuth: []
tags:
  - name: /driver
    description: Driver Operations
  - name: /group
    description: Group operations
  - name: /location/category
    description: Location category management operations
  - name: /location
    description: Location management operations
  - name: /role
    description: Role operations
  - name: /tokenInformation
    description: Token operations
  - name: /user
    description: User operations
  - name: /maintenance
    description: Vehicle maintenance operations
  - name: /vehicle
    description: Vehicle management operations
paths:
  /public/v1/customer/{customerId}/group:
    post:
      tags:
        - /group
      summary: Add group
      description: >-
        POST request to add a new group. The identifier for the newly added
        group is included in the JSON object returned as the response. The
        request will fail when the group name contains illegal characters.
      operationId: createGroup
      parameters:
        - name: customerId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/GroupQueryDto'
      responses:
        '200':
          description: Newly created group
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/GroupDto'
        '400':
          description: >-
            When name is blank or size name does not fit.

            When size parentId does not fit or it does not match pattern or it
            isn't visible for user.
          content:
            application/json;charset=UTF-8:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiErrorDto'
components:
  schemas:
    GroupQueryDto:
      required:
        - Name of the group
      type: object
      properties:
        Name of the group:
          maxLength: 255
          minLength: 1
          type: string
          example: Group Name
        parentId:
          maxLength: 255
          minLength: 0
          pattern: ^[a-z0-9]*$
          type: string
          description: >-
            ID of parent group / hierarchy node. When empty it is used node id
            of request context
          example: parentGroupId
    GroupDto:
      required:
        - id
      type: object
      properties:
        id:
          maxLength: 24
          minLength: 1
          pattern: ^[a-z0-9]+$
          type: string
          description: ID of group
          example: groupID
        name:
          maxLength: 255
          minLength: 0
          type: string
          description: Group name
          example: group-name
        parentId:
          type: string
          description: ID of parent group, in case for changing the hierarchy
          example: rootGroupId
        path:
          type: string
          description: Hierarchy path from root group
          readOnly: true
          example: rootGroupId.groupID
        vehicleIds:
          type: array
          items:
            type: string
            description: List of Vehicle IDs to assign for concrete group
            example: '["vehicleID1","vehicleID2"]'
        personIds:
          type: array
          items:
            type: string
            description: List of Person IDs to assign for concrete group
            example: '["personID1","personID2"]'
    ApiErrorDto:
      type: object
      properties:
        errorCode:
          type: integer
          format: int32
        errorMessage:
          type: string
        offendingFields:
          type: array
          items:
            type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````