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

# Poll device code status

> Check the current status of a device authorization code. The external client should poll this endpoint at regular intervals (recommended every 5 seconds) until the status changes from `pending`. When approved, the response includes the API key token for a one-time retrieval - the token cannot be fetched again.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json get /auth/device-codes/{code}
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /auth/device-codes/{code}:
    get:
      tags:
        - Device Authorization
      summary: Poll device code status
      description: >-
        Check the current status of a device authorization code. The external
        client should poll this endpoint at regular intervals (recommended every
        5 seconds) until the status changes from `pending`. When approved, the
        response includes the API key token for a one-time retrieval - the token
        cannot be fetched again.
      operationId: pollDeviceCodeV3
      parameters:
        - schema:
            type: string
            minLength: 1
            example: ABCD1234
          in: path
          name: code
          required: true
          description: The device code to check the status of
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - pending
                      - approved
                      - denied
                      - expired
                    description: >-
                      Current status of the device code. `pending` - waiting for
                      user action, `approved` - user approved and token is
                      included, `denied` - user explicitly rejected the request,
                      `expired` - code has expired
                    example: pending
                  token:
                    description: >-
                      The API key token, only present when status is `approved`.
                      This is the only time the token is returned - store it
                      securely
                    example: svl_abc123...
                    type: string
                required:
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````