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

# Get Sync Draft

> Retrieve a sync draft with the sync as it is now and as approval would
leave it. Send its `draftVersion` and `resourceVersion` to approve it.



## OpenAPI

````yaml https://api.hightouch.io/api/swagger.json get /syncs/{syncId}/drafts/{draftId}
openapi: 3.0.0
info:
  title: Hightouch API
  version: 1.0.0
  description: Hightouch Public Rest API to access syncs, models, sources and destinations
  contact:
    name: Hightouch
    url: https://hightouch.com
servers:
  - url: https://api.hightouch.com/api/v1
security: []
paths:
  /syncs/{syncId}/drafts/{draftId}:
    get:
      summary: Get Sync Draft
      description: |-
        Retrieve a sync draft with the sync as it is now and as approval would
        leave it. Send its `draftVersion` and `resourceVersion` to approve it.
      operationId: GetSyncDraft
      parameters:
        - description: The id of the sync
          in: path
          name: syncId
          required: true
          schema:
            type: number
            format: double
        - description: The id of the draft
          in: path
          name: draftId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncDraftDetail'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
      security:
        - bearerAuth: []
components:
  schemas:
    SyncDraftDetail:
      properties:
        id:
          type: string
          description: The draft's id
        syncId:
          type: string
          description: The id of the sync the draft changes
        operation:
          type: string
          enum:
            - create
            - update
          description: '`create` publishes a new sync, `update` changes an existing one'
        status:
          $ref: '#/components/schemas/SyncDraftStatus'
        requestedBy:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          nullable: true
          description: The user who submitted the draft
        requestedApprovers:
          items:
            $ref: '#/components/schemas/UserReference'
          type: array
          description: The users asked to review the draft
        requestComment:
          type: string
          nullable: true
          description: The comment the requester left for reviewers
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the draft was created
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the draft last changed
        reviewedBy:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          nullable: true
          description: >-
            The user who approved or rejected the draft. With an API key, this
            is the

            user who owns the key.
        reviewedAt:
          type: string
          format: date-time
          nullable: true
          description: The timestamp when the draft was approved or rejected
        reviewMetadata:
          properties:
            extId:
              type: string
          required:
            - extId
          type: object
          nullable: true
          description: The metadata sent with the approval or rejection
        current:
          allOf:
            - $ref: '#/components/schemas/Sync'
          nullable: true
          description: The sync as it is now, or null for a draft that creates the sync
        proposed:
          allOf:
            - $ref: '#/components/schemas/Sync'
          nullable: true
          description: >-
            The sync as it will be after approval, or null once the draft is
            closed
        changedFields:
          items:
            type: string
          type: array
          description: The top-level sync fields that the draft changes
        draftVersion:
          type: string
          description: >-
            Send as `expectedDraftVersion` to approve exactly this version of
            the draft
        resourceVersion:
          type: string
          description: >-
            Send as `expectedResourceVersion` to approve only if the sync has
            not changed
        relatedDrafts:
          items:
            $ref: '#/components/schemas/RelatedDraft'
          type: array
      required:
        - id
        - syncId
        - operation
        - status
        - requestedBy
        - requestedApprovers
        - requestComment
        - createdAt
        - updatedAt
        - reviewedBy
        - reviewedAt
        - reviewMetadata
        - current
        - proposed
        - changedFields
        - draftVersion
        - resourceVersion
        - relatedDrafts
      type: object
      additionalProperties: false
    SyncDraftStatus:
      type: string
      enum:
        - pending
        - approved
        - rejected
        - canceled
      description: |-
        The state of a sync draft. New values may be added, so treat an unknown
        value as closed.
    UserReference:
      description: >-
        The Hightouch user who created or last updated a resource. Changes made
        with

        an API key are attributed to the user who created the key.
      properties:
        id:
          type: number
          format: double
          description: The user's id
        name:
          type: string
          description: The user's name
        email:
          type: string
          description: The user's email address
      required:
        - id
        - name
        - email
      type: object
      additionalProperties: false
    Sync:
      description: >-
        Syncs define how data from models are mapped to destinations. Each time
        a

        sync runs, Hightouch calculates the rows that have changed since the
        last

        run, and syncs them to Sync's destination.
      properties:
        id:
          type: number
          format: double
          description: The sync's id
        slug:
          type: string
          description: The sync's slug
        workspaceId:
          type: number
          format: double
          description: The id of the workspace that the sync belongs to
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the sync was created
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the sync was last updated
        createdBy:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          nullable: true
          description: The user who created the sync, or null if no user was recorded
        updatedBy:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          nullable: true
          description: The user who last updated the sync, or null if no user was recorded
        destinationId:
          type: number
          format: double
          description: The id of the Destination that sync is connected to
        modelId:
          type: number
          format: double
          description: The id of the Model that sync is connected to
        configuration:
          properties: {}
          additionalProperties: {}
          type: object
          description: >-
            The sync's configuration. This specifies how data is mapped, among
            other

            configuration.


            The schema depends on the destination type.


            For a sync bound to a sync template this is the effective
            configuration:

            the template's configuration with this sync's
            `syncTemplateOverrides`

            applied.


            Consumers should NOT make assumptions on the contents of the

            configuration. It may change as Hightouch updates its internal code.
        schedule:
          properties:
            schedule:
              anyOf:
                - $ref: '#/components/schemas/IntervalSchedule'
                - $ref: '#/components/schemas/CronSchedule'
                - $ref: '#/components/schemas/VisualCronSchedule'
                - $ref: '#/components/schemas/DBTSchedule'
            type:
              type: string
          required:
            - type
          type: object
          nullable: true
          description: >-
            The scheduling configuration. It can be triggered based on several
            ways:


            Interval: the sync will be triggered based on certain
            interval(minutes/hours/days/weeks)


            Cron: the sync will be triggered based on cron expression
            https://en.wikipedia.org/wiki/Cron.


            Visual: the sync will be triggered based a visual cron configuration
            on UI


            DBT-cloud: the sync will be triggered based on a dbt cloud job


            Match Booster (type "match_booster"): the sync will be triggered
            after each

            Match Booster enrichment run of its model completes. Requires the
            model to

            have Match Booster enabled, and takes no inner schedule payload.
        status:
          $ref: '#/components/schemas/SyncStatus'
          description: The overall status of the sync
        disabled:
          type: boolean
          description: Whether the sync has been disabled by the user.
        lastRunAt:
          type: string
          format: date-time
          nullable: true
          description: The timestamp of the last sync run
        referencedColumns:
          items:
            type: string
          type: array
          description: The reference column that sync depends on to sync data from source
        primaryKey:
          type: string
          description: The primary key that sync uses to identify data from source
        externalSegment:
          properties:
            id:
              type: string
          type: object
          description: >-
            The user facing ID for any created lists or audiences in the sync
            destination
        tags:
          properties: {}
          additionalProperties:
            type: string
          type: object
          description: The tags of the sync
        syncTemplateId:
          type: number
          format: double
          nullable: true
          description: >-
            The id of the sync template this sync is bound to, or null when the
            sync

            owns its configuration. A bound sync takes its destination and

            configuration from the template and follows later changes to the

            template; `configuration` is the effective merged configuration and

            `syncTemplateOverrides` holds this sync's own values.
        syncTemplateOverrides:
          properties: {}
          additionalProperties: {}
          type: object
          nullable: true
          description: >-
            The template configuration fields this sync overrides, keyed by

            configuration field path (for example "externalIdMapping" or

            "target.schema"). Null when the sync is not bound to a sync template
            or

            has no overrides.
      required:
        - id
        - slug
        - workspaceId
        - createdAt
        - updatedAt
        - createdBy
        - updatedBy
        - destinationId
        - modelId
        - configuration
        - schedule
        - status
        - disabled
        - lastRunAt
        - referencedColumns
        - primaryKey
        - externalSegment
        - tags
        - syncTemplateId
        - syncTemplateOverrides
      type: object
      additionalProperties: false
    RelatedDraft:
      description: >-
        A pending draft on a resource the sync depends on. Approving the sync
        draft

        does not approve it.
      properties:
        id:
          type: string
        modelId:
          type: string
        operation:
          type: string
          enum:
            - create
            - update
        status:
          $ref: '#/components/schemas/SyncDraftStatus'
      required:
        - id
        - modelId
        - operation
        - status
      type: object
      additionalProperties: false
    IntervalSchedule:
      properties:
        interval:
          $ref: '#/components/schemas/Interval'
      required:
        - interval
      type: object
      additionalProperties: false
    CronSchedule:
      properties:
        expression:
          type: string
      required:
        - expression
      type: object
      additionalProperties: false
    VisualCronSchedule:
      properties:
        expressions:
          items:
            properties:
              days:
                $ref: '#/components/schemas/Record_Day.boolean-or-undefined_'
              time:
                type: string
            required:
              - days
              - time
            type: object
          type: array
      required:
        - expressions
      type: object
      additionalProperties: false
    DBTSchedule:
      properties:
        account:
          properties:
            id:
              type: string
          required:
            - id
          type: object
        job:
          properties:
            id:
              type: string
          required:
            - id
          type: object
      required:
        - account
        - job
      type: object
      additionalProperties: false
    SyncStatus:
      description: SyncStatus
      enum:
        - disabled
        - pending
        - cancelled
        - failed
        - queued
        - success
        - warning
        - querying
        - processing
        - reporting
        - interrupted
      type: string
    Interval:
      properties:
        unit:
          $ref: '#/components/schemas/IntervalUnit'
        quantity:
          type: number
          format: double
      required:
        - unit
        - quantity
      type: object
      additionalProperties: false
    Record_Day.boolean-or-undefined_:
      properties:
        monday:
          type: boolean
        tuesday:
          type: boolean
        wednesday:
          type: boolean
        thursday:
          type: boolean
        friday:
          type: boolean
        saturday:
          type: boolean
        sunday:
          type: boolean
      type: object
      description: Construct a type with a set of properties K of type T
    IntervalUnit:
      enum:
        - minute
        - hour
        - day
        - week
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer

````