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

# Sync connection

> Imports an object from or exports a file to the connection. Returns the created sync; poll it for completion.



## OpenAPI

````yaml /api-reference/openapi.json post /workspaces/{workspaceSlug}/connections/{connectionId}/sync/
openapi: 3.1.0
info:
  title: Nvisy API
  summary: Document processing and annotation platform
  description: >-
    Nvisy provides intelligent document processing, annotation, and analysis
    capabilities. This API enables document upload, OCR processing, embedding
    generation, and semantic search across your document collections.
  termsOfService: https://nvisy.com/legal/terms-of-service
  contact:
    name: Nvisy Support
    url: https://nvisy.com
    email: hello@nvisy.com
  license:
    name: Proprietary
    url: https://nvisy.com/license
  version: 0.1.0
servers: []
security: []
tags:
  - name: Accounts
    description: Account management and profile operations
  - name: Authentication
    description: Login, signup, and token management
  - name: Workspaces
    description: Workspace creation and management
  - name: Files
    description: File upload, download, and management
  - name: Members
    description: Workspace member management
  - name: Invites
    description: Workspace invitation handling
  - name: API Tokens
    description: API token management
  - name: Connections
    description: External provider connections
  - name: Pipelines
    description: Redaction pipeline configuration
  - name: Pipeline Runs
    description: Pipeline run execution and review
  - name: Policies
    description: Redaction policy configuration
  - name: Webhooks
    description: Webhook configuration
  - name: Notifications
    description: Account notification management
  - name: Health
    description: Service health checks
paths:
  /workspaces/{workspaceSlug}/connections/{connectionId}/sync/:
    post:
      tags:
        - Connections
      summary: Sync connection
      description: >-
        Imports an object from or exports a file to the connection. Returns the
        created sync; poll it for completion.
      parameters:
        - in: path
          name: workspaceSlug
          description: URL-safe workspace identifier.
          required: true
          schema:
            description: URL-safe workspace identifier.
            type: string
          style: simple
        - in: path
          name: connectionId
          description: Opaque identifier of the connection.
          required: true
          schema:
            $ref: '#/components/schemas/ConnectionId'
            description: Opaque identifier of the connection.
          style: simple
      requestBody:
        description: >-
          Request payload to trigger a connection sync.


          The direction is determined by the connection's configured
          `sync_mode`.

          - Import connections need no body: the sync fetches every
          not-yet-imported
            object under the connection's root path.
          - Export connections push one workspace file (`file_id`) to one object
            `key`; both are required for export and ignored for import.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncConnection'
        required: true
      responses:
        '202':
          description: A connection sync (import or export).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionSync'
        '400':
          description: >-
            HTTP error response representation with security-conscious design.


            This struct contains all the information needed to serialize an
            error

            response, including the error name, message, HTTP status code,
            resource

            information, and user-friendly messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            HTTP error response representation with security-conscious design.


            This struct contains all the information needed to serialize an
            error

            response, including the error name, message, HTTP status code,
            resource

            information, and user-friendly messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            HTTP error response representation with security-conscious design.


            This struct contains all the information needed to serialize an
            error

            response, including the error name, message, HTTP status code,
            resource

            information, and user-friendly messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            HTTP error response representation with security-conscious design.


            This struct contains all the information needed to serialize an
            error

            response, including the error name, message, HTTP status code,
            resource

            information, and user-friendly messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: 'Expected request with `Content-Type: application/json`'
          content:
            text/plain:
              schema:
                type: string
        '422':
          description: Failed to deserialize the JSON body into the target type
          content:
            text/plain:
              schema:
                type: string
      security:
        - BearerAuth: []
