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

# Generate a temporary access token

> Generates a short-lived JSON Web Token (JWT) that can be used to provide temporary, read-only access to specific fault data, typically for embedding in external dashboards.



## OpenAPI

````yaml /api/en/faults.yaml post /fault/token
openapi: 3.0.3
info:
  title: Altostrat Faults API
  version: 1.0.0
  description: >-
    Query, resolve, and share SDX fault data through the public `/fault` gateway
    path. Use query parameters on `/fault` for site-specific and recent fault
    views.
servers:
  - url: https://v1.api.altostrat.io
    description: Production API Server
security:
  - BearerAuth: []
tags:
  - name: Faults
    description: Manage and retrieve fault records.
  - name: Comments
    description: Add comments to existing faults.
  - name: Analytics
    description: Access aggregated fault data and reports.
  - name: Access Tokens
    description: Generate temporary access tokens.
paths:
  /fault/token:
    post:
      tags:
        - Access Tokens
      summary: Generate a temporary access token
      description: >-
        Generates a short-lived JSON Web Token (JWT) that can be used to provide
        temporary, read-only access to specific fault data, typically for
        embedding in external dashboards.
      operationId: generateAccessToken
      requestBody:
        description: Specifies the duration for which the token will be valid.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateTokenRequest'
      responses:
        '200':
          description: The generated access token and its metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    GenerateTokenRequest:
      type: object
      required:
        - expire_after_minutes
      properties:
        expire_after_minutes:
          type: integer
          description: The number of minutes from now that the token should expire.
          minimum: 1
          maximum: 43200
          example: 60
    AccessToken:
      type: object
      description: A temporary access token object.
      properties:
        token:
          type: string
          description: The JSON Web Token.
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
        type:
          type: string
          description: The type of token.
          example: jwt
        expires_in_minutes:
          type: integer
          description: The number of minutes until the token expires.
          example: 60
        expires_at:
          type: string
          format: date-time
          description: The exact timestamp when the token will expire.
          example: '2025-10-21T13:00:00.000000Z'
        short_link:
          type: string
          format: uri
          description: A shortened URL that embeds the token for easy sharing.
          example: https://altostr.at/aBcDeFg
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_missing
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'resource_id' parameter is required for this request.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
  responses:
    BadRequest:
      description: Bad Request - The request was malformed or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: invalid_request_error
            code: parameter_missing
            message: The 'message' parameter is required for this request.
            doc_url: https://docs.altostrat.io/errors/parameter_missing
    Unauthorized:
      description: Unauthorized - The API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: authentication_error
            code: api_key_invalid
            message: The provided API key is invalid.
            doc_url: https://docs.altostrat.io/errors/api_key_invalid
    Forbidden:
      description: Forbidden - The API key does not have permission to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: permission_error
            code: permission_denied
            message: You do not have the required scope to perform this action.
            doc_url: https://docs.altostrat.io/errors/permission_denied
    ServerError:
      description: Internal Server Error - An unexpected error occurred on our servers.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: api_error
            code: internal_server_error
            message: >-
              An internal error occurred. Please try again or contact support if
              the issue persists.
            doc_url: https://docs.altostrat.io/errors/internal_server_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        API requests are authenticated using a JSON Web Token (JWT) provided in
        the `Authorization` header.

````