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

# Create connected account (provider dispatch)

> Creates a connection by delegating to the auth config’s provider (local, Composio, …). Each provider implements its own behavior.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/connected_accounts
openapi: 3.0.0
info:
  title: Flowra API (API Key Endpoints)
  description: >-
    **Flowra** is an AI-powered platform for building agents, workflows, and
    integrations.


    ### Capabilities

    - **Tools & Toolkits** – Define and group tools for agents and workflows.

    - **Workflows** – Orchestrate steps and automate processes.

    - **Triggers** – Schedule or event-based execution.

    - **Auth & Connections** – OAuth, API keys, and connected accounts.

    - **MCP** – Model Context Protocol server integration.

    - **Knowledge / RAG** – Add files and URLs for retrieval-augmented
    generation.


    ### Authentication

    Use the **x-api-key** header with a project API key to access endpoints that
    support API Key auth. Create and manage API keys in the dashboard under your
    project settings.


    Only endpoints that support API Key authentication via the @ApiKeyEnabled()
    decorator.


    Send x-api-key (required). On multi-tenant endpoints, optionally send
    x-username to act as an external user.
  version: '1.0'
  contact:
    name: Flowra
    url: https://flowra.dev
servers:
  - url: https://flowra.dev
    description: Flowra API
security: []
tags:
  - name: Users
    description: User profile
  - name: External Users
    description: End-user identities inside a project (x-username)
  - name: Auth Configs
    description: OAuth and API key configs for toolkits
  - name: Connected Accounts
    description: OAuth connected accounts and link creation
  - name: Toolkits
    description: List and search toolkits
  - name: Tools
    description: List, execute, and manage tools
  - name: Skills
    description: Browse, create, import, and install skills
  - name: Workflow & Agent
    description: Create, run, and inspect workflows and agents
  - name: Triggers
    description: Schedule and event-based trigger instances
  - name: Chat
    description: Threads and streaming agent runs
  - name: File
    description: Upload, list, and download files
  - name: Knowledge
    description: RAG knowledge collections
  - name: Table
    description: Collections and documents
  - name: Sandbox
    description: Ephemeral and durable code sandboxes
  - name: Browser
    description: Live browser sessions and view
  - name: LLM
    description: List AI models and generate completions
  - name: MCP
    description: MCP server management
  - name: usage
    description: Credit balance and usage ledger for the project API key
paths:
  /api/v1/connected_accounts:
    post:
      tags:
        - Connected Accounts
      summary: Create connected account (provider dispatch)
      description: >-
        Creates a connection by delegating to the auth config’s provider (local,
        Composio, …). Each provider implements its own behavior.
      operationId: ConnectedAccountsController_createConnectedAccount
      parameters:
        - name: x-username
          in: header
          required: false
          description: >-
            External user (end user) to act as. Optional — if omitted, Flowra
            uses the project’s default external user. Send a stable username
            (e.g. customer_alice) only when you need another end-user context.
          schema:
            type: string
            default: (project default user)
          example: customer_alice
      requestBody:
        required: true
        description: Auth config id and connection state; routed to the matching provider.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectedAccountDto'
      responses:
        '201':
          description: Provider-specific result (e.g. redirect URI for Composio initiate).
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateConnectedAccountResponseDtoSuccessResponse
      security:
        - x-api-key: []
        - x-api-key: []
          x-username: []
