Skip to main content
PATCH
/
feature-flags
/
{siteCode}
/
{featureKey}
Update a feature flag configuration
curl --request PATCH \
  --url https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey} \
  --header 'Content-Type: application/json' \
  --data '
{
  "featureKey": "<string>",
  "attributionWindow": 123,
  "bucketingKey": {
    "customDataId": 123
  },
  "description": "<string>",
  "environmentConfigurations": [
    {
      "defaultVariationKey": "<string>",
      "environmentKey": "<string>",
      "featureEnabled": true,
      "integrations": {
        "deliveryRules": "<array>",
        "experimentRules": "<array>"
      },
      "rolloutRules": [
        {
          "exposition": 50,
          "id": 123,
          "name": "<string>",
          "orderIndex": 123,
          "reallocation": true,
          "release": {
            "timeZone": "Europe/Paris",
            "releaseFrom": "2023-11-07T05:31:56Z",
            "releaseTo": "2023-11-07T05:31:56Z"
          },
          "rollbackConditions": [
            {
              "goalId": 123,
              "matchValue": 50.00005,
              "visitors": 2,
              "id": 123,
              "recipients": [
                "jsmith@example.com"
              ]
            }
          ],
          "segmentId": 123,
          "controlVariationKey": "<string>",
          "multiArmedBandit": true,
          "trafficAllocations": [
            {
              "exposition": 123,
              "variationId": 123,
              "variationKey": "<string>"
            }
          ]
        }
      ]
    }
  ],
  "isArchived": true,
  "name": "<string>",
  "primaryGoalId": 123,
  "secondaryGoalIds": [
    123
  ],
  "tags": [
    "<string>"
  ],
  "variables": [
    {
      "key": "<string>",
      "value": "<string>",
      "allowedValues": [
        "<string>"
      ]
    }
  ],
  "variations": [
    {
      "key": "<string>",
      "name": "<string>",
      "variables": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ]
    }
  ]
}
'
import requests

url = "https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}"

payload = {
"featureKey": "<string>",
"attributionWindow": 123,
"bucketingKey": { "customDataId": 123 },
"description": "<string>",
"environmentConfigurations": [
{
"defaultVariationKey": "<string>",
"environmentKey": "<string>",
"featureEnabled": True,
"integrations": {
"deliveryRules": "<array>",
"experimentRules": "<array>"
},
"rolloutRules": [
{
"exposition": 50,
"id": 123,
"name": "<string>",
"orderIndex": 123,
"reallocation": True,
"release": {
"timeZone": "Europe/Paris",
"releaseFrom": "2023-11-07T05:31:56Z",
"releaseTo": "2023-11-07T05:31:56Z"
},
"rollbackConditions": [
{
"goalId": 123,
"matchValue": 50.00005,
"visitors": 2,
"id": 123,
"recipients": ["jsmith@example.com"]
}
],
"segmentId": 123,
"controlVariationKey": "<string>",
"multiArmedBandit": True,
"trafficAllocations": [
{
"exposition": 123,
"variationId": 123,
"variationKey": "<string>"
}
]
}
]
}
],
"isArchived": True,
"name": "<string>",
"primaryGoalId": 123,
"secondaryGoalIds": [123],
"tags": ["<string>"],
"variables": [
{
"key": "<string>",
"value": "<string>",
"allowedValues": ["<string>"]
}
],
"variations": [
{
"key": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
]
}
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
featureKey: '<string>',
attributionWindow: 123,
bucketingKey: {customDataId: 123},
description: '<string>',
environmentConfigurations: [
{
defaultVariationKey: '<string>',
environmentKey: '<string>',
featureEnabled: true,
integrations: {deliveryRules: '<array>', experimentRules: '<array>'},
rolloutRules: [
{
exposition: 50,
id: 123,
name: '<string>',
orderIndex: 123,
reallocation: true,
release: {
timeZone: 'Europe/Paris',
releaseFrom: '2023-11-07T05:31:56Z',
releaseTo: '2023-11-07T05:31:56Z'
},
rollbackConditions: [
{
goalId: 123,
matchValue: 50.00005,
visitors: 2,
id: 123,
recipients: ['jsmith@example.com']
}
],
segmentId: 123,
controlVariationKey: '<string>',
multiArmedBandit: true,
trafficAllocations: [{exposition: 123, variationId: 123, variationKey: '<string>'}]
}
]
}
],
isArchived: true,
name: '<string>',
primaryGoalId: 123,
secondaryGoalIds: [123],
tags: ['<string>'],
variables: [{key: '<string>', value: '<string>', allowedValues: ['<string>']}],
variations: [
{
key: '<string>',
name: '<string>',
variables: [{key: '<string>', value: '<string>'}]
}
]
})
};

