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

# list devices

> Retrieve a list of your devices.



## OpenAPI

````yaml api-reference/openapi.json get /devices
openapi: 3.1.0
info:
  title: Chatlevel API
  description: >-
    Chatlevel is a WhatsApp web API to manage any WhatsApp account
    programmatically.
  version: v1.0.0
servers:
  - url: https://api.chatlevel.io/v1
security:
  - bearerAuth: []
tags:
  - name: devices
    description: Operations related to managing devices.
  - name: messages
    description: Operations related to sending messages.
paths:
  /devices:
    get:
      tags:
        - devices
      summary: list devices
      description: Retrieve a list of your devices.
      operationId: list-devices
      responses:
        '200':
          description: A JSON array of devices
          content:
            application/json:
              schema:
                type: object
                properties:
                  devices:
                    type: array
                    items:
                      $ref: '#/components/schemas/device'
                  status:
                    $ref: '#/components/schemas/status'
              example:
                devices:
                  - id: 12345
                    name: My Device
                    status: connected
                    qr: null
                    webhookUrl: https://example.com/webhook
                    webhookEvents:
                      - message.received
                      - message.sent
                    messagesSent: 150
                    subscription_status: active
                    createdAt: '2024-01-15T10:30:00Z'
                status:
                  code: 200
                  message: Success
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '408':
          $ref: '#/components/responses/408Timeout'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalError'
components:
  schemas:
    device:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the device
        name:
          type: string
          description: Name of the device
        status:
          type: string
          enum:
            - connected
            - qr
            - timeout
          description: >-
            Current connection status: 'qr' when waiting for QR scan,
            'connected' when paired, 'timeout' when QR expired
        qr:
          type: string
          nullable: true
          description: Base64 encoded QR code data URL (available when status is 'qr')
        webhookUrl:
          type: string
          nullable: true
          description: Webhook URL for receiving events
        webhookEvents:
          type: array
          items:
            type: string
            enum:
              - connection.open
              - connection.closed
              - connection.auth
              - connection.timeout
              - connection.logout
              - message.received
              - message.sent
              - message.updated
              - message.deleted
              - call
          description: >-
            Events to send to webhook. See webhook documentation for event
            payloads.
        messagesSent:
          type: integer
          description: Total number of messages sent
        subscription_status:
          type: string
          enum:
            - active
            - inactive
          description: >-
            Subscription status of the device. Inactive devices have their
            WhatsApp sessions stopped.
        createdAt:
          type: string
          format: date-time
          description: When the device was created
    status:
      type: object
      properties:
        code:
          type: integer
          description: Status code
          example: 200
        message:
          type: string
          description: Status message
          example: Success
  responses:
    401Unauthorized:
      description: Missing or invalid authorization header
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: error
              error:
                type: object
                properties:
                  code:
                    type: integer
                    example: 401
                  message:
                    type: string
                    example: >-
                      Missing or invalid authorization header. Please provide a
                      Bearer token.
    408Timeout:
      description: Request timeout
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: object
                properties:
                  code:
                    type: integer
                    example: 408
                  message:
                    type: string
                    example: Request timeout
    429RateLimit:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: object
                properties:
                  code:
                    type: integer
                    example: 429
                  message:
                    type: string
                    example: >-
                      Rate limit exceeded. Maximum 100 requests per minute per
                      user.
    500InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: object
                properties:
                  code:
                    type: integer
                    example: 500
                  message:
                    type: string
                    example: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Provide your API key as: Authorization: Bearer
        <api_key>

````