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

# Add site auth token

> Provide an auth token to Axle, for dispatching the site's assets.

This token should provide access to all of the assets registered against the specified site.

This is only required where Axle is not able to access this site via an aggregated API in your systems.



## OpenAPI

````yaml POST /entities/site/{site_id}/token
openapi: 3.1.0
info:
  title: Axle API Docs
  description: >-
    For full documentation please see our official docs at <a
    href='http://docs.axle.energy'>docs.axle.energy</a>
  version: 1.4.6
servers:
  - url: https://api-sandbox.axle.energy
security: []
tags:
  - name: 1. Authentication
    description: Authenticate yourself with the Axle API
  - name: 2. Meters
    description: Find key info about your sites
  - name: 3. Sites
    description: Register your sites with Axle; configure market participation
  - name: 4. Assets
    description: Register your assets with Axle
  - name: 5. Data
    description: Send asset metrics to Axle, for analysis and optimisation purposes
  - name: 6. Rewards
    description: >-
      Determine how much your users have earned by participating with Axle;
      allow balance withdrawal
  - name: 7. Validation
    description: Validate structured data against Axle's rules
  - name: 8. Examples
    description: Get example data for testing
paths:
  /entities/site/{site_id}/token:
    post:
      tags:
        - 3. Sites
      summary: Add Site Auth Token
      description: >-
        Provide an auth token to Axle, for dispatching the site's assets.


        This token should provide access to all of the assets registered against
        the specified site.


        This is only required where Axle is not able to access this site via an
        aggregated API in your systems.
      operationId: add_site_auth_token_entities_site__site_id__token_post
      parameters:
        - required: true
          schema:
            type: string
            format: uuid
            title: Site Id
          name: site_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteAuthTokenRequest'
        required: true
      responses:
        '200':
          description: Token successfully processed
          content:
            application/json:
              schema: {}
        '404':
          description: Site not found or not authorized to access
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    SiteAuthTokenRequest:
      properties:
        refresh_token:
          type: string
          title: Refresh Token
          description: >-
            Refresh token for acquiring fresh access tokens after they expire;
            required, except for 'API_KEY'-type submissions
        access_token:
          type: string
          title: Access Token
          description: Access token for dispatching and monitoring assets
        token_type:
          type: string
          title: Token Type
          description: Type of token (e.g. 'Bearer' or 'API_KEY')
        expires_utc:
          type: string
          format: date-time
          title: Expires Utc
          description: Time in UTC at which the token expires
        expires_in:
          type: integer
          title: Expires In
          description: Time in seconds until the token expires
      type: object
      title: SiteAuthTokenRequest
      description: >-
        Request model for providing an auth token to enable Axle to access
        assets at a site.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: auth/token-form

````