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

# Associate a location to a 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/{id}/locations/{locationId}
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/{id}/locations/{locationId}:
    post:
      tags:
        - Token Groups
      summary: Associate a location to a 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: associateTokenGroupToLocation
      parameters:
        - name: id
          required: true
          in: path
          description: Used to identify the token group throughout the Spirii system.
          schema:
            type: number
        - name: locationId
          required: true
          in: path
          schema:
            type: number
      responses:
        '204':
          description: Location successfully associated with token group.
        '400':
          description: Bad Request provided. A message will describe the issue.
        '403':
          description: Authorization header JWT token is invalid or not provided.
        '404':
          description: The token group or the location with the provided Id was not found.
        '409':
          description: This combination of token group and location already exists.
        '500':
          description: Internal Server Error.
      security:
        - Authorization: []
components:
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization
      description: '`Authorization: Bearer <SPIRII_API_KEY>`'

````