components:
  schemas:
    ConnectionId:
      description: Opaque conn identifier (conn_<uuid>).
      type: string
      pattern: >-
        ^conn_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
    SyncConnection:
      description: >-
        Request payload to trigger a connection sync.


        The direction is determined by the connection's configured `sync_mode`.

        - Import connections need no body: the sync fetches every
        not-yet-imported
          object under the connection's root path.
        - Export connections push one workspace file (`file_id`) to one object
          `key`; both are required for export and ignored for import.
      type: object
      properties:
        fileId:
          description: The workspace file to export (export connections only).
          type: string
          format: uuid
        key:
          description: The destination object key for an export, relative to the root path.
          type: string
          maxLength: 1024
          minLength: 1
    ConnectionSync:
      description: A connection sync (import or export).
      type: object
      properties:
        attempt:
          description: 1-based attempt number; scheduled syncs may be retried on failure.
          type: integer
          format: int32
        completedAt:
          description: When the sync finished, if it has.
          type: string
          format: date-time
        connectionId:
          description: The connection this sync belongs to.
          allOf:
            - $ref: '#/components/schemas/ConnectionId'
        errorMessage:
          description: Failure reason when the sync failed; omitted otherwise.
          type: string
        id:
          description: Unique sync identifier.
          type: string
          format: uuid
        recordsSynced:
          description: Number of objects transferred so far.
          type: integer
          format: int64
        startedAt:
          description: When the sync started.
          type: string
          format: date-time
        status:
          description: Current status of the sync.
          allOf:
            - $ref: '#/components/schemas/SyncStatus'
        triggerType:
          description: How the sync was triggered.
          allOf:
            - $ref: '#/components/schemas/SyncTriggerType'
        triggeredBy:
          description: Account that triggered the sync.
          allOf:
            - $ref: '#/components/schemas/AccountRef'
      required:
        - id
        - connectionId
        - triggeredBy
        - triggerType
        - status
        - recordsSynced
        - attempt
        - startedAt
    ErrorResponse:
      description: |-
        HTTP error response representation with security-conscious design.

        This struct contains all the information needed to serialize an error
        response, including the error name, message, HTTP status code, resource
        information, and user-friendly messages.
      type: object
      properties:
        message:
          description: User-friendly error message safe for client display
          type: string
        name:
          description: The error name/type identifier
          type: string
        resource:
          description: The resource that the error relates to (optional, set by handler)
          type: string
        suggestion:
          description: Helpful suggestion for resolving the error (optional)
          type: string
        validation:
          description: Validation error details for field-specific errors
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorDetail'
      required:
        - name
        - message
    SyncStatus:
      description: >-
        Defines the execution status of a connection sync run.


        This enumeration corresponds to the `SYNC_STATUS` PostgreSQL enum and
        tracks

        the state of an individual synchronization run.
      oneOf:
        - description: Sync is queued
          type: string
          const: pending
        - description: Sync is in progress
          type: string
          const: running
        - description: Sync finished successfully
          type: string
          const: completed
        - description: Sync failed with error
          type: string
          const: failed
        - description: Sync was cancelled
          type: string
          const: cancelled
    SyncTriggerType:
      description: >-
        Defines how a connection sync run was initiated.


        This enumeration corresponds to the `SYNC_TRIGGER_TYPE` PostgreSQL enum
        and is used

        to track whether a run was manually triggered, scheduled, or triggered
        by a webhook.
      oneOf:
        - description: Manually triggered by user
          type: string
          const: manual
        - description: Triggered by schedule
          type: string
          const: scheduled
        - description: Triggered by an inbound webhook
          type: string
          const: webhook
    AccountRef:
      description: >-
        Public reference to the account behind a resource — whoever created it,

        uploaded it, triggered it, or performed it.


        Reused across resource responses so an account is always presented the
        same

        way: a handle plus an optional avatar.
      type: object
      properties:
        avatarUrl:
          description: Serve path of the account's avatar, when set.
          type: string
        displayName:
          description: Human-readable display name, when set.
          type: string
        username:
          description: Handle of the account.
          allOf:
            - $ref: '#/components/schemas/Handle'
      required:
        - username
    ValidationErrorDetail:
      description: Validation error details for field-specific errors.
      type: object
      properties:
        code:
          description: Error code for the validation failure
          type: string
        field:
          description: Field name that failed validation
          type: string
        message:
          description: Human-readable error message
          type: string
        params:
          description: Additional parameters related to the validation error
          type: object
          additionalProperties: true
      required:
        - field
        - code
        - message
    Handle:
      description: >-
        Lowercase, dash-separated identifier used in URLs and as account
        handles.
      type: string
      maxLength: 32
      minLength: 3
      pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$

````