curl --request POST \
--url https://api.kameleoon.com/feature-flags \
--header 'Content-Type: application/json' \
--data '
{
"featureKey": "<string>",
"name": "<string>",
"siteCode": "<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>"
}
]
}
]
}
],
"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"
payload = {
"featureKey": "<string>",
"name": "<string>",
"siteCode": "<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>"
}
]
}
]
}
],
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
featureKey: '<string>',
name: '<string>',
siteCode: '<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>'}]
}
]
}
],
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'featureKey' => '<string>',
'name' => '<string>',
'siteCode' => '<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>'
]
]
]
]
]
],
'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"
payload := strings.NewReader("{\n \"featureKey\": \"<string>\",\n \"name\": \"<string>\",\n \"siteCode\": \"<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 \"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("POST", 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.post("https://api.kameleoon.com/feature-flags")
.header("Content-Type", "application/json")
.body("{\n \"featureKey\": \"<string>\",\n \"name\": \"<string>\",\n \"siteCode\": \"<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 \"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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"featureKey\": \"<string>\",\n \"name\": \"<string>\",\n \"siteCode\": \"<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 \"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
}Create a new feature flag configuration
Create new feature flag configurations with given parameters.
curl --request POST \
--url https://api.kameleoon.com/feature-flags \
--header 'Content-Type: application/json' \
--data '
{
"featureKey": "<string>",
"name": "<string>",
"siteCode": "<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>"
}
]
}
]
}
],
"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"
payload = {
"featureKey": "<string>",
"name": "<string>",
"siteCode": "<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>"
}
]
}
]
}
],
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
featureKey: '<string>',
name: '<string>',
siteCode: '<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>'}]
}
]
}
],
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'featureKey' => '<string>',
'name' => '<string>',
'siteCode' => '<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>'
]
]
]
]
]
],
'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"
payload := strings.NewReader("{\n \"featureKey\": \"<string>\",\n \"name\": \"<string>\",\n \"siteCode\": \"<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 \"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("POST", 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.post("https://api.kameleoon.com/feature-flags")
.header("Content-Type", "application/json")
.body("{\n \"featureKey\": \"<string>\",\n \"name\": \"<string>\",\n \"siteCode\": \"<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 \"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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"featureKey\": \"<string>\",\n \"name\": \"<string>\",\n \"siteCode\": \"<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 \"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
}Body
Request to create a feature flag
Key of the feature flag
255^[a-z0-9_-]{1,255}$Name of the feature flag
100Unique Id of the website/app for your project in the Kameleoon app
10Attribution 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
Description of the feature
5000Environment configurations for the feature flag
Show child attributes
Show child attributes
Primary goal associated with the feature flag
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 for the feature flag
Show child attributes
Show child attributes
Response
Created
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?