fetch('https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'featureKey' => '<string>',
'attributionWindow' => 123,
'bucketingKey' => [
'customDataId' => 123
],
'description' => '<string>',
'environmentConfigurations' => [
[
'defaultVariationKey' => '<string>',
'environmentKey' => '<string>',
'featureEnabled' => true,
'integrations' => [
'deliveryRules' => '<array>',
'experimentRules' => '<array>'
],
'rolloutRules' => [
[
'exposition' => 50,
'id' => 123,
'name' => '<string>',
'orderIndex' => 123,
'reallocation' => true,
'release' => [
'timeZone' => 'Europe/Paris',
'releaseFrom' => '2023-11-07T05:31:56Z',
'releaseTo' => '2023-11-07T05:31:56Z'
],
'rollbackConditions' => [
[
'goalId' => 123,
'matchValue' => 50.00005,
'visitors' => 2,
'id' => 123,
'recipients' => [
'jsmith@example.com'
]
]
],
'segmentId' => 123,
'controlVariationKey' => '<string>',
'multiArmedBandit' => true,
'trafficAllocations' => [
[
'exposition' => 123,
'variationId' => 123,
'variationKey' => '<string>'
]
]
]
]
]
],
'isArchived' => true,
'name' => '<string>',
'primaryGoalId' => 123,
'secondaryGoalIds' => [
123
],
'tags' => [
'<string>'
],
'variables' => [
[
'key' => '<string>',
'value' => '<string>',
'allowedValues' => [
'<string>'
]
]
],
'variations' => [
[
'key' => '<string>',
'name' => '<string>',
'variables' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}"

payload := strings.NewReader("{\n \"featureKey\": \"<string>\",\n \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"description\": \"<string>\",\n \"environmentConfigurations\": [\n {\n \"defaultVariationKey\": \"<string>\",\n \"environmentKey\": \"<string>\",\n \"featureEnabled\": true,\n \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"rolloutRules\": [\n {\n \"exposition\": 50,\n \"id\": 123,\n \"name\": \"<string>\",\n \"orderIndex\": 123,\n \"reallocation\": true,\n \"release\": {\n \"timeZone\": \"Europe/Paris\",\n \"releaseFrom\": \"2023-11-07T05:31:56Z\",\n \"releaseTo\": \"2023-11-07T05:31:56Z\"\n },\n \"rollbackConditions\": [\n {\n \"goalId\": 123,\n \"matchValue\": 50.00005,\n \"visitors\": 2,\n \"id\": 123,\n \"recipients\": [\n \"jsmith@example.com\"\n ]\n }\n ],\n \"segmentId\": 123,\n \"controlVariationKey\": \"<string>\",\n \"multiArmedBandit\": true,\n \"trafficAllocations\": [\n {\n \"exposition\": 123,\n \"variationId\": 123,\n \"variationKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ],\n \"isArchived\": true,\n \"name\": \"<string>\",\n \"primaryGoalId\": 123,\n \"secondaryGoalIds\": [\n 123\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"allowedValues\": [\n \"<string>\"\n ]\n }\n ],\n \"variations\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}")
.header("Content-Type", "application/json")
.body("{\n \"featureKey\": \"<string>\",\n \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"description\": \"<string>\",\n \"environmentConfigurations\": [\n {\n \"defaultVariationKey\": \"<string>\",\n \"environmentKey\": \"<string>\",\n \"featureEnabled\": true,\n \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"rolloutRules\": [\n {\n \"exposition\": 50,\n \"id\": 123,\n \"name\": \"<string>\",\n \"orderIndex\": 123,\n \"reallocation\": true,\n \"release\": {\n \"timeZone\": \"Europe/Paris\",\n \"releaseFrom\": \"2023-11-07T05:31:56Z\",\n \"releaseTo\": \"2023-11-07T05:31:56Z\"\n },\n \"rollbackConditions\": [\n {\n \"goalId\": 123,\n \"matchValue\": 50.00005,\n \"visitors\": 2,\n \"id\": 123,\n \"recipients\": [\n \"jsmith@example.com\"\n ]\n }\n ],\n \"segmentId\": 123,\n \"controlVariationKey\": \"<string>\",\n \"multiArmedBandit\": true,\n \"trafficAllocations\": [\n {\n \"exposition\": 123,\n \"variationId\": 123,\n \"variationKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ],\n \"isArchived\": true,\n \"name\": \"<string>\",\n \"primaryGoalId\": 123,\n \"secondaryGoalIds\": [\n 123\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"allowedValues\": [\n \"<string>\"\n ]\n }\n ],\n \"variations\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"featureKey\": \"<string>\",\n \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"description\": \"<string>\",\n \"environmentConfigurations\": [\n {\n \"defaultVariationKey\": \"<string>\",\n \"environmentKey\": \"<string>\",\n \"featureEnabled\": true,\n \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"rolloutRules\": [\n {\n \"exposition\": 50,\n \"id\": 123,\n \"name\": \"<string>\",\n \"orderIndex\": 123,\n \"reallocation\": true,\n \"release\": {\n \"timeZone\": \"Europe/Paris\",\n \"releaseFrom\": \"2023-11-07T05:31:56Z\",\n \"releaseTo\": \"2023-11-07T05:31:56Z\"\n },\n \"rollbackConditions\": [\n {\n \"goalId\": 123,\n \"matchValue\": 50.00005,\n \"visitors\": 2,\n \"id\": 123,\n \"recipients\": [\n \"jsmith@example.com\"\n ]\n }\n ],\n \"segmentId\": 123,\n \"controlVariationKey\": \"<string>\",\n \"multiArmedBandit\": true,\n \"trafficAllocations\": [\n {\n \"exposition\": 123,\n \"variationId\": 123,\n \"variationKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ],\n \"isArchived\": true,\n \"name\": \"<string>\",\n \"primaryGoalId\": 123,\n \"secondaryGoalIds\": [\n 123\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"allowedValues\": [\n \"<string>\"\n ]\n }\n ],\n \"variations\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "featureKey": "<string>",
  "id": 123,
  "name": "<string>",
  "siteCode": "<string>",
  "archived": true,
  "attributionWindow": 123,
  "bucketingKey": {
    "customDataId": 123
  },
  "createdById": 123,
  "dateContentModified": "2023-11-07T05:31:56Z",
  "dateCreated": "2023-11-07T05:31:56Z",
  "dateModified": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "environmentConfigurations": [
    {
      "dateModified": "2023-11-07T05:31:56Z",
      "defaultVariationKey": "<string>",
      "environmentKey": "<string>",
      "featureEnabled": true,
      "integrations": {
        "deliveryRules": "<array>",
        "experimentRules": "<array>"
      },
      "rolloutRules": [
        {
          "experimentId": 123,
          "id": 123,
          "name": "<string>",
          "release": {
            "releaseFrom": "2023-11-07T05:31:56Z",
            "releaseTo": "2023-11-07T05:31:56Z",
            "timeZone": "Europe/Paris"
          },
          "rollbackConditions": [
            {
              "goalId": 123,
              "id": 123,
              "matchValue": 50,
              "recipients": [
                "<string>"
              ],
              "visitors": 1000
            }
          ],
          "segmentId": 123,
          "trafficAllocations": [
            {
              "exposition": 123,
              "variationId": 123,
              "variationKey": "<string>"
            }
          ],
          "controlVariationKey": "<string>",
          "exposition": 50,
          "multiArmedBandit": true
        }
      ]
    }
  ],
  "primaryGoalId": 123,
  "secondaryGoalIds": [
    123
  ],
  "tags": [
    "<string>"
  ],
  "teamId": 123,
  "variables": [
    {
      "key": "<string>",
      "value": "<string>",
      "allowedValues": [
        "<string>"
      ]
    }
  ],
  "variations": [
    {
      "key": "<string>",
      "name": "<string>",
      "variables": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ]
    }
  ]
}
{
"message": "<string>",
"serviceName": "<string>",
"status": "<string>",
"time": 123
}
{
"message": "<string>",
"serviceName": "<string>",
"status": "<string>",
"time": 123
}
{
"message": "<string>",
"serviceName": "<string>",
"status": "<string>",
"time": 123
}
{
"message": "<string>",
"serviceName": "<string>",
"status": "<string>",
"time": 123
}
{
"message": "<string>",
"serviceName": "<string>",
"status": "<string>",
"time": 123
}

Path Parameters

siteCode
string
required
Required string length: 10
featureKey
string
required
Minimum string length: 1

Body

application/json

Payload used to update an existing feature flag

featureKey
string
required

Key used to identify the feature flag

Maximum string length: 255
Pattern: ^[a-z0-9_-]{1,255}$
attributionWindow
integer<int64>

Attribution window in milliseconds

bucketingKey
Bucketing key custom data dto · object

Bucketing key used for the feature flag

description
string

Description of the feature flag

Maximum string length: 5000
environmentConfigurations
Environment request · object[]

Environment-specific configurations for the feature flag

isArchived
boolean

Flag indicating if the feature flag is archived

name
string

Name of the feature flag

Maximum string length: 100
primaryGoalId
integer<int32>

Primary goal associated with the feature flag

secondaryGoalIds
integer<int32>[]

Secondary goals associated with the feature flag

tags
string[]

List of tags associated with the feature flag

variables
Variable request · object[]

Variables associated with the feature flag

variations
Variation request · object[]

Variations associated with the feature flag

Response

OK

Configuration for the feature flag

featureKey
string
required

Key used to identify the feature flag

Required string length: 1 - 255
id
integer<int32>
required
read-only

System-generated unique string of integers to identify a feature flag

name
string
required

Name of the feature flag

Required string length: 1 - 100
siteCode
string
required

Unique Id for the project in the Kameleoon app. This is an optional field to be included as query parameters

Required string length: 1 - 10
archived
boolean
attributionWindow
integer<int64>

Attribution window

bucketingKey
Bucketing key custom data dto · object

Bucketing key used for the feature flag

createdById
integer<int32>
read-only

Created by id

dateContentModified
string<date-time>
read-only

Date and time when the feature flag configuration content was last modified

dateCreated
string<date-time>
read-only

Date and time when the feature flag configuration was created

dateModified
string<date-time>
read-only

Date and time when the feature flag configuration was last modified

description
string

Description of the feature

Maximum string length: 5000
environmentConfigurations
Environment response · object[]

Environment-specific configurations for the feature flag

health
enum<string>
read-only

Health of the feature flag (for temporary ones)

Available options:
PERMANENT,
HEALTHY,
STALE,
SMELLY
primaryGoalId
integer<int32>

Primary goal of the feature flag

secondaryGoalIds
integer<int32>[]

Secondary goals associated with the feature flag

tags
string[]

List of tags associated with the feature flag. This is an optional field to be included as query parameters

teamId
integer<int64>
read-only

Team id

variables
Variable response · object[]

Variables associated with the feature flag

variations
Variation response · object[]

Variations associated with the feature flag