> ## 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.

# Create device code

> Request a new device authorization code. The external client displays this code to the user, who then visits the Sevalla dashboard to approve the device. The client polls the GET endpoint until the code is approved, denied, or expired. Codes expire after 5 minutes. Maximum 5 active codes per IP address.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json post /auth/device-codes
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:
    post:
      tags:
        - Device Authorization
      summary: Create device code
      description: >-
        Request a new device authorization code. The external client displays
        this code to the user, who then visits the Sevalla dashboard to approve
        the device. The client polls the GET endpoint until the code is
        approved, denied, or expired. Codes expire after 5 minutes. Maximum 5
        active codes per IP address.
      operationId: createDeviceCodeV3
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      The device code to display to the user. The user enters
                      this code in the Sevalla dashboard to authorize the device
                    example: ABCD1234
                  expires_at:
                    type: string
                    description: >-
                      ISO 8601 timestamp when the device code expires. Codes are
                      valid for 5 minutes
                    example: '2025-06-01T12:05:00.000Z'
                required:
                  - code
                  - expires_at
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Too many requests
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 429
                  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
        '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.

````