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

# Cancel connection sync

> Cancels an in-progress sync run. A run that already finished returns 409.



## OpenAPI

````yaml /api-reference/openapi.json post /workspaces/{workspaceId}/connections/{connectionId}/syncs/{syncId}/cancel
openapi: 3.1.0
info:
  title: Nvisy API
  summary: Document detection and redaction platform
  description: >-
    Nvisy provides intelligent detection of sensitive content in documents,
    redaction pipelines, and reviewer workflows. This API enables document
    upload, detection analysis, redaction, and collaborative review across your
    workspaces.
  termsOfService: https://nvisy.com/legal/terms-of-service
  contact:
    name: Nvisy Support
    url: https://nvisy.com
    email: hello@nvisy.com
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 0.1.0
servers: []
security: []
tags:
  - name: Health
    description: Service health checks
  - name: Capabilities
    description: Read-only reference data describing this deployment
  - name: Accounts
    description: Account management and profile operations
  - name: Identities
    description: 'Account sign-in methods: password and linked providers'
  - name: Avatars
    description: Public avatar image serving
  - name: Authentication
    description: Login, signup, and token management
  - name: Workspaces
    description: Workspace creation and management
  - name: Activities
    description: Workspace activity log and export
  - name: Documents
    description: Document upload, download, and management
  - name: Analytics
    description: Aggregate metrics over a workspace's documents
  - 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: Connection Syncs
    description: Connection synchronization runs
  - name: Providers
    description: Inference-provider configuration
  - name: Pipelines
    description: Redaction pipeline configuration
  - name: Detections
    description: Detection analysis and redaction
  - name: Redactions
    description: Redactions produced from a detection, with reviewer edits
  - name: Reviews
    description: Document reviews, the review queue, and their discussion
  - name: Policies
    description: Redaction policy configuration
  - name: Webhooks
    description: Webhook configuration
  - name: Notifications
    description: Account notification management
paths:
  /workspaces/{workspaceId}/connections/{connectionId}/syncs/{syncId}/cancel:
    post:
      tags:
        - Connection Syncs
      summary: Cancel connection sync
      description: >-
        Cancels an in-progress sync run. A run that already finished returns
        409.
      parameters:
        - in: path
          name: workspaceId
          description: Workspace identifier.
          required: true
          schema:
            description: Workspace identifier.
            type: string
            format: uuid
          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
        - in: path
          name: syncId
          description: Unique identifier of the sync run.
          required: true
          schema:
            description: Unique identifier of the sync run.
            type: string
            format: uuid
          style: simple
      responses:
        '200':
          description: A connection sync (import or export).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceConnectionSync'
        '401':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      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}$
    WorkspaceConnectionSync:
      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: >-
        The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
        view

        that [`Error`] renders to at the response boundary.


        It carries no builder logic — [`Error`] is the type handlers construct
        and

        thread through `Result`, and it builds an `ErrorResponse` directly in
        its

        `IntoResponse` impl. `context` and `status` are not part of the JSON
        body

        (`context` is logged, `status` sets the HTTP status line).


        [`Error`]: crate::response::Error
      type: object
      properties:
        message:
          description: User-friendly error message safe for client display.
          type: string
        name:
          description: The error name/type identifier.
          type: string
      required:
        - name
        - message
    SyncStatus:
      description: >-
        Defines the execution status of a connection sync run.


        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: >-
        How a connection sync run was initiated.


        Corresponds to the `SYNC_TRIGGER_TYPE` `PostgreSQL` enum. The axis is
        who

        initiated the run: the connection's own schedule, or anything else — a

        user, the SDK, an external automation (Zapier and the like). The latter
        is

        `OnDemand`, which covers every non-scheduled trigger, not only a human

        click.
      oneOf:
        - description: |-
            Triggered outside the schedule: a user, the SDK, or an external
            automation.
          type: string
          const: on_demand
        - description: Triggered by the connection's schedule.
          type: string
          const: scheduled
    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: its immutable id (the durable reference) plus a handle and optional

        avatar for display.
      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
        id:
          description: Immutable id of the account.
          type: string
          format: uuid
        username:
          description: Handle of the account (display).
          allOf:
            - $ref: '#/components/schemas/Handle'
      required:
        - id
        - username
    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]+)*$

````