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

# Get the WhatsApp connection state of a channel

> While the channel waits to be paired, the response also carries the QR and pairing codes
currently shown by the provider, which rotate about every 45 seconds.



## OpenAPI

````yaml /api-referansi/openapi.json get /v1/channels/{id}/whatsapp/connection-state
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/channels/{id}/whatsapp/connection-state:
    get:
      tags:
        - ChannelWhatsapp
      summary: Get the WhatsApp connection state of a channel
      description: >-
        While the channel waits to be paired, the response also carries the QR
        and pairing codes

        currently shown by the provider, which rotate about every 45 seconds.
      operationId: channelWhatsapp.connectionState
      parameters:
        - name: id
          in: path
          required: true
          description: The channel identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      channel:
                        $ref: '#/components/schemas/ChannelResource'
                      state:
                        type: string
                        enum:
                          - open
                          - connecting
                          - close
                          - refused
                      qr_code:
                        type:
                          - string
                          - 'null'
                      pairing_code:
                        type:
                          - string
                          - 'null'
                    required:
                      - channel
                      - state
                      - qr_code
                      - pairing_code
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ChannelResource:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type: integer
        name:
          type: string
        type:
          $ref: '#/components/schemas/ChannelType'
        provider:
          type:
            - string
            - 'null'
        address:
          type: string
        website_domain:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/ChannelStatus'
        is_active:
          type: boolean
        ai_reply_mode:
          anyOf:
            - $ref: '#/components/schemas/AiReplyMode'
            - type: 'null'
        connection_error:
          type:
            - object
            - 'null'
          properties:
            code:
              type: string
            expected_address:
              type: string
            connected_address:
              type: string
            message:
              type: string
            detected_at:
              type: string
              format: date-time
          required:
            - code
            - expected_address
            - connected_address
            - message
            - detected_at
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - tenant_id
        - name
        - type
        - provider
        - address
        - website_domain
        - status
        - is_active
        - ai_reply_mode
        - connection_error
        - created_at
        - updated_at
      title: ChannelResource
    ChannelType:
      type: string
      enum:
        - whatsapp
        - instagram
        - website
        - telegram
      title: ChannelType
    ChannelStatus:
      type: string
      enum:
        - closed
        - waiting
        - open
      title: ChannelStatus
    AiReplyMode:
      type: string
      enum:
        - auto
        - semi_auto
        - closed
      title: AiReplyMode
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.