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

# Generate Access Token

> Generate a new client token (JWT)

Use your org-level API key (`Bearer fl-xxxxxx`) to create a JWT token for a specific client. The token can be used at client-facing endpoints.

<ResponseExample>
  ```json Response (200 OK) theme={null}
  {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires_in": 3600
  }
  ```
</ResponseExample>

<RequestExample>
  ```json Request theme={null}
  {
    "client_id": "client123",
    "duration_secs": 3600,
    "metadata": {
      "user_name": "John Doe",
      "company": "Acme Corp"
    }
  }
  ```
</RequestExample>


## OpenAPI

````yaml POST /generate_access_token
openapi: 3.1.0
info:
  title: Client-Side Authentication & API
  version: 1.0.0
  description: |
    Endpoints for managing and using client-side tokens (JWT). 
    Generate or revoke tokens with your org-level API key, 
    then call the client-specific endpoints using the JWT.
servers:
  - url: https://platform-api.wisprflow.ai/api/v1/dash
    description: Production server
security: []
paths:
  /generate_access_token:
    post:
      summary: Generate a new client token (JWT)
      description: |
        Use your org-level API key (`Bearer fl-xxxxxx`) to create a 
        JWT token for a specific client. The token can be used at 
        client-facing endpoints.
      operationId: generateAccessToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - client_id
                - duration_secs
              properties:
                client_id:
                  type: string
                  description: Identifier for the client
                duration_secs:
                  type: integer
                  description: Token lifetime in seconds
                metadata:
                  type: object
                  additionalProperties: true
                  description: Optional metadata to store with the token
      responses:
        '200':
          description: Returns the newly generated token
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    description: The JWT token
                  expires_in:
                    type: integer
                    description: How long the token remains valid (in seconds)
        '401':
          description: Unauthorized (invalid org-level API key)
        '500':
          description: Internal server error
      security:
        - bearerAuthOrg: []
components:
  securitySchemes:
    bearerAuthOrg:
      type: http
      scheme: bearer
      bearerFormat: OrganizationKey
      description: >
        **Org-level key** (format: `Bearer fl-xxxxx`)  used to manage client
        tokens.

````