> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Partially update experiment

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



## OpenAPI

````yaml /automation.api.json patch /experiments/{experimentId}
openapi: 3.0.3
info:
  title: OpenAPI definition for automation api
  version: 1.0.0
servers:
  - url: https://api.kameleoon.com
security: []
tags:
  - description: >-
      This is an object representing a Kameleoon account.You can retrieve it to
      view its properties, such as its current e-mail address or locale.With
      proper authorization, your application can read and update an account and
      profile settings.<aside class="notice"> Not all settings are exposed via
      the API. See the API reference for details. </aside>
    name: Account
  - description: >-
      Feature flag is used to  help our clients implement new features, test and
      deploy them viaour SDK. This service allows you to create and configure
      the feature flag which will be used in the source code of your feature.
    name: FeatureFlag
  - description: >
      You can use your account to set up multiple websites.This is helpful if
      you want to test your website and its mobile version or if you want to try
      Kameleoon on your site in a pre-production environment,It allows you to
      create different testing environments.
    name: Site
  - description: >-
      Custom data is an advanced tool that lets you target your customers in a
      unique way using data that is already available,such as user account
      information.
    name: CustomData
  - description: >-
      Experiment is an A/B test which can be targeted to a specific audience or
      any other audience. Kameleoon has several types of experiments: `Classic`,
      `Multivariate test (MVT)`, `Server-side` and the one that suits the best
      can be used to achieve the best results.
    name: Experiment
  - description: >-
      To measure the efficiency of an experiment or a personalization, it must
      be linked to one or several goals. All goals can be managed through
      Kameleoon interface or Automation API. There are variety of different
      goals you can choose from to better measure the results.
    name: Goal
  - description: This is an object representing an image
    name: Image
  - description: >-
      This is an object representing a key moment. Please note that `KeyMoment`
      has now been renamed to `Triggers`.
    name: KeyMoment
  - description: >-
      KeyPage allows you to target visitors that have visited a particular page,
      or multiple pages on your website.
    name: KeyPage
  - description: >
      Web personalization tailors the experience for each visitor to improve
      your conversion rate.

      The personalization object contains all vital information about a
      personalization as well as segments and variations used in it.
    name: Personalization
  - description: This is an object representing a projectThemeConfig
    name: ProjectThemeConfig
  - description: This is an object representing recommender block
    name: RecommenderBlock
  - description: >
      Referrer is an advanced tool that allows you to target visitors according
      to acquisition methods that lead them to your website.

      Kameleoon automatically creates 5 default channels: `Bing`, `Baidu`,
      `Google`, `Yahoo` and `Google Adwords`.
    name: Referrer
  - description: >-
      Segmenting allows you to effectively target visitors.You can create,
      modify, and duplicate segments using the Segment Builder tool in
      Kameleoon’s backend or through our Automation API.
    name: Segment
  - description: This is an object representing studio recommender block
    name: StudioRecommenderBlock
  - description: This is an object representing tag
    name: Tag
  - description: >-
      Represents an object aggregating the main information about an experiment
      result.
    name: Takeaway
  - description: This is an object representing a takeaway comment.
    name: TakeawayComment
  - description: >-
      TargetingRule is a system entity that combines segments (user groups) and
      triggers (activation conditions) to define precise targeting rules for
      experiments.
    name: TargetingRule
  - description: This is an object representing a theme
    name: Theme
  - description: >-
      A variation is a modified version of your webpage that can be edited for
      experiments or personalization.

      When you add a new variation, Kameleoon creates a copy of the original
      page from which you started.All changes will be saved in the variation,
      which will include all your edits when the test starts.
    name: Variation
  - description: This is an object representing a widget
    name: Widget
  - description: This is an object representing a widget studio
    name: WidgetStudio
  - description: This is an object representing widget studio template
    name: WidgetStudioTemplate
  - name: Audience
    description: >-
      Audience refers to statistical information regarding the number of visits,
      conversions, and other metrics related to a specific segment. Gaining
      insights into your website's audience is essential for effectively
      adjusting segments.
  - name: Data
    description: >
      Web personalization involves offering visitors a tailored experience to
      optimize your conversion rate.

      Personalization object contains information about a personalization, as
      well as the segments and variations used in it.
  - name: Raw Export
    description: >-
      Start a raw data exportation for experiment or personalization, which will
      be sent to the given emails.
  - name: GoalCampaign
    description: >-
      Retrieve experiments that use a specific goal, optionally filtered by
      whether that goal had a positive, negative, or neutral impact on the
      experiment. Results are paginated using cursor-based pagination.
  - name: Data API Requests
    description: Traffic statistics for requests sent to the Kameleoon Data API.
