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

# Enable a Sync

> Start a Sync for a Connected User with a specific configuration

Upon sending this request, the sync will immediately start with the account that the user has connected.

After the initial sync has completed, you will receive a `sync_completed` webhook event and records created / updated after the initial sync will send `record_created` or `record_updated` webhook events. [Learn more about the Sync Lifecycle](/managed-sync/sync-api).

<Accordion title="Using Multi-Account Authorization">
  If a user has connected multiple accounts of the same integration type (using [Multi-Account Authorization](/apis/api-reference/multi-account-authorization)), you can specify which account to use for syncing by providing the optional `credentialId` parameter in the request body.

  You can retrieve the list of connected credentials from the `allCredentials` array returned by the [/sdk/me](/apis/api-reference/multi-account-authorization#getuser-%3E-paragonuser) endpoint or `paragon.getUser()` in the SDK.

  <Info>
    If `credentialId` is not specified and the user has multiple connected accounts, the default credential (the oldest active credential) will be used.
  </Info>
</Accordion>


## OpenAPI

````yaml post /api/syncs
openapi: 3.0.0
info:
  title: Paragon Sync API
  description: API for managing Syncs and permissions for Connected Users
  version: 1.0.0
servers:
  - url: https://sync.useparagon.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/syncs:
    post:
      summary: Enable a Sync
      description: Start a Sync for a Connected User with a specific configuration
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnableSyncRequest'
      responses:
        '200':
          description: Sync successfully enabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewSyncResponse'
        '401':
          description: Unauthorized
        '404':
          description: Source not found
components:
  schemas:
    EnableSyncRequest:
      type: object
      required:
        - integration
        - pipeline
      properties:
        integration:
          type: string
          description: The integration to use for the sync
          example: googledrive
        pipeline:
          type: string
          description: >-
            The type of Synced Object to sync from the integration. You can find
            the list of supported values in [Synced
            Objects](/managed-sync/synced-objects).
          example: files
        configuration:
          type: object
          description: >-
            The configuration for this sync. For example, the [folder
            ID](/managed-sync/integrations/googledrive) to sync from Google
            Drive. Learn more about the configuration options supported for each
            integration in the [Integrations
            Reference](/managed-sync/integrations/amazons3).
          additionalProperties: true
        configurationName:
          type: string
          description: >-
            A unique name for this sync configuration. Set this field to a
            unique value when creating multiple syncs for the same integration
            and pipeline.
        credentialId:
          type: string
          description: >-
            The ID of the credential to use for syncing data. Use this when your
            user has connected multiple accounts for the same integration
            (Multi-Account Authorization). See [Multi-Account
            Authorization](/apis/api-reference/multi-account-authorization) for
            details on retrieving credential IDs.


            If not provided, the default credential (oldest active credential)
            will be used.
    NewSyncResponse:
      type: object
      required:
        - id
        - userId
        - integration
        - pipeline
        - projectId
        - status
      properties:
        id:
          type: string
          description: Unique identifier for the sync
          example: a11347bd-d510-5489-9068-e5fded55a28c
        userId:
          type: string
          description: ID of the Connected User who enabled the Sync
          example: your-user-id
        integration:
          type: string
          description: The integration to use for the sync
          example: googledrive
        pipeline:
          type: string
          description: The type of Synced Object being used in this Sync
          example: files
        projectId:
          type: string
          description: ID of the Paragon Project that this Sync is associated with
          example: 1ea8024c-23a7-4885-b925-c50d0faf9318
        status:
          $ref: '#/components/schemas/StatusField'
    StatusField:
      type: string
      enum:
        - INITIALIZING
        - ACTIVE
        - IDLE
        - DISABLED
        - ERRORED
      description: "Current state of Sync activity.\nPossible values:\n- `INITIALIZING`: The Sync has just been created and is pending its first run.\n- `ACTIVE`: The Sync is actively fetching new data.\n- `IDLE`: The Sync has completed and is watching for updates to synced data.\n\t- Check `summary.lastSyncedAt` to see if the sync has successfully completed.\n- `DISABLED`: The Sync has been paused temporarily by the [Disable a Sync](/managed-sync/api/disable-sync) endpoint.\n- `ERRORED`: The Sync has been suspended due to an error. Check [Webhook Events](/managed-sync/webhooks) for additional error details."
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Paragon User Token. Add to the Authorization header of your requests.

````