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

# Create Sync Template

> Create a new sync template

A sync template holds a destination configuration that syncs created from
it share. `overrideConfig` names the configuration fields those syncs may
set for themselves; every other field is locked to the template's value.
Create a sync from the template with `POST /syncs` and `syncTemplateId`.



## OpenAPI

````yaml https://api.hightouch.io/api/swagger.json post /sync-templates
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:
    post:
      summary: Create Sync Template
      description: >-
        Create a new sync template


        A sync template holds a destination configuration that syncs created
        from

        it share. `overrideConfig` names the configuration fields those syncs
        may

        set for themselves; every other field is locked to the template's value.

        Create a sync from the template with `POST /syncs` and `syncTemplateId`.
      operationId: CreateSyncTemplate
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncTemplateCreate'
            example:
              name: Salesforce Contacts Template
              modelId: 42
              destinationId: 17
              configuration:
                mode: upsert
                object: Contact
                externalIdMapping:
                  from: email
                  to: Email
                mappings: []
              overrideConfig:
                mappings:
                  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
                    workspaceId: 1
                    createdAt: '2022-12-12T22:46:57.618Z'
                    updatedAt: '2022-12-12T22:46:57.618Z'
                    modelId: 42
                    destinationId: 17
                    configuration:
                      mode: upsert
                      object: Contact
                      externalIdMapping:
                        from: email
                        to: Email
                      mappings: []
                      configVersion: 1
                    schedule: null
                    schedulePaused: false
                    tags: {}
                    overrideConfig:
                      mappings:
                        overridable: true
        '401':
          description: Unauthorized
        '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:
    SyncTemplateCreate:
      description: >-
        The input for creating a Sync Template. A `slug` is generated
        automatically

        from the name; it is a legacy column and is no longer accepted on input.
      properties:
        name:
          type: string
        description:
          type: string
        modelId:
          type: number
          format: double
        destinationId:
          type: number
          format: double
        configuration:
          properties: {}
          additionalProperties: {}
          type: object
        schedule:
          properties: {}
          additionalProperties: {}
          type: object
        schedulePaused:
          type: boolean
        matchboosterRegion:
          type: string
          nullable: true
        overrideConfig:
          properties: {}
          additionalProperties:
            $ref: '#/components/schemas/SyncTemplateOverrideOption'
          type: object
          nullable: true
      required:
        - name
        - modelId
        - destinationId
        - configuration
      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

````