v1

latestOpenAPI 3.0.32026-07-22177397578.0 KB
Experiment

Create a new experiment

Create a new experiment with the given parameters.

post/experiments

Request body

autoOptimizedboolean

Deprecated. Use trafficAllocationMethod field instead

baseURLstring required

URL of the website to load in editor and preview mode

collectingDataEnabledboolean

Indicates if data collection is enabled

commonCssCodestring

CSS code specific to all variations

commonJavaScriptCodestring

JavaScript code specific to all variations

createdByinteger

Account Id of the creator of the experiment

dateCollectingDataStoppedstring date-time

Date the data collection stops

dateCreatedstring date-time
dateEndedstring date-time

Date the experiment ceased

dateModifiedstring date-time

Date the experiment was modified

dateStartedstring date-time

Date the experiment was launched

dateStatusModifiedstring date-time

Date the experiment was last modified

descriptionstring
deviationsobject

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

executeCodeForReferenceboolean
globalScriptstring

JavaScript code that will be applied only to the selected experiment and executed in the end of the Global custom script

goalsinteger[]

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

idinteger

Unique Id of the experiment

isArchivedboolean

Indicates if experiment is archived

isLegacyEditorboolean
isMultipleTestingCorrectionboolean

Indicates whether multiple testing correction is enabled

mainGoalIdinteger
namestring required

Name of the experiment

respoolTimeobject

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

siteCodestring required

Site code of the experiment

siteIdinteger required

Site Id of the project the experiment belongs to

statusstring

Status of the experiment

tagsstring[]

List of tags being used by this experiment.For GET requests, this is an optional field that needs to be specified in request params.

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

targetingRuleIdinteger

Deprecated. Use TargetingRule instead.

targetingSegmentIdinteger

Deprecated. Use the https://api.kameleoon.com/targeting-rules endpoint to update the targeting of your experiment

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

type'AI' | 'CLASSIC' | 'DEVELOPER' | 'FEATURE_FLAG' | 'MVT' | 'PROMPT' | 'SDK_HYBRID'
variationsinteger[]

List of variation ids for this experiment

Example request

{
  "deviations": {
    "12345": 0.5,
    "origin": 0.5
  },
  "respoolTime": {
    "12345": 833760000,
    "origin": 1704067200
  }
}

Response

Created