paths:
  /experiments/{experimentId}:
    patch:
      tags:
        - Experiment
      summary: Partially update experiment
      description: >-
        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).
      operationId: partial-update-experiment
      parameters:
        - in: path
          name: experimentId
          required: true
          schema:
            type: integer
            format: int64
        - description: Action to change the status of experiment
          in: query
          name: action
          required: false
          schema:
            type: string
            enum:
              - ACTIVATE
              - PAUSE
              - RESUME
              - STOP
              - SCHEDULE
              - DEACTIVATE
              - REVERT_TO_DRAFT
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExperimentUpdateIO'
      responses:
        '200':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Experiment'
          description: OK
        '400':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Bad Request
        '401':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Unauthorized
        '403':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Forbidden
        '404':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Not Found
        '422':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Unprocessable Entity
        '423':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Locked
        '429':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Too Many Requests
        '500':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    ExperimentUpdateIO:
      type: object
      properties:
        autoOptimized:
          type: boolean
          description: Deprecated. Use trafficAllocationMethod field instead
          deprecated: true
        baseURL:
          type: string
          description: URL of the website to load in the editor and preview mode
        commonCssCode:
          type: string
          description: CSS code specific to all variations
        commonJavaScriptCode:
          type: string
          description: JavaScript code specific to all variations
        description:
          type: string
          description: Description of the experiment
        deviations:
          type: object
          additionalProperties:
            type: number
            description: >-
              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%).
            format: double
          description: >-
            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%).
          example:
            '12345': 0.5
            origin: 0.5
        globalScript:
          type: string
          description: >-
            JavaScript code that will be executed only for the selected
            experiment at the end of the Global custom script.
        goals:
          type: array
          description: Goal Id(s) associated with this experiment
          items:
            type: integer
            format: int64
        identificationKey:
          type: string
        isMultipleTestingCorrection:
          type: boolean
          description: Indicates whether multiple testing correction is enabled
        mainGoalId:
          type: integer
          description: Main goal Id of the experiment
          format: int64
        mvtAllocationSettings:
          $ref: '#/components/schemas/MVTAllocation'
        name:
          type: string
          description: Name of the experiment
        respoolTime:
          type: object
          additionalProperties:
            type: number
            description: >-
              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.
            format: double
          description: >-
            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.
          example:
            '12345': 1704067200
            origin: 833760000
        tags:
          type: array
          description: Tags belonging to this experiment
          items:
            type: string
        targetingConfiguration:
          type: string
          description: >-
            Deprecated. Use the https://api.kameleoon.com/targeting-rules
            endpoint to update the targeting of your experiment
          deprecated: true
          enum:
            - ALL_VISITORS
            - AUTOPROMO_AUTODEFINED
            - GRAPHICAL_PAGES
            - HEAT_SLICE
            - PAGE
            - SAVED_TEMPLATE
            - SITE
            - URL
        targetingRule:
          $ref: '#/components/schemas/TargetingRule'
        targetingSegmentId:
          type: integer
          description: >-
            Deprecated. Use the https://api.kameleoon.com/targeting-rules
            endpoint to update the targeting of your experiment
          format: int64
          deprecated: true
        trackingTools:
          type: array
          description: Tracking tools being used in this experiment
          items:
            $ref: '#/components/schemas/TrackingTool'
        trafficAllocationMethod:
          type: string
          description: >-
            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).
          enum:
            - CONTEXTUAL_BANDIT
            - MANUAL
            - MULTI_ARMED_BANDIT
      title: Experiment update io
    Experiment:
      required:
        - baseURL
        - name
        - siteCode
        - siteId
      type: object
      properties:
        autoOptimized:
          type: boolean
          description: Deprecated. Use trafficAllocationMethod field instead
          deprecated: true
        baseURL:
          type: string
          description: URL of the website to load in editor and preview mode
        collectingDataEnabled:
          type: boolean
          description: Indicates if data collection is enabled
        commonCssCode:
          type: string
          description: CSS code specific to all variations
        commonJavaScriptCode:
          type: string
          description: JavaScript code specific to all variations
        createdBy:
          type: integer
          description: Account Id of the creator of the experiment
          format: int64
          readOnly: true
        dateCollectingDataStopped:
          type: string
          description: Date the data collection stops
          format: date-time
          readOnly: true
        dateCreated:
          type: string
          format: date-time
          readOnly: true
        dateEnded:
          type: string
          description: Date the experiment ceased
          format: date-time
          readOnly: true
        dateModified:
          type: string
          description: Date the experiment was modified
          format: date-time
          readOnly: true
        dateStarted:
          type: string
          description: Date the experiment was launched
          format: date-time
          readOnly: true
        dateStatusModified:
          type: string
          description: Date the experiment was last modified
          format: date-time
          readOnly: true
        description:
          type: string
        deviations:
          type: object
          additionalProperties:
            type: number
            description: >-
              Traffic allocation per variation. Key can be 'origin'(for original
              page) or variation id.`Value` is the percentage of traffic which
              will be directed to this variation.It has to be double numbers
              ranging from 0(0%) to 1(100%).
            format: double
          description: >-
            Traffic allocation per variation. Key can be 'origin'(for original
            page) or variation id.`Value` is the percentage of traffic which
            will be directed to this variation.It has to be double numbers
            ranging from 0(0%) to 1(100%).
          example:
            '12345': 0.5
            origin: 0.5
        executeCodeForReference:
          type: boolean
        globalScript:
          type: string
          description: >-
            JavaScript code that will be applied only to the selected experiment
            and executed in the end of the Global custom script
        goals:
          uniqueItems: true
          type: array
          description: >-
            List of Ids of the goals being used by this experiment.For GET
            requests, this is an optional field that needs to be specified in
            request params
          items:
            type: integer
            format: int64
        id:
          type: integer
          description: Unique Id of the experiment
          format: int64
          readOnly: true
        isArchived:
          type: boolean
          description: Indicates if experiment is archived
          readOnly: true
        isLegacyEditor:
          type: boolean
        isMultipleTestingCorrection:
          type: boolean
          description: Indicates whether multiple testing correction is enabled
        mainGoalId:
          type: integer
          format: int64
        mvtAllocationSettings:
          $ref: '#/components/schemas/MVTAllocation'
        mvtVariations:
          type: array
          description: >-
            Sections and variations for a multivariate test (MVT) experiment. On
            creation, the `sectionId` and variation `id` values you submit link
            entries in this array to entries in `mvtAllocationSettings`;
            Kameleoon replaces them with its own generated IDs in the response.
            Kameleoon doesn't return this field on subsequent GET requests.
          items:
            $ref: '#/components/schemas/VariationCombination'
        name:
          type: string
          description: Name of the experiment
        respoolTime:
          type: object
          additionalProperties:
            type: number
            description: >-
              The respoolTime map contains key-value pairs, where each key is a
              variation ID and the corresponding value is a timestamp
              representing the most recent change to the variation’s allocation
              (for example, using the Kameleoon app or the Automation API).
            format: double
          description: >-
            The respoolTime map contains key-value pairs, where each key is a
            variation ID and the corresponding value is a timestamp representing
            the most recent change to the variation’s allocation (for example,
            using the Kameleoon app or the Automation API).
          example:
            '12345': 833760000
            origin: 1704067200
        siteCode:
          type: string
          description: Site code of the experiment
          readOnly: true
        siteId:
          type: integer
          description: Site Id of the project the experiment belongs to
          format: int64
        status:
          type: string
          description: Status of the experiment
          readOnly: true
        tags:
          type: array
          description: >-
            List of tags being used by this experiment.For GET requests, this is
            an optional field that needs to be specified in request params.
          items:
            type: string
        targetingConfiguration:
          type: string
          description: >-
            Deprecated. Use the https://api.kameleoon.com/targeting-rules
            endpoint to update the targeting of your experiment
          deprecated: true
          enum:
            - ALL_VISITORS
            - AUTOPROMO_AUTODEFINED
            - GRAPHICAL_PAGES
            - HEAT_SLICE
            - PAGE
            - SAVED_TEMPLATE
            - SITE
            - URL
        targetingRule:
          $ref: '#/components/schemas/TargetingRule'
        targetingRuleId:
          type: integer
          description: Deprecated. Use TargetingRule instead.
          format: int64
          readOnly: true
          deprecated: true
        targetingSegmentId:
          type: integer
          description: >-
            Deprecated. Use the https://api.kameleoon.com/targeting-rules
            endpoint to update the targeting of your experiment
          format: int64
          deprecated: true
        trackingTools:
          type: array
          items:
            $ref: '#/components/schemas/TrackingTool'
        trafficAllocationMethod:
          type: string
          description: >-
            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).
          enum:
            - CONTEXTUAL_BANDIT
            - MANUAL
            - MULTI_ARMED_BANDIT
        type:
          type: string
          enum:
            - AI
            - CLASSIC
            - DEVELOPER
            - FEATURE_FLAG
            - MVT
            - PROMPT
            - SDK_HYBRID
        variations:
          type: array
          description: List of variation ids for this experiment
          readOnly: true
          items:
            type: integer
            format: int64
            readOnly: true
      title: Experiment
    ExternalResponseObject:
      type: object
      properties:
        code:
          type: string
        impersonator:
          type: string
        message:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - ERROR
        sub:
          type: string
        time:
          type: integer
          format: int64
        timestamp:
          type: string
          format: date-time
      title: External response object
    MVTAllocation:
      type: object
      description: >-
        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.
      properties:
        combinationsAllocations:
          type: array
          description: >-
            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.
          items:
            $ref: '#/components/schemas/AllocationItem'
        exposedPart:
          type: number
          description: >-
            Share of visitors to expose to the experiment, from 0 (0%) to 1
            (100%). The remaining visitors don't see any variation.
          format: float
        sectionsAllocations:
          type: array
          description: >-
            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.
          items:
            $ref: '#/components/schemas/AllocationItem'
      title: Mvt allocation
    TargetingRule:
      required:
        - siteId
      type: object
      properties:
        id:
          type: integer
          description: Unique Id of the targeting rule
          format: int64
          readOnly: true
        segmentConfiguration:
          type: string
          description: Configuration defining how the segment should be applied
          enum:
            - ALL_VISITORS
            - AUTOPROMO_AUTODEFINED
            - GRAPHICAL_PAGES
            - HEAT_SLICE
            - PAGE
            - SAVED_TEMPLATE
            - SITE
            - URL
        segmentId:
          type: integer
          description: >-
            Id of the associated segment (user group) for targeting. If segment
            is deprecated, no trigger will be available for this rule.
          format: int64
        siteId:
          type: integer
          description: Id of the project this targeting rule belongs to
          format: int64
        targetingConfigurationParam:
          type: string
          description: >-
            Additional parameters for trigger configuration. For
            SAVED_TEMPLATE/HEAT_SLICE - contains segment Id. For PAGE - contains
            full URL. For URL - contains URL fragment.
        triggerConfiguration:
          type: string
          description: >-
            Configuration defining how the trigger should be applied.
            ALL_VISITORS configuration is not allowed for this trigger type
          enum:
            - ALL_VISITORS
            - AUTOPROMO_AUTODEFINED
            - GRAPHICAL_PAGES
            - HEAT_SLICE
            - PAGE
            - SAVED_TEMPLATE
            - SITE
            - URL
        triggerId:
          type: integer
          description: Id of the associated trigger (activation condition)
          format: int64
      description: >-
        Targeting Rule defines the conditions for displaying content to specific
        user groups based on segments and triggers
      title: Targeting rule
    TrackingTool:
      type: object
      properties:
        adobeOmnitureObject:
          type: string
        comScoreCustomerId:
          type: string
        comScoreDomain:
          type: string
        contentSquareUrl:
          type: string
        customIntegrations:
          uniqueItems: true
          type: array
          items:
            type: string
        customVariable:
          type: integer
          format: int32
        eulerianUserCentricParameter:
          type: string
        name:
          type: string
          enum:
            - 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:
          type: string
        universalAnalyticsDimension:
          type: integer
          format: int32
      description: Tracking tools being used in this experiment
      title: Tracking tool
    VariationCombination:
      type: object
      description: >-
        A single section of a multivariate test (MVT) experiment, containing the
        variations to test for one page element. Kameleoon generates every
        combination of variations across all submitted sections, including one
        automatically-added reference variation per section.
      properties:
        sectionId:
          type: integer
          description: >-
            On a creation request, a temporary Id you use only to link this
            section to its allocation entries in the same request. Kameleoon
            replaces it with a generated Id in the response.
          format: int64
        sectionName:
          type: string
          description: Name of the section.
        variations:
          type: array
          description: >-
            Variations to test for this section, not including the reference
            variation that Kameleoon adds automatically.
          items:
            $ref: '#/components/schemas/MVTVariation'
      title: Variation combination
    AllocationItem:
      type: object
      description: >-
        One entry in a multivariate test (MVT) experiment's traffic allocation.
        Used in both `mvtAllocationSettings.sectionsAllocations` (allocation by
        variation within a section) and
        `mvtAllocationSettings.combinationsAllocations` (allocation by full
        combination). On `POST /experiments`, Kameleoon ignores the submitted
        `allocationPart` and `locked` values and always applies equal allocation
        with `locked: false`. Set custom values with a subsequent `PATCH
        /experiments/{experimentId}` request instead, using the generated
        `sectionId` and `variationId` values returned by a GET request.
      properties:
        allocationPart:
          type: number
          description: >-
            Share of traffic to allocate to this variation or combination, from
            0 (0%) to 1 (100%).
          format: float
        checked:
          type: boolean
          description: Whether the experiment includes this variation or combination.
        locked:
          type: boolean
          description: >-
            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:
          type: integer
          description: >-
            Id of the section this entry belongs to. In `sectionsAllocations`,
            `sectionId` is the generated section Id from `mvtVariations`. Not
            used in `combinationsAllocations`.
          format: int64
        variationId:
          type: string
          description: >-
            Id of the variation (in `sectionsAllocations`) or combination (in
            `combinationsAllocations`) this entry allocates traffic to. The
            generated reference variation in each section uses `"0"`.
      title: Allocation item
    MVTVariation:
      type: object
      description: A single variation within a multivariate test (MVT) section.
      properties:
        id:
          type: integer
          description: >-
            On a creation request, a temporary Id you use only to link this
            variation to its allocation entry in the same request. Kameleoon
            replaces it with a generated Id in the response.
          format: int64
        name:
          type: string
          description: Name of the variation.
      title: Mvt variation
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````