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

# Get Desktop Token

> Exchange a valid Clerk session token for a long-lived desktop token.

The desktop token:
- Is valid for 30 days (configurable via DESKTOP_TOKEN_EXPIRY_DAYS)
- Uses HS256 signing (fast local validation)
- Contains user_id, email, and org_id

Call this endpoint from the web app's /connect-desktop page
after the user authenticates with Clerk.



## OpenAPI

````yaml /openapi.json post /v1/desktop-auth/token
openapi: 3.1.0
info:
  title: Ontora API
  description: >-
    Ontora's public API. Covers interview campaigns, transcripts, synthesis
    reports, graph queries, webhooks, and workspace management. 


    **Authentication**: endpoints accept either a Clerk JWT (`Authorization:
    Bearer <token>`) or a workspace API key (`X-API-Key: ont_...`). Workspace
    keys are managed via `/v1/api-keys`.
  version: 0.1.0
servers: []
security:
  - ClerkJWT: []
  - WorkspaceApiKey: []
tags:
  - name: interviews
    description: Campaign CRUD, lifecycle, contacts, question sets.
  - name: campaign-insights
    description: Synthesis outputs — cartography, roadmap, personas, conversations.
  - name: interview-query
    description: Graph RAG query over campaign data.
  - name: interview-export
    description: Markdown / ZIP exports of transcripts and reports.
  - name: api-keys
    description: Manage workspace-scoped API keys for programmatic access.
  - name: webhook-endpoints
    description: Outbound webhook endpoints for automation.
  - name: booking
    description: Public self-scheduling endpoints for interview participants.
  - name: workspaces
    description: Workspace and membership management.
  - name: vaults
    description: Context vault management.
paths:
  /v1/desktop-auth/token:
    post:
      tags:
        - desktop-auth
      summary: Get Desktop Token
      description: |-
        Exchange a valid Clerk session token for a long-lived desktop token.

        The desktop token:
        - Is valid for 30 days (configurable via DESKTOP_TOKEN_EXPIRY_DAYS)
        - Uses HS256 signing (fast local validation)
        - Contains user_id, email, and org_id

        Call this endpoint from the web app's /connect-desktop page
        after the user authenticates with Clerk.
      operationId: get_desktop_token_v1_desktop_auth_token_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesktopTokenResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    DesktopTokenResponse:
      properties:
        token:
          type: string
          title: Token
        expires_in_days:
          type: integer
          title: Expires In Days
        user_id:
          type: string
          title: User Id
      type: object
      required:
        - token
        - expires_in_days
        - user_id
      title: DesktopTokenResponse
  securitySchemes:
    ClerkJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Clerk-issued RS256 JWT.
    WorkspaceApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Workspace-scoped API key (prefix: `ont_`).'
    HTTPBearer:
      type: http
      scheme: bearer

````