---
title: "Partially update experiment"
method: PATCH
path: "/experiments/{experimentId}"
tags: ["Experiment"]
---

# Partially update experiment

`PATCH /experiments/{experimentId}`

Update several fields of an experiment. For a multivariate test (MVT) experiment, use this endpoint to set custom traffic allocation after creation: submit `mvtAllocationSettings` with the generated section, variation, and combination IDs returned by a GET request. See [Create a multivariate experiment](../../developer-docs/apis/automation-api-rest/tutorials/experiments/create-a-multivariate-experiment).

## Path parameters

- `experimentId` integer, required

## Query parameters

- `action` 'ACTIVATE' | 'PAUSE' | 'RESUME' | 'STOP' | 'SCHEDULE' | 'DEACTIVATE' | 'REVERT_TO_DRAFT'

## Request body

- ExperimentUpdateIO
  - `autoOptimized` boolean — Deprecated. Use trafficAllocationMethod field instead
  - `baseURL` string — URL of the website to load in the editor and preview mode
  - `commonCssCode` string — CSS code specific to all variations
  - `commonJavaScriptCode` string — JavaScript code specific to all variations
  - `description` string — Description of the experiment
  - `deviations` object — Traffic allocation per variation. Key can be 'origin' (for original page) or variation Id. `Value` is the percentage of traffic which will be allocated to this variation. It has to be double numbers ranging from 0(0%) to 1(100%).
  - `globalScript` string — JavaScript code that will be executed only for the selected experiment at the end of the Global custom script.
  - `goals` integer[] — Goal Id(s) associated with this experiment
  - `identificationKey` string
  - `isMultipleTestingCorrection` boolean — Indicates whether multiple testing correction is enabled
  - `mainGoalId` integer — Main goal Id of the experiment
  - `mvtAllocationSettings` MVTAllocation — Traffic allocation settings for a multivariate test (MVT) experiment. On `POST /experiments`, Kameleoon accepts this object but always applies equal allocation across variations, regardless of the values you submit. To set custom allocation, submit this object again in a `PATCH /experiments/{experimentId}` request, using the generated IDs returned by a GET request. Populate only one of `sectionsAllocations` or `combinationsAllocations`, not both.
    - `combinationsAllocations` AllocationItem[] — Traffic allocation by full combination. Each entry's `variationId` is a generated combination Id that Kameleoon returns in the top-level `variations` array and as keys in the `deviations` map. Combination Ids don't exist until Kameleoon generates them, so you can't populate this array in a creation request.
      - `allocationPart` number, float — Share of traffic to allocate to this variation or combination, from 0 (0%) to 1 (100%).
      - `checked` boolean — Whether the experiment includes this variation or combination.
      - `locked` boolean — Whether to lock this entry's `allocationPart`. A locked entry keeps its value when Kameleoon rebalances the other entries in the same section or combination set.
      - `sectionId` integer — Id of the section this entry belongs to. In `sectionsAllocations`, `sectionId` is the generated section Id from `mvtVariations`. Not used in `combinationsAllocations`.
      - `variationId` string — Id of the variation (in `sectionsAllocations`) or combination (in `combinationsAllocations`) this entry allocates traffic to. The generated reference variation in each section uses `"0"`.
    - `exposedPart` number, float — Share of visitors to expose to the experiment, from 0 (0%) to 1 (100%). The remaining visitors don't see any variation.
    - `sectionsAllocations` AllocationItem[] — Traffic allocation by variation within each section. Each entry's `sectionId` and `variationId` reference a section and variation from `mvtVariations`. Kameleoon derives each generated combination's share from these section-level values.
      - `allocationPart` number, float — Share of traffic to allocate to this variation or combination, from 0 (0%) to 1 (100%).
      - `checked` boolean — Whether the experiment includes this variation or combination.
      - `locked` boolean — Whether to lock this entry's `allocationPart`. A locked entry keeps its value when Kameleoon rebalances the other entries in the same section or combination set.
      - `sectionId` integer — Id of the section this entry belongs to. In `sectionsAllocations`, `sectionId` is the generated section Id from `mvtVariations`. Not used in `combinationsAllocations`.
      - `variationId` string — Id of the variation (in `sectionsAllocations`) or combination (in `combinationsAllocations`) this entry allocates traffic to. The generated reference variation in each section uses `"0"`.
  - `name` string — Name of the experiment
  - `respoolTime` object — The `respoolTime` map contains key-value pairs where each key is a variation ID and the corresponding value is a timestamp that represents the most recent change to the variation allocation, such as through the Kameleoon app or the Automation API.
  - `tags` string[] — Tags belonging to this experiment
  - `targetingConfiguration` 'ALL_VISITORS' | 'AUTOPROMO_AUTODEFINED' | 'GRAPHICAL_PAGES' | 'HEAT_SLICE' | 'PAGE' | 'SAVED_TEMPLATE' | 'SITE' | 'URL' — Deprecated. Use the https://api.kameleoon.com/targeting-rules endpoint to update the targeting of your experiment
  - `targetingRule` TargetingRule — Targeting Rule defines the conditions for displaying content to specific user groups based on segments and triggers
    - `id` integer — Unique Id of the targeting rule
    - `segmentConfiguration` 'ALL_VISITORS' | 'AUTOPROMO_AUTODEFINED' | 'GRAPHICAL_PAGES' | 'HEAT_SLICE' | 'PAGE' | 'SAVED_TEMPLATE' | 'SITE' | 'URL' — Configuration defining how the segment should be applied
    - `segmentId` integer — Id of the associated segment (user group) for targeting. If segment is deprecated, no trigger will be available for this rule.
    - `siteId` integer, required — Id of the project this targeting rule belongs to
    - `targetingConfigurationParam` string — Additional parameters for trigger configuration. For SAVED_TEMPLATE/HEAT_SLICE - contains segment Id. For PAGE - contains full URL. For URL - contains URL fragment.
    - `triggerConfiguration` 'ALL_VISITORS' | 'AUTOPROMO_AUTODEFINED' | 'GRAPHICAL_PAGES' | 'HEAT_SLICE' | 'PAGE' | 'SAVED_TEMPLATE' | 'SITE' | 'URL' — Configuration defining how the trigger should be applied. ALL_VISITORS configuration is not allowed for this trigger type
    - `triggerId` integer — Id of the associated trigger (activation condition)
  - `targetingSegmentId` integer — Deprecated. Use the https://api.kameleoon.com/targeting-rules endpoint to update the targeting of your experiment
  - `trackingTools` TrackingTool[] — Tracking tools being used in this experiment
    - `adobeOmnitureObject` string
    - `comScoreCustomerId` string
    - `comScoreDomain` string
    - `contentSquareUrl` string
    - `customIntegrations` string[]
    - `customVariable` integer
    - `eulerianUserCentricParameter` string
    - `name` 'GOOGLE_ANALYTICS4' | 'GOOGLE_ANALYTICS4_AUDIENCES' | 'GOOGLE_UNIVERSAL_ANALYTICS' | 'ECONDA' | 'SMART_TAG' | 'PIANO' | 'ADOBE_OMNITURE' | 'EULERIAN' | 'WEBTRENDS' | 'KISSMETRICS' | 'PIWIK' | 'CRAZY_EGG' | 'COM_SCORE' | 'TEALIUM' | 'YSANCE' | 'M_PATHY' | 'SMARTFOCUS' | 'EMARSYS' | 'EXPERTSENDER' | 'TAG_COMMANDER' | 'CONTENT_SQUARE' | 'WEBTREKK' | 'CUSTOM_INTEGRATIONS' | 'HEAP' | 'HEAP_COHORTS' | 'KLAVIYO_COHORTS' | 'SEGMENT' | 'MIXPANEL' | 'CLARITY' | 'IABTCF' | 'DATABRICKS' | 'REDSHIFT' | 'SMARTLOOK' | 'MOUSEFLOW' | 'KLAVIYO' | 'FULLSTORY' | 'AMPLITUDE' | 'SNOWPLOW' | 'JUNE' | 'MPARTICLE' | 'BIGQUERY' | 'RUDDERSTACK' | 'SNOWFLAKE' | 'GLASSBOX' | 'HUBSPOT' | 'AIR360' | 'DATADOG' | 'QUANTUM_METRIC' | 'GLASSBOX_V2' | 'BRAZE' | 'KAMELEOON_TRACKING' | 'CUSTOM_TRACKING' | 'VERCEL' | 'AKAMAI'
    - `reportingScript` string
    - `universalAnalyticsDimension` integer
  - `trafficAllocationMethod` 'CONTEXTUAL_BANDIT' | 'MANUAL' | 'MULTI_ARMED_BANDIT' — Method for allocating traffic across variations. Set to `MANUAL` to control the allocation yourself using `deviations` (classic and developer experiments) or `mvtAllocationSettings` (multivariate test experiments).

## 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/revisions/09f2abcea0b5/schema)
