---
title: "Simulate widget"
method: POST
path: "/templates/simulate/{widgetId}"
tags: ["Widget"]
---

# Simulate widget

`POST /templates/simulate/{widgetId}`

Generate simulation for widget and redirect to simulation page

## Path parameters

- `widgetId` integer, required

## Request body

- TemplateSimulationInput
  - `widgetPbxSimulationInput` WidgetPbxSimulationInput — Widget PBX fields.
    - `cssCode` string
    - `jsCode` string, required
  - `widgetTemplateInput` WidgetTemplateInput, required — Widget template fields.
    - `displayPluginConfiguration` string, required
    - `domElementSelector` string
    - `locales` string
    - `position` 'INPAGE' | 'ABOVE', required
    - `positionSelectorRelative` string
    - `shadowDom` boolean, required
    - `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
    - `widgetEditorTemplate` string
    - `widgetFonts` string

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