> ## 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.

# Sync Connection



## OpenAPI

````yaml https://api.aiql.io/openapi.json post /connections/{id}/sync
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}/sync:
    post:
      tags:
        - Connections
      summary: Sync Connection
      operationId: sync_connection_connections__id__sync_post
      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:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncRequest'
              default:
                dry_run: false
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncResponse'
        '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 POST https://api.aiql.io/connections/{id}/sync \
              -H "Authorization: Bearer $AIQL_API_KEY"
components:
  schemas:
    SyncRequest:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
          description: Run the sync without persisting new/changed documents.
          default: false
      type: object
      title: SyncRequest
    SyncResponse:
      properties:
        workflow_id:
          type: string
          title: Workflow Id
        run_id:
          type: string
          title: Run Id
        connection_id:
          type: string
          title: Connection Id
        workspace_id:
          type: string
          title: Workspace Id
        dry_run:
          type: boolean
          title: Dry Run
        status:
          type: string
          title: Status
          default: started
      type: object
      required:
        - workflow_id
        - run_id
        - connection_id
        - workspace_id
        - dry_run
      title: SyncResponse
    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

````