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

# Update Connection



## OpenAPI

````yaml https://api.aiql.io/openapi.json patch /connections/{id}
openapi: 3.1.0
info:
  title: aiql-api
  version: 0.1.0
servers:
  - url: https://api.aiql.io
security: []
tags:
  - name: Health
    description: Service health checks.
  - name: Workspaces
    description: Workspace management.
  - name: Ingestions
    description: Document ingestion pipeline.
  - name: Queries
    description: Natural-language queries.
  - name: Sources
    description: Ingested sources and their contents.
  - name: Requests
    description: Source addition/removal requests awaiting review.
  - name: Request Changes
    description: Individual source add/remove changes on a request.
  - name: Request Reviews
    description: Reviews of a request, including draft and submit.
  - name: Request Comments
    description: Comments on a request review.
  - name: Canvases
    description: Brainstorm canvases.
  - name: Dashboards
    description: Dashboards.
  - name: Presentations
    description: Slide presentations.
  - name: Tools
    description: Standalone convert/split/shape/extract tools.
  - name: Connectors
    description: Connector catalog and connect flows.
  - name: Connections
    description: Workspace connector connections.
paths:
  /connections/{id}:
    patch:
      tags:
        - Connections
      summary: Update Connection
      operationId: update_connection_connections__id__patch
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Id
        - name: AiQL-Workspace
          in: header
          required: true
          schema:
            type: string
            description: ID of the workspace the request operates on.
            title: Aiql-Workspace
          description: ID of the workspace the request operates on.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectionUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
        '401':
          description: 'Authentication failed: missing or invalid API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X PATCH https://api.aiql.io/connections/{id} \
              -H "Authorization: Bearer $AIQL_API_KEY"
components:
  schemas:
    ConnectionUpdate:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: New display name for the connection.
        root_folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Folder Id
          description: Google Drive root folder id.
        site_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Site Id
          description: SharePoint site id.
        drive_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Drive Id
          description: SharePoint drive id.
        include_shared_with_me:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Shared With Me
          description: 'SharePoint: also include items shared with the connected user.'
        user_filter:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: User Filter
          description: 'Microsoft Teams: user ids/UPNs to scope enumeration to.'
      type: object
      title: ConnectionUpdate
    Connection:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the connection.
        connector_type:
          type: string
          title: Connector Type
          description: Connector type this connection uses.
        name:
          type: string
          title: Name
          description: Display name of the connection.
        workspace_id:
          type: string
          title: Workspace Id
          description: Workspace the connection belongs to.
        credential_id:
          type: string
          title: Credential Id
          description: ID of the credential attached to this connection.
        config:
          additionalProperties: true
          type: object
          title: Config
          description: Connector-specific configuration for this connection.
        change_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Change Token
          description: Opaque cursor used for incremental sync.
        last_synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Synced At
          description: When the connection last completed a sync.
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: When the connection was created.
      type: object
      required:
        - id
        - connector_type
        - name
        - workspace_id
        - credential_id
      title: Connection
    ErrorResponse:
      type: object
      title: ErrorResponse
      properties:
        detail:
          type: string
          title: Detail
      required:
        - detail
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      description: API key passed as a Bearer token in the Authorization header.
      scheme: bearer

````