components:
  schemas:
    CreateConnectedAccountDto:
      type: object
      properties:
        authConfig:
          $ref: '#/components/schemas/CreateConnectedAccountAuthConfigDto'
        connection:
          $ref: '#/components/schemas/CreateConnectedAccountConnectionDto'
        validateCredentials:
          type: boolean
          description: Validate credentials flag
          example: true
          default: false
        connectedAccountId:
          type: string
          description: Internal Flowra connected account id
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        consentLinkToken:
          type: string
          description: >-
            Consent link token (`oauth:consent:v1:*`). Used after the user
            returns from `/connect/:token`.
          example: oauth:consent:v1:abc123
      required:
        - authConfig
        - connection
    CreateConnectedAccountResponseDtoSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Success status
          example: true
        message:
          type: string
          description: Success message
          example: Operation completed successfully
        data:
          type: object
          properties:
            id:
              type: string
              description: Connected account ID
              example: account_123
            connectionData:
              type: object
              properties:
                authScheme:
                  enum:
                    - OAUTH1
                    - OAUTH2
                    - S2S_OAUTH2
                    - API_KEY
                    - BASIC
                    - BEARER_TOKEN
                    - BILLCOM_AUTH
                    - GOOGLE_SERVICE_ACCOUNT
                    - NO_AUTH
                    - BASIC_WITH_JWT
                    - CALCOM_AUTH
                    - SERVICE_ACCOUNT
                    - SAML
                    - DCR_OAUTH
                    - COOKIE
                    - WHATSAPP_QR
                  type: string
                  description: Authentication scheme
                  example: OAUTH2
                val:
                  type: object
                  description: >-
                    State value - connection/credentials data (Composio);
                    structure depends on auth scheme and toolkit
                  additionalProperties: true
              required:
                - authScheme
                - val
            status:
              enum:
                - INITIALIZING
                - INITIATED
                - ACTIVE
                - FAILED
                - EXPIRED
                - INACTIVE
              type: string
              description: Connection status
              example: INITIALIZING
            redirectUrl:
              type: string
              description: Redirect URL
              example: https://example.com/redirect
            deprecated:
              type: object
              properties:
                uuid:
                  type: string
                  description: UUID of the connected account
                  example: 123e4567-e89b-12d3-a456-426614174000
                authConfigUuid:
                  type: string
                  description: Auth config UUID
                  example: 123e4567-e89b-12d3-a456-426614174001
              required:
                - uuid
                - authConfigUuid
          required:
            - id
            - connectionData
            - status
            - redirectUrl
            - deprecated
          example:
            id: account_123
            connectionData:
              authScheme: OAUTH2
              val: {}
            status: INITIALIZING
            redirectUrl: https://example.com/redirect
            deprecated:
              uuid: 123e4567-e89b-12d3-a456-426614174000
              authConfigUuid: 123e4567-e89b-12d3-a456-426614174001
      required:
        - success
        - message
        - data
    CreateConnectedAccountAuthConfigDto:
      type: object
      properties:
        id:
          type: string
          description: Auth config ID
          example: auth_config_123
      required:
        - id
    CreateConnectedAccountConnectionDto:
      type: object
      properties:
        state:
          $ref: '#/components/schemas/CreateConnectedAccountConnectionStateDto'
        eUID:
          type: string
          description: User ID
          example: user_123
        callbackUrl:
          type: string
          description: Callback URL
          example: https://example.com/callback
      required:
        - state
        - eUID
    CreateConnectedAccountConnectionStateDto:
      type: object
      properties:
        authScheme:
          enum:
            - OAUTH1
            - OAUTH2
            - S2S_OAUTH2
            - API_KEY
            - BASIC
            - BEARER_TOKEN
            - BILLCOM_AUTH
            - GOOGLE_SERVICE_ACCOUNT
            - NO_AUTH
            - BASIC_WITH_JWT
            - CALCOM_AUTH
            - SERVICE_ACCOUNT
            - SAML
            - DCR_OAUTH
            - COOKIE
            - WHATSAPP_QR
          type: string
          description: Authentication scheme
          example: OAUTH2
        val:
          type: object
          description: >-
            State value - connection/credentials data (Composio); structure
            depends on auth scheme and toolkit
          additionalProperties: true
      required:
        - authScheme
        - val
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Project API key. Create and manage keys in the dashboard under Project →
        API Keys. Send as header: x-api-key: <your-key>
    x-username:
      type: apiKey
      in: header
      name: x-username
      description: >-
        Optional. External user username. If omitted, Flowra uses the project’s
        default external user. Send as header: x-username: <username>

````

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