# Kameleoon

> Run Kameleoon experiments from workflows: create, launch and stop A/B tests, read their results, manage goals, variations and feature flags, and follow new and changed experiments, goals, segments, feature flags and personalizations.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/kameleoon

## Actions

### Change experiment status

Launch, pause, resume, stop or schedule an experiment, or send it back to draft.

**Inputs**

- Experiment (`experiment_id`, number, required): The experiment. At least 1.
- Change (`change`, text, required): What to do with the experiment. Launching shows it to real visitors. One of: `ACTIVATE` (Launch), `PAUSE`, `RESUME`, `STOP`, `SCHEDULE`, `DEACTIVATE`, `REVERT_TO_DRAFT` (Back to draft).

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "baseURL": "example",
    "dateCreated": "example",
    "dateEnded": "example",
    "dateModified": "example",
    "dateStarted": "example",
    "dateStatusModified": "example",
    "description": "example",
    "deviations": {},
    "goals": [
      1
    ],
    "hypothesis": "example",
    "id": 1,
    "isArchived": true,
    "mainGoalId": 1,
    "name": "example",
    "siteCode": "example",
    "siteId": 1,
    "status": "example",
    "tags": [
      "example"
    ],
    "trafficAllocationMethod": "example",
    "type": "example",
    "variations": [
      1
    ]
  }
}
```

### Create experiment

Create a draft A/B experiment on a project. Kameleoon adds its first variation, which List variations shows.

**Inputs**

- Project (`site_id`, number, required): The Kameleoon project (Kameleoon's API calls it a site). At least 1.
- Name (`name`, text, required): The experiment's name.
- Page URL (`base_url`, text, required): The page the editor and preview open, such as `https://www.example.com/`.
- Editor (`type`, text): Whether variations are built in the graphic editor or written as code. Leave empty for code. One of: `CLASSIC` (Graphic editor (classic)), `DEVELOPER` (Code editor (developer)). Default: `DEVELOPER`.
- Description (`description`, text): What the experiment is about.
- Hypothesis (`hypothesis`, text): What you expect the change to do.
- Tags (`tags`, list): Tags to label it with in Kameleoon.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "baseURL": "example",
    "dateCreated": "example",
    "dateEnded": "example",
    "dateModified": "example",
    "dateStarted": "example",
    "dateStatusModified": "example",
    "description": "example",
    "deviations": {},
    "goals": [
      1
    ],
    "hypothesis": "example",
    "id": 1,
    "isArchived": true,
    "mainGoalId": 1,
    "name": "example",
    "siteCode": "example",
    "siteId": 1,
    "status": "example",
    "tags": [
      "example"
    ],
    "trafficAllocationMethod": "example",
    "type": "example",
    "variations": [
      1
    ]
  }
}
```

### Create feature flag

Create a feature flag on a project. Kameleoon sets up its development, staging and production environments.

**Inputs**

- Project (`site_code`, text, required): The project the feature flag belongs to, by its site code.
- Feature key (`feature_key`, text, required): The key your code checks, such as `new_checkout`: lower-case letters, digits, - and _.
- Name (`name`, text, required): The flag's name.
- Description (`description`, text): What the flag controls.
- Tags (`tags`, list): Tags to label it with in Kameleoon.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "archived": true,
    "dateCreated": "example",
    "dateModified": "example",
    "description": "example",
    "environmentConfigurations": [
      {
        "dateModified": "example",
        "defaultVariationKey": "example",
        "environmentKey": "example",
        "featureEnabled": true
      }
    ],
    "featureKey": "example",
    "health": "example",
    "id": 1,
    "name": "example",
    "primaryGoalId": 1,
    "siteCode": "example",
    "tags": [
      "example"
    ],
    "variations": [
      {
        "key": "example",
        "name": "example"
      }
    ]
  }
}
```

### Create goal

Create a goal on a project: a click on an element, a visit to a page, a number of pages viewed, time spent, scroll depth, or a custom goal triggered by code.

**Inputs**

