Feature flag
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: To modify an element within an array, you must provide the entire array, including all its fields, because the endpoint does not support partial updates to array elements.
PATCH
/
feature-flags
/
{siteCode}
/
{featureKey}
/
{environmentKey}
Update a feature flag configuration for a specific environment
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": {
"bucketingKeyType": "VISITOR_CODE",
"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": [
{
"type": "TARGETED_DELIVERY",
"experimentId": 123,
"id": 123,
"name": "<string>",
"release": {
"releaseFrom": "2023-11-07T05:31:56Z",
"releaseTo": "2023-11-07T05:31:56Z",
"timeZone": "Europe/Paris"
},
"rollbackConditions": [
{
"comparisonOperator": "GREATER_THAN",
"criteria": "CONVERSION_RATE",
"goalId": 123,
"id": 123,
"matchValue": 50,
"recipients": [
"<string>"
],
"target": "RULE",
"visitors": 1000
}
],
"segmentId": 123,
"status": "ACTIVE",
"trafficAllocations": [
{
"exposition": 123,
"variationId": 123,
"variationKey": "<string>"
}
],
"controlVariationKey": "<string>",
"exposition": 50,
"multiArmedBandit": true,
"trafficAllocationMethod": "CONTEXTUAL_BANDIT"
}
]
}
],
"health": "HEALTHY",
"primaryGoalId": 123,
"secondaryGoalIds": [
123
],
"tags": [
"<string>"
],
"teamId": 123,
"variables": [
{
"key": "<string>",
"type": "BOOLEAN",
"value": "<string>",
"allowedValues": [
"<string>"
]
}
],
"variations": [
{
"key": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"type": "BOOLEAN",
"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
Body
application/json
Represents the input object for patching a feature flag for a specific environment
Response
OK
Configuration for the feature flag
Was this page helpful?
⌘I
Update a feature flag configuration for a specific environment
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": {
"bucketingKeyType": "VISITOR_CODE",
"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": [
{
"type": "TARGETED_DELIVERY",
"experimentId": 123,
"id": 123,
"name": "<string>",
"release": {
"releaseFrom": "2023-11-07T05:31:56Z",
"releaseTo": "2023-11-07T05:31:56Z",
"timeZone": "Europe/Paris"
},
"rollbackConditions": [
{
"comparisonOperator": "GREATER_THAN",
"criteria": "CONVERSION_RATE",
"goalId": 123,
"id": 123,
"matchValue": 50,
"recipients": [
"<string>"
],
"target": "RULE",
"visitors": 1000
}
],
"segmentId": 123,
"status": "ACTIVE",
"trafficAllocations": [
{
"exposition": 123,
"variationId": 123,
"variationKey": "<string>"
}
],
"controlVariationKey": "<string>",
"exposition": 50,
"multiArmedBandit": true,
"trafficAllocationMethod": "CONTEXTUAL_BANDIT"
}
]
}
],
"health": "HEALTHY",
"primaryGoalId": 123,
"secondaryGoalIds": [
123
],
"tags": [
"<string>"
],
"teamId": 123,
"variables": [
{
"key": "<string>",
"type": "BOOLEAN",
"value": "<string>",
"allowedValues": [
"<string>"
]
}
],
"variations": [
{
"key": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"type": "BOOLEAN",
"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
}