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

# Connect Connector

> Create a connection to a connector. For OAuth2 connectors, returns an oauth2_required response with a connector_page_url to complete browser auth.



## OpenAPI

````yaml POST /v1/tools/connectors/{connector_id}/connect
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/tools/connectors/{connector_id}/connect:
    post:
      tags:
        - API v1
        - Tools
        - Tools Discovery
      summary: Connect Connector
      description: >-
        Create a connection to a connector. For OAuth2 connectors, returns an
        oauth2_required response with a connector_page_url to complete browser
        auth.
      operationId: Connect_connector_v1_tools_connectors__connector_id__connect_post
      parameters:
        - name: connector_id
          in: path
          required: true
          schema:
            type: string
            title: Connector Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectConnectorRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ConnectConnectorRequest:
      properties:
        name:
          type: string
          title: Name
          description: >-
            Human-readable name for this connection. Must be descriptive enough
            to distinguish from other connections to the same connector (e.g.,
            'Production Slack', 'Staging Jira').
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
          description: >-
            Pin this connection to a specific connector version. Leave None to
            use the connector's latest version.
        security:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Security
          description: >-
            Authentication credentials for this connection (WRITE-ONLY — never
            returned in responses). Structure depends on the connector's auth
            type: API key auth: {'authMethod': 'apiKey', 'apiKey': '...',
            'headerName': 'X-API-Key'}. OAuth2: {'authMethod': 'oauth2',
            'oauth2Token': {...}}.
        general_params:
          anyOf:
            - items:
                $ref: '#/components/schemas/GeneralParam'
              type: array
            - type: 'null'
          title: General Params
          description: >-
            Pre-filled parameters applied to all operations through this
            connection. Useful for setting common path/query/header params like
            workspace IDs or API versions.
          default: []
        headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Headers
          description: >-
            Custom HTTP headers to include in all API calls through this
            connection (WRITE-ONLY — never returned in responses). Used for
            additional authentication or routing headers.
        target_system_servers:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Target System Servers
          description: >-
            Override the connector's default server URLs. Each entry should have
            a 'url' field and optional 'description'. Use this to point the
            connection at a different environment (e.g., staging vs production).
          default: []
        access_scope:
          anyOf:
            - type: string
            - type: 'null'
          title: Access Scope
          description: >-
            Who can use this connection. 'personal' (default) restricts to the
            creating user. 'organizational' makes it available to all org
            members.
          default: personal
        is_service_account:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Service Account
          description: >-
            Set to True if this connection uses shared service account
            credentials rather than personal user credentials. Only meaningful
            with 'organizational' access scope.
          default: false
      type: object
      required:
        - name
      title: ConnectConnectorRequest
      description: |-
        Request model for creating a new connection to a connector.

        A connection binds a connector to your organization with specific
        authentication credentials and settings. The `security` and `headers`
        fields are write-only — they are accepted on create but never returned
        in any response for security reasons.

        For OAuth2 connectors, the API may return an oauth2_required response
        with a URL to complete browser-based authentication.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GeneralParam:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        location:
          type: string
          enum:
            - path
            - query
            - header
            - cookie
          title: Location
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
      type: object
      required:
        - name
        - description
        - location
      title: GeneralParam
    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

````