- Project (`site_id`, number, required): The Kameleoon project (Kameleoon's API calls it a site). At least 1.
- Name (`name`, text, required): The goal's name.
- Goal type (`type`, text, required): What the goal counts. One of: `CUSTOM` (Custom (triggered by code)), `CLICK` (Click on an element), `URL` (Visit to a page), `PAGE_VIEWS` (Number of pages viewed), `TIME_SPENT` (Time spent on the site), `SCROLL` (Scroll depth).
- CSS selector (`css_selector`, text): For a click goal: the CSS selector of the element, such as `.cta-button`.
- Page URL (`url`, text): For a page visit goal: the URL, or part of it, to match.
- URL match (`url_match`, text): For a page visit goal: how the URL is matched. Leave empty for contains. One of: `CONTAINS` (URL contains), `CORRESPONDS_EXACTLY` (URL is exactly), `REGULAR_EXPRESSION` (URL matches a regular expression).
- Amount (`amount`, number): For pages viewed, the number of pages; for time spent, seconds; for scroll depth, the percentage or pixels. At least 0.
- Comparison (`comparison`, text): For pages viewed or time spent: how the amount is compared. Leave empty for more than. One of: `MORE_THAN` (More than), `EQUALS` (Exactly), `LESS_THAN` (Less than).
- Scroll measured in (`scroll_type`, text): For scroll depth: what the amount measures. Leave empty for a percentage. One of: `PERCENTAGE` (Percentage of the page), `PIXELS_HEIGHT` (Pixels from the top), `ELEMENT` (An element).
- JavaScript (`js_code`, text): For a custom goal: JavaScript that runs on every page and calls `triggerGoal()` to count a conversion.
- Count every conversion (`multiple_conversions`, true/false): On to count every conversion in a visit, not only the first.
- Status (`status`, text): Whether the goal is tracked. Leave empty for active. One of: `ACTIVE`, `INACTIVE`.
- Description (`description`, text): What the goal measures.
- Tags (`tags`, list): Tags to label it with in Kameleoon.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "dateCreated": "example",
    "dateModified": "example",
    "description": "example",
    "hasMultipleConversions": true,
    "id": 1,
    "name": "example",
    "params": {},
    "siteId": 1,
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example"
  }
}
```

### Create variation

Add a variation to an experiment, with the JavaScript and CSS that change the page.

**Inputs**

- Project (`site_id`, number, required): The Kameleoon project (Kameleoon's API calls it a site). At least 1.
- Experiment (`experiment_id`, number, required): The experiment the variation is for. At least 1.
- Name (`name`, text, required): The variation's name.
- JavaScript (`js_code`, text): JavaScript the variation runs on the page.
- CSS (`css_code`, text): CSS the variation adds to the page.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "creationMode": "example",
    "cssCode": "example",
    "experimentId": 1,
    "id": 1,
    "isJsCodeAfterDomReady": true,
    "jsCode": "example",
    "name": "example",
    "personalizationId": 1,
    "siteId": 1
  }
}
```

### Delete experiment

Delete an experiment with its variations and results. This can't be undone.

**Inputs**

- Experiment (`experiment_id`, number, required): The experiment. At least 1.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": "example"
  }
}
```

### Delete feature flag

Delete a feature flag from every environment. Code that checks it gets its default. This can't be undone.

**Inputs**

- Project (`site_code`, text, required): The project the feature flag belongs to, by its site code.
- Feature flag (`feature_key`, text, required): The feature flag, by its key.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": "example"
  }
}
```

### Delete goal

Delete a goal. Experiments stop measuring it. This can't be undone.

**Inputs**

- Goal (`goal_id`, number, required): The goal. At least 1.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": "example"
  }
}
```

### Get experiment

Get an experiment: its status, dates, goals, variations and traffic allocation.

**Inputs**

- Experiment (`experiment_id`, number, required): The experiment. At least 1.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "baseURL": "example",
    "dateCreated": "example",
    "dateEnded": "example",
    "dateModified": "example",
    "dateStarted": "example",
    "dateStatusModified": "example",
    "description": "example",
    "deviations": {},
    "goals": [
      1
    ],
    "hypothesis": "example",
    "id": 1,
    "isArchived": true,
    "mainGoalId": 1,
    "name": "example",
    "siteCode": "example",
    "siteId": 1,
    "status": "example",
    "tags": [
      "example"
    ],
    "trafficAllocationMethod": "example",
    "type": "example",
    "variations": [
      1
    ]
  }
}
```

### Get feature flag

