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

# Poll for a device access token

> Poll after the user approves the device login in their browser.



## OpenAPI

````yaml /api/openapi.yaml post /auth/device-token
openapi: 3.1.0
info:
  title: Antigen API
  version: v1
  description: >-
    Use the Antigen API to manage targets, runs, vulnerabilities, evidence,
    reports, hooks, assets, and integrations.
servers:
  - url: https://api.antigen.sh/v1
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
  - SessionCookie: []
tags:
  - name: Authentication
  - name: API keys
  - name: Models
  - name: Agents
  - name: Targets
  - name: Runs
  - name: Vulnerabilities
  - name: Evidence
  - name: Reports
  - name: Hooks
  - name: Asset Map
  - name: Integrations
paths:
  /auth/device-token:
    post:
      tags:
        - Authentication
      summary: Poll for a device access token
      description: Poll after the user approves the device login in their browser.
      operationId: pollDeviceToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - device_code
              properties:
                device_code:
                  type: string
      responses:
        '200':
          description: Device login approved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTokenResponse'
        '400':
          description: The user has not approved the request or the device code expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTokenError'
      security: []
components:
  schemas:
    DeviceTokenResponse:
      type: object
      required:
        - access_token
        - refresh_token
        - expires_in
      properties:
        access_token:
          type: string
        refresh_token:
          type: string
        expires_in:
          type: number
    DeviceTokenError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          enum:
            - authorization_pending
            - expired_token
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key from the Antigen dashboard.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: access token
      description: Better Auth access token.
    SessionCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Better Auth browser session cookie.

````