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

# Create a new token group

> 
  A token group is an access management mechanism where only tokens inside a group can authorize charging at specified locations.

  The group **always** grants access to the location. This means the location's public setting and opening hours are overruled by a token inside the group.



## OpenAPI

````yaml /openapi/integration-api-v2/openapi.yaml post /v2/token-groups
openapi: 3.0.0
info:
  title: Spirii API
  description: Spirii API
  version: 2.10.0
  contact: {}
servers:
  - url: https://api.spirii.com
security: []
tags: []
paths:
  /v2/token-groups:
    post:
      tags:
        - Token Groups
      summary: Create a new token group
      description: |2-

          A token group is an access management mechanism where only tokens inside a group can authorize charging at specified locations.

          The group **always** grants access to the location. This means the location's public setting and opening hours are overruled by a token inside the group.
      operationId: createTokenGroup
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenGroupDTO'
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenGroupResponseDTO'
        '400':
          description: Bad Request provided. A message will describe the issue.
        '403':
          description: Authorization header JWT token is invalid or not provided.
        '500':
          description: Internal Server Error.
      security:
        - Authorization: []
components:
  schemas:
    CreateTokenGroupDTO:
      type: object
      properties:
        name:
          type: string
          maxLength: 20
          description: The token group name.
          example: Premium Users Group
        customerId:
          type: number
          description: |-
            The owner of the group that the associated tokens will belong to.
                    If not provided, the token group is owned directly by the operator.
          example: 2001
        disabled:
          type: boolean
          description: |-
            Defines whether a token group is disabled. If disabled is true,
                 locations associated to the token group are no longer exclusive to
                  tokens inside the group.
          example: false
          default: false
      required:
        - name
    TokenGroupResponseDTO:
      type: object
      properties:
        id:
          type: number
          description: Unique identifier for the token group.
        name:
          type: string
          maxLength: 20
          description: The token group name.
          example: Premium Users Group
        customerId:
          type: number
          description: |-
            The owner of the group that the associated tokens will belong to.
                    If not provided, the token group is owned directly by the operator.
          example: 2001
        disabled:
          type: boolean
          description: |-
            Defines whether a token group is disabled. If disabled is true,
                 locations associated to the token group are no longer exclusive to
                  tokens inside the group.
          example: false
          default: false
        createdAt:
          format: date-time
          type: string
          description: The date and time when the token group was created.
          example: '2025-06-03T12:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: The date and time when the token group was last updated.
          example: '2025-06-03T12:00:00.000Z'
      required:
        - id
        - name
        - createdAt
        - updatedAt
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization
      description: '`Authorization: Bearer <SPIRII_API_KEY>`'

````