Get a feature flag: its variations, variables and each environment's setting.

**Inputs**

- Project (`site_code`, text, required): The project the feature flag belongs to, by its site code.
- Feature flag (`feature_key`, text, required): The feature flag, by its key.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "archived": true,
    "dateCreated": "example",
    "dateModified": "example",
    "description": "example",
    "environmentConfigurations": [
      {
        "dateModified": "example",
        "defaultVariationKey": "example",
        "environmentKey": "example",
        "featureEnabled": true
      }
    ],
    "featureKey": "example",
    "health": "example",
    "id": 1,
    "name": "example",
    "primaryGoalId": 1,
    "siteCode": "example",
    "tags": [
      "example"
    ],
    "variations": [
      {
        "key": "example",
        "name": "example"
      }
    ]
  }
}
```

### Get goal

Get a goal: its type, what it tracks and its status.

**Inputs**

- Goal (`goal_id`, number, required): The goal. At least 1.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "dateCreated": "example",
    "dateModified": "example",
    "description": "example",
    "hasMultipleConversions": true,
    "id": 1,
    "name": "example",
    "params": {},
    "siteId": 1,
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example"
  }
}
```

### Get project

Get a project's settings: its URL, site code, domains and whether the Kameleoon script is installed.

**Inputs**

- Project (`site_id`, number, required): The Kameleoon project (Kameleoon's API calls it a site). At least 1.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "code": "example",
    "dateCreated": "example",
    "description": "example",
    "domainNames": [
      "example"
    ],
    "id": 1,
    "isKameleoonEnabled": true,
    "isScriptActive": true,
    "name": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "url": "example"
  }
}
```

### Get results

Read a results report by the data code Request experiment results gave. Its status is WAITING until the report is ready.

**Inputs**

- Data code (`data_code`, text, required): The data code Request experiment results returned.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "data": {},
    "errorDescription": "example",
    "status": "READY"
  }
}
```

### List experiments

List experiments, optionally only one project's or only those with a given status.

**Inputs**

- Project (`site_id`, number): Only records of this project. Leave empty for every project. At least 1.
- Status (`status`, text): Only experiments with this status. Leave empty for every status. One of: `ACTIVE`, `PAUSED`, `STOPPED`, `DRAFT`, `SCHEDULED`.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Records per page (`per_page`, number): How many records a page holds, up to 200. Leave empty for 50. From 1 to 200.

**Outputs**

- `data` (list): The response from Kameleoon.

**Example output**

```json
{
  "data": [
    {
      "baseURL": "example",
      "dateCreated": "example",
      "dateEnded": "example",
      "dateModified": "example",
      "dateStarted": "example",
      "dateStatusModified": "example",
      "description": "example",
      "deviations": {},
      "goals": [
        1
      ],
      "hypothesis": "example",
      "id": 1,
      "isArchived": true,
      "mainGoalId": 1,
      "name": "example",
      "siteCode": "example",
      "siteId": 1,
      "status": "example",
      "tags": [
        "example"
      ],
      "trafficAllocationMethod": "example",
      "type": "example",
      "variations": [
        1
      ]
    }
  ]
}
```

### List feature flags

List feature flags with their environments and whether each is on, optionally one project's.

**Inputs**

- Project (`site_code`, text): Only this project's flags. Leave empty for every project.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Records per page (`per_page`, number): How many records a page holds, up to 200. Leave empty for 50. From 1 to 200.

**Outputs**

- `data` (list): The response from Kameleoon.

**Example output**

```json
{
  "data": [
    {
      "archived": true,
      "dateCreated": "example",
      "dateModified": "example",
      "description": "example",
      "environmentConfigurations": [
        {
          "dateModified": "example",
          "defaultVariationKey": "example",
          "environmentKey": "example",
          "featureEnabled": true
        }
      ],
      "featureKey": "example",
      "health": "example",
      "id": 1,
      "name": "example",
      "primaryGoalId": 1,
      "siteCode": "example",
      "tags": [
        "example"
      ],
      "variations": [
        {
          "key": "example",
          "name": "example"
        }
      ]
    }
  ]
}
```

### List goals

List the goals (conversions such as clicks, page visits or purchases) experiments measure, optionally one project's.

**Inputs**

