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

# Update Sync Template

> Update an existing sync template

Patch a sync template based on its Hightouch ID. The `destinationId` of a
sync template cannot be changed after creation. Syncs created from the
template pick up a new `configuration` on their next run; a new
`overrideConfig` replaces the previous one and applies to the next write
of each sync's `syncTemplateOverrides`.



## OpenAPI

````yaml https://api.hightouch.io/api/swagger.json patch /sync-templates/{syncTemplateId}
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:
  /sync-templates/{syncTemplateId}:
    patch:
      summary: Update Sync Template
      description: >-
        Update an existing sync template


        Patch a sync template based on its Hightouch ID. The `destinationId` of
        a

        sync template cannot be changed after creation. Syncs created from the

        template pick up a new `configuration` on their next run; a new

        `overrideConfig` replaces the previous one and applies to the next write

        of each sync's `syncTemplateOverrides`.
      operationId: UpdateSyncTemplate
      parameters:
        - description: The sync template's ID
          in: path
          name: syncTemplateId
          required: true
          schema:
            type: number
            format: double
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncTemplateUpdate'
            example:
              name: Salesforce Contacts Template (v2)
              schedulePaused: true
              overrideConfig:
                mappings:
                  overridable: true
                externalIdMapping:
                  overridable: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/SyncTemplate'
                  - $ref: '#/components/schemas/ValidateErrorJSON'
                  - $ref: '#/components/schemas/InternalServerError'
              examples:
                Example 1:
                  value:
                    id: 1
                    name: Salesforce Contacts Template (v2)
                    workspaceId: 1
                    createdAt: '2022-12-12T22:46:57.618Z'
                    updatedAt: '2022-12-15T20:23:22.319Z'
                    modelId: 42
                    destinationId: 17
                    configuration:
                      mode: upsert
                      object: Contact
                      externalIdMapping:
                        from: email
                        to: Email
                      mappings: []
                      configVersion: 1
                    schedule: null
                    schedulePaused: true
                    tags: {}
                    overrideConfig:
                      mappings:
                        overridable: true
                      externalIdMapping:
                        overridable: true
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '422':
          description: Validation Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateErrorJSON'
        '500':
          description: Something went wrong
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    SyncTemplateUpdate:
      description: >-
        The input for updating a Sync Template. `destinationId` cannot be
        changed

        after creation.
      properties:
        name:
          type: string
          description: The sync template's name
        configuration:
          properties: {}
          additionalProperties: {}
          type: object
          description: |-
            The sync template's configuration. The schema depends on the
            destination type.

            Consumers should NOT make assumptions on the contents of the
            configuration. It may change as Hightouch updates its internal code.
        description:
          type: string
          nullable: true
          description: The sync template's description
        modelId:
          type: number
          format: double
          description: The id of the parent Model that the sync template is connected to
        schedule:
          properties: {}
          additionalProperties: {}
          type: object
          nullable: true
          description: |-
            The sync template's schedule. May be null if the template does not
            impose a schedule on its child syncs.
        schedulePaused:
          type: boolean
          description: Whether the sync template's schedule is paused
        tags:
          properties: {}
          additionalProperties:
            type: string
          type: object
          description: The tags of the sync template
        matchboosterRegion:
          type: string
          nullable: true
          description: |-
            Match Booster region for syncs created from this template.
            Null means inherit the model's single-region default at runtime.
        overrideConfig:
          properties: {}
          additionalProperties:
            $ref: '#/components/schemas/SyncTemplateOverrideOption'
          type: object
          nullable: true
          description: >-
            Which configuration fields syncs created from this template may
            override,

            keyed by configuration field path (for example "externalIdMapping"
            or

            "target.schema"). A field is unlocked when listed with

            `overridable: true`; every other field is locked to the template's
            value.

            Null when no field is overridable.
      type: object
      additionalProperties: false
    SyncTemplate:
      description: |-
        A sync template defines a reusable sync configuration that can be shared
        across multiple syncs. User Groups can be granted access to
        templates so users can create syncs from them without seeing the raw
        destination credentials.
      properties:
        id:
          type: number
          format: double
          description: The sync template's id
        name:
          type: string
          description: The sync template's name
        description:
          type: string
          nullable: true
          description: The sync template's description
        workspaceId:
          type: number
          format: double
          description: The id of the workspace that the sync template belongs to
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the sync template was created
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the sync template was last updated
        modelId:
          type: number
          format: double
          description: The id of the parent Model that the sync template is connected to
        destinationId:
          type: number
          format: double
          description: |-
            The id of the Destination that the sync template is connected to.
            Cannot be changed after creation.
        configuration:
          properties: {}
          additionalProperties: {}
          type: object
          description: |-
            The sync template's configuration. The schema depends on the
            destination type.

            Consumers should NOT make assumptions on the contents of the
            configuration. It may change as Hightouch updates its internal code.
        schedule:
          properties: {}
          additionalProperties: {}
          type: object
          nullable: true
          description: |-
            The sync template's schedule. May be null if the template does not
            impose a schedule on its child syncs.
        schedulePaused:
          type: boolean
          description: Whether the sync template's schedule is paused
        tags:
          properties: {}
          additionalProperties:
            type: string
          type: object
          description: The tags of the sync template
        matchboosterRegion:
          type: string
          nullable: true
          description: |-
            Match Booster region for syncs created from this template.
            Null means inherit the model's single-region default at runtime.
        overrideConfig:
          properties: {}
          additionalProperties:
            $ref: '#/components/schemas/SyncTemplateOverrideOption'
          type: object
          nullable: true
          description: >-
            Which configuration fields syncs created from this template may
            override,

            keyed by configuration field path (for example "externalIdMapping"
            or

            "target.schema"). A field is unlocked when listed with

            `overridable: true`; every other field is locked to the template's
            value.

            Null when no field is overridable.
      required:
        - id
        - name
        - workspaceId
        - createdAt
        - updatedAt
        - modelId
        - destinationId
        - configuration
        - schedule
        - schedulePaused
        - tags
        - overrideConfig
      type: object
      additionalProperties: false
    ValidateErrorJSON:
      properties:
        message:
          type: string
          enum:
            - Validation failed
          nullable: false
        details:
          properties: {}
          additionalProperties: {}
          type: object
      required:
        - message
        - details
      type: object
      additionalProperties: false
    InternalServerError:
      type: string
      enum:
        - Internal Server Error
      nullable: false
    SyncTemplateOverrideOption:
      description: >-
        Whether syncs created from a sync template may set a configuration
        field.
      properties:
        overridable:
          type: boolean
          description: |-
            True when syncs created from the template may set the field through
            `syncTemplateOverrides`.
      required:
        - overridable
      type: object
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer

````