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

# Poll the current state of a Config Flow

> Used by the frontend to detect when an OAuth2 callback has been received.



## OpenAPI

````yaml https://portal.unicontrol.me/v1/openapi get /v1/config_flow/{flowId}
openapi: 3.1.0
info:
  title: Unicontrol API
  description: Welcome
  version: 1.0.0
servers:
  - url: http://0.0.0.0:3000
    description: Local Server
  - url: https://portal.test.flexhome.casa
    description: Development
  - url: https://portal.unicontrol.me
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/config_flow/{flowId}:
    get:
      tags:
        - Config Flow
      summary: Poll the current state of a Config Flow
      description: >-
        Used by the frontend to detect when an OAuth2 callback has been
        received.
      operationId: getV1Config_flowByFlowId
      parameters:
        - in: path
          name: flowId
          required: true
          schema:
            type: string
          description: ID do flow
      responses:
        '200':
          description: Current flow state
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    description: >-
                      Tipo do passo atual (ex: form, external, abort,
                      create_entry)
                  flowId:
                    type: string
                  handler:
                    type: string
                  stepId:
                    type: string
                  errors:
                    type: object
                    nullable: true
                  data_schema:
                    type: array
                    items:
                      path: /v1/logto/webhook
                    nullable: true
                  url:
                    type: string
                    nullable: true
                    description: URL OAuth2 para redirecionamento externo
              example:
                type: external
                flowId: flow_abc123
                handler: tuya
                stepId: wait_oauth
        '401':
          description: Não autenticado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: unauthorized
        '404':
          description: Recurso não encontrado
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              example:
                message: not found
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````