- Project (`site_id`, number): Only records of this project. Leave empty for every project. At least 1.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Records per page (`per_page`, number): How many records a page holds, up to 200. Leave empty for 50. From 1 to 200.

**Outputs**

- `data` (list): The response from Kameleoon.

**Example output**

```json
{
  "data": [
    {
      "dateCreated": "example",
      "dateModified": "example",
      "description": "example",
      "hasMultipleConversions": true,
      "id": 1,
      "name": "example",
      "params": {},
      "siteId": 1,
      "status": "example",
      "tags": [
        "example"
      ],
      "type": "example"
    }
  ]
}
```

### List personalizations

List personalizations (content shown to a segment of visitors), optionally one project's.

**Inputs**

- Project (`site_id`, number): Only records of this project. Leave empty for every project. At least 1.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Records per page (`per_page`, number): How many records a page holds, up to 200. Leave empty for 50. From 1 to 200.

**Outputs**

- `data` (list): The response from Kameleoon.

**Example output**

```json
{
  "data": [
    {
      "baseURL": "example",
      "dateCreated": "example",
      "dateEnded": "example",
      "dateModified": "example",
      "dateStarted": "example",
      "description": "example",
      "goals": [
        1
      ],
      "id": 1,
      "isArchived": true,
      "mainGoalId": 1,
      "name": "example",
      "siteId": 1,
      "status": "example",
      "tags": [
        "example"
      ],
      "type": "example"
    }
  ]
}
```

### List projects

List the projects (websites and apps) in your Kameleoon account, with each one's ID and site code.

**Inputs**

- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Records per page (`per_page`, number): How many records a page holds, up to 200. Leave empty for 50. From 1 to 200.

**Outputs**

- `data` (list): The response from Kameleoon.

**Example output**

```json
{
  "data": [
    {
      "code": "example",
      "dateCreated": "example",
      "description": "example",
      "domainNames": [
        "example"
      ],
      "id": 1,
      "isKameleoonEnabled": true,
      "isScriptActive": true,
      "name": "example",
      "tags": [
        "example"
      ],
      "type": "example",
      "url": "example"
    }
  ]
}
```

### List segments

List the segments (groups of visitors) experiments and personalizations target, optionally one project's.

**Inputs**

- Project (`site_id`, number): Only records of this project. Leave empty for every project. At least 1.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Records per page (`per_page`, number): How many records a page holds, up to 200. Leave empty for 50. From 1 to 200.

**Outputs**

- `data` (list): The response from Kameleoon.

**Example output**

```json
{
  "data": [
    {
      "dateCreated": "example",
      "dateModified": "example",
      "description": "example",
      "id": 1,
      "name": "example",
      "segmentType": "example",
      "siteId": 1,
      "tags": [
        "example"
      ]
    }
  ]
}
```

### List variations

List the variations of an experiment, each with its JavaScript and CSS.

**Inputs**

- Experiment (`experiment_id`, number, required): The experiment. At least 1.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Records per page (`per_page`, number): How many records a page holds, up to 200. Leave empty for 50. From 1 to 200.

**Outputs**

- `data` (list): The response from Kameleoon.

**Example output**

```json
{
  "data": [
    {
      "creationMode": "example",
      "cssCode": "example",
      "experimentId": 1,
      "id": 1,
      "isJsCodeAfterDomReady": true,
      "jsCode": "example",
      "name": "example",
      "personalizationId": 1,
      "siteId": 1
    }
  ]
}
```

### Request experiment results

Ask Kameleoon to prepare an experiment's results for a period. It returns a data code; Get results reads the report with it.

**Inputs**

