> ## 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.

# Get a list of token groups

> This endpoint allows you to get a paginated list of token groups. It is possible to set query parameters to filter the results.
  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 get /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:
    get:
      tags:
        - Token Groups
      summary: Get a list of token groups
      description: >-
        This endpoint allows you to get a paginated list of token groups. It is
        possible to set query parameters to filter the results.
          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: getTokenGroupList
      parameters:
        - name: search
          required: false
          in: query
          description: Search for token groups by name.
          schema:
            maxLength: 50
            example: Premium Users Group
            type: string
        - name: customerId
          required: false
          in: query
          description: Filter by a specific customer ID.
          schema:
            minimum: 1
            format: integer
            example: 67890
            type: integer
        - name: disabled
          required: false
          in: query
          description: Filter by active or inactive tokens.
          schema:
            type: boolean
        - name: sortBy
          required: false
          in: query
          description: >-
            When set, returned token groups will be sorted by one of the
            available properties.
          schema:
            default: id
            enum:
              - id
              - name
              - createdAt
              - updatedAt
            type: string
        - name: sortDirection
          required: false
          in: query
          description: Set the direction of sorting.
          schema:
            default: desc
            enum:
              - asc
              - desc
            type: string
        - name: offset
          required: false
          in: query
          description: Skip the first N items in the result set.
          schema:
            minimum: 0
            default: 0
            type: number
        - name: limit
          required: false
          in: query
          description: Limit the returned amount of tokens.
          schema:
            minimum: 1
            maximum: 1000
            default: 500
            type: number
      responses:
        '200':
          description: Returned list of token groups.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenGroupListResponseDto'
        '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:
    TokenGroupListResponseDto:
      type: object
      properties:
        data:
          description: A list of Token Groups.
          type: array
          items:
            $ref: '#/components/schemas/TokenGroupResponseDTO'
        count:
          type: integer
          minimum: 1
          description: Total number of token groups matching the query.
          example: 500
      required:
        - data
        - count
    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>`'

````