curl --request PATCH \
--url https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey} \
--header 'Content-Type: application/json' \
--data '
{
"featureKey": "<string>",
"integrations": {
"deliveryRules": "<array>",
"experimentRules": "<array>"
},
"name": "<string>",
"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>"
}
]
}
],
"secondaryGoalIds": [
123
],
"tags": [
"<string>"
],
"variables": [
{
"key": "<string>",
"value": "<string>",
"allowedValues": [
"<string>"
]
}
],
"variations": [
{
"key": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"attributionWindow": 123,
"bucketingKey": {
"customDataId": 123
},
"defaultVariationKey": "<string>",
"description": "<string>",
"featureEnabled": true,
"isArchived": true,
"primaryGoalId": 123
}
'import requests
url = "https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey}"
payload = {
"featureKey": "<string>",
"integrations": {
"deliveryRules": "<array>",
"experimentRules": "<array>"
},
"name": "<string>",
"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>"
}
]
}
],
"secondaryGoalIds": [123],
"tags": ["<string>"],
"variables": [
{
"key": "<string>",
"value": "<string>",
"allowedValues": ["<string>"]
}
],
"variations": [
{
"key": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"attributionWindow": 123,
"bucketingKey": { "customDataId": 123 },
"defaultVariationKey": "<string>",
"description": "<string>",
"featureEnabled": True,
"isArchived": True,
"primaryGoalId": 123
}
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>',
integrations: {deliveryRules: '<array>', experimentRules: '<array>'},
name: '<string>',
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>'}]
}
],
secondaryGoalIds: [123],
tags: ['<string>'],
variables: [{key: '<string>', value: '<string>', allowedValues: ['<string>']}],
variations: [
{
key: '<string>',
name: '<string>',
variables: [{key: '<string>', value: '<string>'}]
}
],
attributionWindow: 123,
bucketingKey: {customDataId: 123},
defaultVariationKey: '<string>',
description: '<string>',
featureEnabled: true,
isArchived: true,
primaryGoalId: 123
})
};
fetch('https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey}', 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}/{environmentKey}",
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>',
'integrations' => [
'deliveryRules' => '<array>',
'experimentRules' => '<array>'
],
'name' => '<string>',
'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>'
]
]
]
],
'secondaryGoalIds' => [
123
],
'tags' => [
'<string>'
],
'variables' => [
[
'key' => '<string>',
'value' => '<string>',
'allowedValues' => [
'<string>'
]
]
],
'variations' => [
[
'key' => '<string>',
'name' => '<string>',
'variables' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]
],
'attributionWindow' => 123,
'bucketingKey' => [
'customDataId' => 123
],
'defaultVariationKey' => '<string>',
'description' => '<string>',
'featureEnabled' => true,
'isArchived' => true,
'primaryGoalId' => 123
]),
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}/{environmentKey}"
payload := strings.NewReader("{\n \"featureKey\": \"<string>\",\n \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"name\": \"<string>\",\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 \"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 \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"defaultVariationKey\": \"<string>\",\n \"description\": \"<string>\",\n \"featureEnabled\": true,\n \"isArchived\": true,\n \"primaryGoalId\": 123\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}/{environmentKey}")
.header("Content-Type", "application/json")
.body("{\n \"featureKey\": \"<string>\",\n \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"name\": \"<string>\",\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 \"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 \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"defaultVariationKey\": \"<string>\",\n \"description\": \"<string>\",\n \"featureEnabled\": true,\n \"isArchived\": true,\n \"primaryGoalId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey}")
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 \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"name\": \"<string>\",\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 \"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 \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"defaultVariationKey\": \"<string>\",\n \"description\": \"<string>\",\n \"featureEnabled\": true,\n \"isArchived\": true,\n \"primaryGoalId\": 123\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
}Update a feature flag configuration for a specific environment
Updates the configuration of a feature flag using a JSON Merge Patch for the specified site code, feature key, and environment key. Note: If you need to modify an element within an array, the entire array — including all its fields — must be provided, as partial updates to array elements are not supported.
curl --request PATCH \
--url https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey} \
--header 'Content-Type: application/json' \
--data '
{
"featureKey": "<string>",
"integrations": {
"deliveryRules": "<array>",
"experimentRules": "<array>"
},
"name": "<string>",
"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>"
}
]
}
],
"secondaryGoalIds": [
123
],
"tags": [
"<string>"
],
"variables": [
{
"key": "<string>",
"value": "<string>",
"allowedValues": [
"<string>"
]
}
],
"variations": [
{
"key": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"attributionWindow": 123,
"bucketingKey": {
"customDataId": 123
},
"defaultVariationKey": "<string>",
"description": "<string>",
"featureEnabled": true,
"isArchived": true,
"primaryGoalId": 123
}
'import requests
url = "https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey}"
payload = {
"featureKey": "<string>",
"integrations": {
"deliveryRules": "<array>",
"experimentRules": "<array>"
},
"name": "<string>",
"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>"
}
]
}
],
"secondaryGoalIds": [123],
"tags": ["<string>"],
"variables": [
{
"key": "<string>",
"value": "<string>",
"allowedValues": ["<string>"]
}
],
"variations": [
{
"key": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"attributionWindow": 123,
"bucketingKey": { "customDataId": 123 },
"defaultVariationKey": "<string>",
"description": "<string>",
"featureEnabled": True,
"isArchived": True,
"primaryGoalId": 123
}
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>',
integrations: {deliveryRules: '<array>', experimentRules: '<array>'},
name: '<string>',
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>'}]
}
],
secondaryGoalIds: [123],
tags: ['<string>'],
variables: [{key: '<string>', value: '<string>', allowedValues: ['<string>']}],
variations: [
{
key: '<string>',
name: '<string>',
variables: [{key: '<string>', value: '<string>'}]
}
],
attributionWindow: 123,
bucketingKey: {customDataId: 123},
defaultVariationKey: '<string>',
description: '<string>',
featureEnabled: true,
isArchived: true,
primaryGoalId: 123
})
};
fetch('https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey}', 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}/{environmentKey}",
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>',
'integrations' => [
'deliveryRules' => '<array>',
'experimentRules' => '<array>'
],
'name' => '<string>',
'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>'
]
]
]
],
'secondaryGoalIds' => [
123
],
'tags' => [
'<string>'
],
'variables' => [
[
'key' => '<string>',
'value' => '<string>',
'allowedValues' => [
'<string>'
]
]
],
'variations' => [
[
'key' => '<string>',
'name' => '<string>',
'variables' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]
],
'attributionWindow' => 123,
'bucketingKey' => [
'customDataId' => 123
],
'defaultVariationKey' => '<string>',
'description' => '<string>',
'featureEnabled' => true,
'isArchived' => true,
'primaryGoalId' => 123
]),
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}/{environmentKey}"
payload := strings.NewReader("{\n \"featureKey\": \"<string>\",\n \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"name\": \"<string>\",\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 \"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 \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"defaultVariationKey\": \"<string>\",\n \"description\": \"<string>\",\n \"featureEnabled\": true,\n \"isArchived\": true,\n \"primaryGoalId\": 123\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}/{environmentKey}")
.header("Content-Type", "application/json")
.body("{\n \"featureKey\": \"<string>\",\n \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"name\": \"<string>\",\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 \"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 \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"defaultVariationKey\": \"<string>\",\n \"description\": \"<string>\",\n \"featureEnabled\": true,\n \"isArchived\": true,\n \"primaryGoalId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kameleoon.com/feature-flags/{siteCode}/{featureKey}/{environmentKey}")
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 \"integrations\": {\n \"deliveryRules\": \"<array>\",\n \"experimentRules\": \"<array>\"\n },\n \"name\": \"<string>\",\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 \"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 \"attributionWindow\": 123,\n \"bucketingKey\": {\n \"customDataId\": 123\n },\n \"defaultVariationKey\": \"<string>\",\n \"description\": \"<string>\",\n \"featureEnabled\": true,\n \"isArchived\": true,\n \"primaryGoalId\": 123\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
1011Body
Represents the input object for patching a feature flag for a specific environment
Key used to identify the feature flag
1 - 255Integrations associated with the feature flag environment
Show child attributes
Show child attributes
Name of the feature flag
1 - 100The rollout rules for this environment
Represents an experimentation rule configuration
- Experimentation rule request
- Progressive rule request
- Targeted rule request
Show child attributes
Show child attributes
Secondary goals associated with the feature flag
List of tags associated with the feature flag
Variables associated with the feature flag
Show child attributes
Show child attributes
Variations associated with the feature flag
Show child attributes
Show child attributes
Attribution window in milliseconds
Bucketing key used for the feature flag
- Bucketing key custom data dto
- Bucketing key visitor code dto
Show child attributes
Show child attributes
The default variation key to serve in this environment
255Description of the feature flag
5000Indicates if the feature flag is enabled in this environment
Flag indicating if the feature flag is archived
Primary goal associated with the feature flag
Response
OK
Configuration for the feature flag
Key used to identify the feature flag
1 - 255System-generated unique string of integers to identify a feature flag
Name of the feature flag
1 - 100Unique Id for the project in the Kameleoon app. This is an optional field to be included as query parameters
1 - 10Attribution window
Bucketing key used for the feature flag
- Bucketing key custom data dto
- Bucketing key visitor code dto
Show child attributes
Show child attributes
Created by id
Date and time when the feature flag configuration content was last modified
Date and time when the feature flag configuration was created
Date and time when the feature flag configuration was last modified
Description of the feature
5000Environment-specific configurations for the feature flag
Show child attributes
Show child attributes
Health of the feature flag (for temporary ones)
PERMANENT, HEALTHY, STALE, SMELLY Primary goal of the feature flag
Secondary goals associated with the feature flag
List of tags associated with the feature flag. This is an optional field to be included as query parameters
Team id
Variables associated with the feature flag
Show child attributes
Show child attributes
Variations associated with the feature flag
Show child attributes
Show child attributes
Was this page helpful?