- Experiment (`experiment_id`, number, required): The experiment. At least 1.
- From (`start`, date and time, required): The start of the period to report on.
- To (`end`, date and time): The end of the period. Leave empty for now.
- Goals (`goal_ids`, list): Only these goals. Leave empty for every goal of the experiment.
- Count conversions (`conversion_type`, text): Whether every conversion counts, or each visit at most once. Leave empty for every conversion. One of: `ALL_CONVERSION` (Every conversion), `CONVERTED_VISITS` (Converted visits (once per visit)). Default: `ALL_CONVERSION`.
- Unique visitors (`unique_visitors`, true/false): On to count unique visitors rather than visits.
- Sequential testing (`sequential_testing`, true/false): On to include the sequential testing result.
- Bayesian probability (`bayesian`, true/false): On to include the Bayesian probability of each variation winning.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "dataCode": "example"
  }
}
```

### Turn feature flag on or off

Turn a feature flag on or off in one environment, such as production.

**Inputs**

- Project (`site_code`, text, required): The project the feature flag belongs to, by its site code.
- Feature flag (`feature_key`, text, required): The feature flag, by its key.
- Environment (`environment`, text, required): The environment, such as `production`.
- On (`enabled`, true/false, required): On to turn the flag on in the environment, off to turn it off.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "archived": true,
    "dateCreated": "example",
    "dateModified": "example",
    "description": "example",
    "environmentConfigurations": [
      {
        "dateModified": "example",
        "defaultVariationKey": "example",
        "environmentKey": "example",
        "featureEnabled": true
      }
    ],
    "featureKey": "example",
    "health": "example",
    "id": 1,
    "name": "example",
    "primaryGoalId": 1,
    "siteCode": "example",
    "tags": [
      "example"
    ],
    "variations": [
      {
        "key": "example",
        "name": "example"
      }
    ]
  }
}
```

### Update experiment

Change an experiment's name, description, page, goals, tags, shared code or traffic allocation. Fields left empty stay as they are.

**Inputs**

- Experiment (`experiment_id`, number, required): The experiment. At least 1.
- Name (`name`, text): The new name.
- Description (`description`, text): The new description.
- Hypothesis (`hypothesis`, text): The new hypothesis.
- Page URL (`base_url`, text): The page the editor and preview open.
- Goals (`goals`, list): The goals the experiment measures. This replaces its current goals.
- Main goal (`main_goal_id`, number): The goal that decides the winning variation. At least 1.
- Traffic allocation (`traffic_allocation`, text): How visitors are split between variations. One of: `MANUAL` (Manual split), `MULTI_ARMED_BANDIT` (Multi-armed bandit), `CONTEXTUAL_BANDIT` (Contextual bandit).
- JavaScript for all variations (`common_js`, text): JavaScript that runs in every variation.
- CSS for all variations (`common_css`, text): CSS applied in every variation.
- Tags (`tags`, list): The experiment's tags. This replaces its current tags.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "baseURL": "example",
    "dateCreated": "example",
    "dateEnded": "example",
    "dateModified": "example",
    "dateStarted": "example",
    "dateStatusModified": "example",
    "description": "example",
    "deviations": {},
    "goals": [
      1
    ],
    "hypothesis": "example",
    "id": 1,
    "isArchived": true,
    "mainGoalId": 1,
    "name": "example",
    "siteCode": "example",
    "siteId": 1,
    "status": "example",
    "tags": [
      "example"
    ],
    "trafficAllocationMethod": "example",
    "type": "example",
    "variations": [
      1
    ]
  }
}
```

### Update goal

Change a goal's name, description, tags or whether it counts every conversion. Fields left empty stay as they are.

**Inputs**

- Goal (`goal_id`, number, required): The goal. At least 1.
- Name (`name`, text): The new name.
- Description (`description`, text): The new description.
- Count every conversion (`multiple_conversions`, true/false): On to count every conversion in a visit, off for only the first.
- Tags (`tags`, list): The goal's tags. This replaces its current tags.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "dateCreated": "example",
    "dateModified": "example",
    "description": "example",
    "hasMultipleConversions": true,
    "id": 1,
    "name": "example",
    "params": {},
    "siteId": 1,
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example"
  }
}
```

### Update variation

Change a variation's name, JavaScript or CSS. Fields left empty stay as they are.

**Inputs**

- Variation (`variation_id`, number, required): The variation, from List variations. At least 1.
- Name (`name`, text): The new name.
- JavaScript (`js_code`, text): The variation's JavaScript, replacing what it has.
- CSS (`css_code`, text): The variation's CSS, replacing what it has.

**Outputs**

- `data` (object): The response from Kameleoon.

**Example output**

```json
{
  "data": {
    "creationMode": "example",
    "cssCode": "example",
    "experimentId": 1,
    "id": 1,
    "isJsCodeAfterDomReady": true,
    "jsCode": "example",
    "name": "example",
    "personalizationId": 1,
    "siteId": 1
  }
}
```
