Create an experiment for the Experiment Center.
curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": {
"subject": "device"
},
"allocations": [
{
"variation_id": "<string>",
"is_control": true,
"weight": 50,
"segment_id": "<string>",
"priority": 2,
"is_fallback": true
}
],
"description": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/experimentation/experiments"
payload = {
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": { "subject": "device" },
"allocations": [
{
"variation_id": "<string>",
"is_control": True,
"weight": 50,
"segment_id": "<string>",
"priority": 2,
"is_fallback": True
}
],
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
feature_flag_id: '<string>',
authentication_flow: '<string>',
assignment_config: {subject: 'device'},
allocations: [
{
variation_id: '<string>',
is_control: true,
weight: 50,
segment_id: '<string>',
priority: 2,
is_fallback: true
}
],
description: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments', 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://{tenantDomain}/api/v2/experimentation/experiments",
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([
'name' => '<string>',
'feature_flag_id' => '<string>',
'authentication_flow' => '<string>',
'assignment_config' => [
'subject' => 'device'
],
'allocations' => [
[
'variation_id' => '<string>',
'is_control' => true,
'weight' => 50,
'segment_id' => '<string>',
'priority' => 2,
'is_fallback' => true
]
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{tenantDomain}/api/v2/experimentation/experiments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"authentication_flow\": \"<string>\",\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"<string>\",\n \"is_control\": true,\n \"weight\": 50,\n \"segment_id\": \"<string>\",\n \"priority\": 2,\n \"is_fallback\": true\n }\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{tenantDomain}/api/v2/experimentation/experiments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"authentication_flow\": \"<string>\",\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"<string>\",\n \"is_control\": true,\n \"weight\": 50,\n \"segment_id\": \"<string>\",\n \"priority\": 2,\n \"is_fallback\": true\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/experimentation/experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"authentication_flow\": \"<string>\",\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"<string>\",\n \"is_control\": true,\n \"weight\": 50,\n \"segment_id\": \"<string>\",\n \"priority\": 2,\n \"is_fallback\": true\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": {
"subject": "device"
},
"is_valid": true,
"allocations": [
{
"variation_id": "<string>",
"segment_id": "<string>",
"weight": 123,
"priority": 123,
"is_control": true,
"is_fallback": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}Create an experiment for the Experiment Center.
Create a new experiment with traffic allocations for A/B testing.
POST
https://{tenantDomain}/api/v2
/
experimentation
/
experiments
Create an experiment for the Experiment Center.
curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": {
"subject": "device"
},
"allocations": [
{
"variation_id": "<string>",
"is_control": true,
"weight": 50,
"segment_id": "<string>",
"priority": 2,
"is_fallback": true
}
],
"description": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/experimentation/experiments"
payload = {
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": { "subject": "device" },
"allocations": [
{
"variation_id": "<string>",
"is_control": True,
"weight": 50,
"segment_id": "<string>",
"priority": 2,
"is_fallback": True
}
],
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
feature_flag_id: '<string>',
authentication_flow: '<string>',
assignment_config: {subject: 'device'},
allocations: [
{
variation_id: '<string>',
is_control: true,
weight: 50,
segment_id: '<string>',
priority: 2,
is_fallback: true
}
],
description: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments', 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://{tenantDomain}/api/v2/experimentation/experiments",
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([
'name' => '<string>',
'feature_flag_id' => '<string>',
'authentication_flow' => '<string>',
'assignment_config' => [
'subject' => 'device'
],
'allocations' => [
[
'variation_id' => '<string>',
'is_control' => true,
'weight' => 50,
'segment_id' => '<string>',
'priority' => 2,
'is_fallback' => true
]
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{tenantDomain}/api/v2/experimentation/experiments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"authentication_flow\": \"<string>\",\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"<string>\",\n \"is_control\": true,\n \"weight\": 50,\n \"segment_id\": \"<string>\",\n \"priority\": 2,\n \"is_fallback\": true\n }\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{tenantDomain}/api/v2/experimentation/experiments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"authentication_flow\": \"<string>\",\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"<string>\",\n \"is_control\": true,\n \"weight\": 50,\n \"segment_id\": \"<string>\",\n \"priority\": 2,\n \"is_fallback\": true\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/experimentation/experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"authentication_flow\": \"<string>\",\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"<string>\",\n \"is_control\": true,\n \"weight\": 50,\n \"segment_id\": \"<string>\",\n \"priority\": 2,\n \"is_fallback\": true\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": {
"subject": "device"
},
"is_valid": true,
"allocations": [
{
"variation_id": "<string>",
"segment_id": "<string>",
"weight": 123,
"priority": 123,
"is_control": true,
"is_fallback": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}Autorisations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
application/jsonapplication/x-www-form-urlencoded
Create an experiment with traffic allocation
A human-readable name for the experiment
Required string length:
3 - 255Pattern:
^(?!.*\x00)\S(.*\S)?$The ID of the feature flag this experiment is based on
Pattern:
^flg_[A-HJ-NP-Za-km-z1-9]+$The authentication flow this experiment applies to
The traffic allocation strategy for this experiment
Options disponibles:
percentage, segment Configuration for how users are assigned to variations
Show child attributes
Show child attributes
Traffic allocations mapping variations to weights or segments
Minimum array length:
1Show child attributes
Show child attributes
A description of the experiment
Required string length:
3 - 1024Pattern:
^(?!.*\x00)\S(.*\S)?$Réponse
Experiment successfully created.
Pattern:
^exp_[A-HJ-NP-Za-km-z1-9]+$Options disponibles:
percentage, segment Show child attributes
Show child attributes
Filter by status. Exact match.
Options disponibles:
draft, active, paused, completed, archived Show child attributes
Show child attributes
⌘I