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

# Link Oauth2 Account

> Start an OAuth2 account linking process.
It will return a redirect url (as a string, instead of RedirectResponse) to the OAuth2 provider's authorization endpoint.



## OpenAPI

````yaml get /v1/linked-accounts/oauth2
openapi: 3.1.0
info:
  title: Aipolabs
  version: 0.0.1-beta.3
servers: []
security: []
paths:
  /v1/linked-accounts/oauth2:
    get:
      tags:
        - linked-accounts
      summary: Link Oauth2 Account
      description: >-
        Start an OAuth2 account linking process.

        It will return a redirect url (as a string, instead of RedirectResponse)
        to the OAuth2 provider's authorization endpoint.
      operationId: linked-accounts-link_oauth2_account
      parameters:
        - name: app_name
          in: query
          required: true
          schema:
            type: string
            title: App Name
        - name: linked_account_owner_id
          in: query
          required: true
          schema:
            type: string
            title: Linked Account Owner Id
        - name: after_oauth2_link_redirect_url
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: After Oauth2 Link Redirect Url
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                title: Response Linked-Accounts-Link Oauth2 Account
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API key for authentication
      in: header
      name: X-API-KEY

````