> ## 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 a new auth link session

> Generates a one-time URL to start the OAuth flow. Send your end users to this URL so they can sign in with the provider (e.g. Google, Slack) and connect their account to your project. After they complete the flow, the account appears in the connected accounts list.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/connected_accounts/link
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.


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


    Send x-api-key (required). On multi-tenant endpoints, optionally send
    x-username (defaults to the project’s default 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
paths:
  /api/v1/connected_accounts/link:
    post:
      tags:
        - Connected Accounts
      summary: Create a new auth link session
      description: >-
        Generates a one-time URL to start the OAuth flow. Send your end users to
        this URL so they can sign in with the provider (e.g. Google, Slack) and
        connect their account to your project. After they complete the flow, the
        account appears in the connected accounts list.
      operationId: ConnectedAccountsController_createConnectedAccountLink
      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: Connected account link creation data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectedAccountLinkDto'
      responses:
        '201':
          description: Successfully created auth link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateConnectedAccountLinkResponseDto'
      security:
        - x-api-key: []
        - x-api-key: []
          x-username: []
components:
  schemas:
    CreateConnectedAccountLinkDto:
      $ref: '#/components/schemas/CreateConnectedAccountLinkDto'
      type: object
      properties:
        authConfigId:
          type: string
          description: Auth configuration ID
          example: auth_config_123
        callbackUrl:
          type: string
          description: Callback URL
          example: https://myapp.com/callback
        browserSessionId:
          type: string
          description: >-
            Browser session id for BROWSER_SESSION: reuse an existing chat
            session id, or omit to auto-generate a standalone session UUID.
          example: 550e8400-e29b-41d4-a716-446655440000
        connectionData:
          description: Connection data
          allOf:
            - $ref: '#/components/schemas/ConnectedAccountConnectionValDto'
      required:
        - authConfigId
    CreateConnectedAccountLinkResponseDto:
      $ref: '#/components/schemas/CreateConnectedAccountLinkResponseDto'
      type: object
      properties:
        linkToken:
          type: string
          description: Link token for authentication
          example: link_token_123456789
        redirectUrl:
          type: string
          description: Redirect URL for user authentication
          example: >-
            https://auth.composio.dev/oauth/authorize?client_id=123&redirectUri=https://myapp.com/callback
        expiresAt:
          type: string
          description: Expiration timestamp for the link
          example: '2024-12-31T23:59:59Z'
        connectedAccountId:
          type: string
          description: Connected account ID
          example: con_123456789
        browserSessionId:
          type: string
          description: >-
            For BROWSER_SESSION: session id used for the live browser viewer
            (auto-generated UUID if omitted in the request).
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - redirectUrl
  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>

````