---
title: "Partially update template"
method: PATCH
path: "/templates/{templateId}"
tags: ["Widget"]
---

# Partially update template

`PATCH /templates/{templateId}`

Update several fields of template

## Path parameters

- `templateId` integer, required

## Request body

- WidgetUpdateIO
  - `config` string — The widget editor configuration field is connected to the translation locales field in JSON format
  - `description` string — Description of the template
  - `isCustomTemplate` boolean — Iindicates if a custom template is being used
  - `name` string — Name of the template
  - `siteId` integer — Site Id of the project this widget belongs to
  - `status` 'DRAFT' | 'ACTIVE' | 'PAUSED' — Template status
  - `surveyDataConfig` SurveyDataConfigIO — Configuration settings for survey data collection.
    - `fields` FormFieldIO[], required
      - `elementId` string, required
      - `id` string, required
      - `isDeprecated` boolean
      - `name` string, required
      - `parentId` string
      - `valueType` 'BOOLEAN' | 'NUMBER' | 'STRING' | 'STRING_ARRAY' | 'DATE' | 'TIME', required
    - `isCollectData` boolean, required
    - `methodTypes` string[], required
    - `requestSettings` RequestSettingsIO
      - `headers` RequestHeaderDataTypeIO[]
        - `customData` CustomData
          - `adobeAnalyticsVariableName` string — Variable name of the Adobe Analytics
          - `advancedProposedValues` string — Enables to set values for targeting conditions in the form of a JS table
          - `createdById` integer — Account Id of the creator of the custom data
          - `customEvalCode` string — Custom code that will be executed
          - `dateCreated` string, date-time — Date and time a record is created
          - `dateModified` string, date-time — Date and time a record is modified
          - `description` string — Description of the custom data
          - `format` 'BOOLEAN' | 'NUMBER' | 'STRING' — Custom data value format
          - `gtmVariableName` string — Variable name of the Google Tag Manager
          - `id` integer — Unique Id of the custom data.
          - `index` integer
          - `isConstant` boolean — Indicates if the custom data is a constant
          - `isFiltrableVentilable` boolean — Indicates if custom data should be filtered and marked as available for breakdown
          - `isLearnable` boolean — Indicates if this data should be included in Kameleoon machine learning
          - `isLocalOnly` boolean — Indicates if the custom data is only stored on the user's device.
          - `method` 'ADOBE_ANALYTICS' | 'CLIENT' | 'CUSTOM_CODE' | 'GTM' | 'SDK' | 'TC' | 'TEALIUM', required — Method through which a custom data will be transmitted
          - `modificationDate` string, date-time — Date and time a record is modified (Deprecated, use dateModified instead)
          - `name` string, required — Name of the custom data
          - `siteCode` string — System generated unique code to identify a website. This is an optional field that is included in the request body
          - `siteId` integer, required — Id of the project this record belongs
          - `tags` string — Tags that belong to this record
          - `tcVariableName` string — Name of the tag commander data layer, if it is selected as a transmission method
          - `tealiumVariableName` string — Name of the Tealium, if it is selected as a transmission method
          - `type` 'COUNT_LIST' | 'LIST' | 'UNIQUE' — Custom data type. Custom data can be presented as a single value (UNIQUE), or a list of values (LIST), ​​or a countable list of values (COUNT_LIST)
        - `id` string, required
        - `name` string, required
        - `type` 'CUSTOM_DATA' | 'CUSTOM_TEXT' | 'LOCAL_STORAGE' | 'COOKIES', required
        - `value` string, required
      - `type` 'GET' | 'POST', required
      - `url` string, required
    - `triggerSettings` TriggerSettingsIO, required
      - `type` 'CLICK' | 'CLOSE' | 'ANSWER', required
      - `value` string
  - `tags` string[] — Tags that belong to this template
  - `templateCssCode` string — CSS code that belongs to this template
  - `templateHtmlCode` string — HTML code that belongs to this template
  - `templateJavaScriptCode` string — JavaScript code that belongs to this template
  - `themeId` integer — Id of the theme linked to the widget.
  - `type` 'TEMPLATE' | 'EDITOR' | 'PBX' — Type of template
  - `uiCssCode` string — UI CSS code that belongs to this template
  - `uiHtmlCode` string — UI HTML code belongs to this template
  - `url` string — Url belonging to this template
  - `useCustomData` boolean — Indicates if custom data is being used
  - `widgetEditorTemplate` string — Widget editor code that belongs to this template

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Entity
- `423` — Locked
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api.md) · [All operations](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kameleoon/openapi-definition-for-automation-api/versions/09f2abcea0b5/schema)
