> ## Documentation Index
> Fetch the complete documentation index at: https://video2ctx-feat-polar-billing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Poll for an approved CLI session

> Exchanges an approved device code for a revocable bearer session. Honor the issued polling interval and terminal OAuth device-flow errors.



## OpenAPI

````yaml /api-reference/openapi.json post /api/auth/device/token
openapi: 3.1.0
info:
  title: video2ctx API
  version: 1.0.0
  license:
    name: Apache License 2.0
    identifier: Apache-2.0
  description: >-
    Consumer-facing contract for the hosted video2ctx API. First-party
    application and operator routes are documented separately at
    https://docs.video2ctx.dev/internals/overview.
servers:
  - url: https://api.video2ctx.dev
    description: Hosted video2ctx API
security: []
tags:
  - name: System
    description: Service status and machine-readable documentation.
  - name: Authentication
    description: Better Auth entry points used by the web application.
  - name: Providers
    description: Supported external video providers and their capabilities.
  - name: Discovery
    description: Search, browse, and trend research.
  - name: Videos
    description: Video metadata and evidence.
  - name: Channels
    description: Channel inspection.
  - name: Playlists
    description: Playlist inspection.
  - name: Projects
    description: Private research projects and saved material.
  - name: Research
    description: Imports, jobs, cited answers, comparisons, and reports.
  - name: Exports
    description: Project export creation and download.
  - name: Monitoring
    description: Monitors, notifications, and digest preferences.
  - name: Billing
    description: Plan, credit, and subscription status.
  - name: Account
    description: Account lifecycle operations.
paths:
  /api/auth/device/token:
    post:
      tags:
        - Authentication
      summary: Poll for an approved CLI session
      description: >-
        Exchanges an approved device code for a revocable bearer session. Honor
        the issued polling interval and terminal OAuth device-flow errors.
      operationId: exchangeDeviceAuthorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - grant_type
                - device_code
                - client_id
              properties:
                grant_type:
                  type: string
                  const: urn:ietf:params:oauth:grant-type:device_code
                device_code:
                  type: string
                  writeOnly: true
                client_id:
                  type: string
                  const: video2ctx-cli
      responses:
        '200':
          description: Approved CLI session.
          content:
            application/json:
              schema:
                type: object
                required:
                  - access_token
                  - token_type
                  - expires_in
                  - scope
                properties:
                  access_token:
                    type: string
                    writeOnly: true
                  token_type:
                    type: string
                    const: Bearer
                  expires_in:
                    type: integer
                    minimum: 1
                  scope:
                    type: string
                    const: data:read account:access
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/ServerError'
      security: []
components:
  responses:
    BadRequest:
      description: The request is malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: An unexpected server error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: QUERY_REQUIRED
            message:
              type: string
            details: {}
            requestId:
              type: string

````