C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.FeatureFlags.CreateAsync(
new CreateFeatureFlagRequestContent {
Name = "name",
Parameters = new Dictionary<string, FeatureFlagConfigParam>()
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.CreateFeatureFlagRequestContent;
import com.auth0.client.mgmt.types.FeatureFlagConfigParam;
import java.util.HashMap;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().featureFlags().create(
CreateFeatureFlagRequestContent
.builder()
.name("name")
.parameters(
new HashMap<String, FeatureFlagConfigParam>()
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\FeatureFlags\Requests\CreateFeatureFlagRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->featureFlags->create(
new CreateFeatureFlagRequestContent([
'name' => 'name',
'parameters' => [],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.feature_flags.create(
name="name",
parameters={},
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.feature_flags.create(
name: "name",
parameters: {}
)
curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/feature-flags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"parameters": {},
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', parameters: {}, description: '<string>'})
};
fetch('https://{tenantDomain}/api/v2/experimentation/feature-flags', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/feature-flags"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"parameters\": {},\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))
}{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"parameters": {}
}Create a feature flag for the Experiment Center.
Create a new feature flag with parameters for use in experiments.
POST
https://{tenantDomain}/api/v2
/
experimentation
/
feature-flags
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.FeatureFlags.CreateAsync(
new CreateFeatureFlagRequestContent {
Name = "name",
Parameters = new Dictionary<string, FeatureFlagConfigParam>()
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.CreateFeatureFlagRequestContent;
import com.auth0.client.mgmt.types.FeatureFlagConfigParam;
import java.util.HashMap;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().featureFlags().create(
CreateFeatureFlagRequestContent
.builder()
.name("name")
.parameters(
new HashMap<String, FeatureFlagConfigParam>()
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\FeatureFlags\Requests\CreateFeatureFlagRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->featureFlags->create(
new CreateFeatureFlagRequestContent([
'name' => 'name',
'parameters' => [],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.feature_flags.create(
name="name",
parameters={},
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.feature_flags.create(
name: "name",
parameters: {}
)
curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/feature-flags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"parameters": {},
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', parameters: {}, description: '<string>'})
};
fetch('https://{tenantDomain}/api/v2/experimentation/feature-flags', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/feature-flags"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"parameters\": {},\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))
}{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"parameters": {}
}Authorizations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/jsonapplication/x-www-form-urlencoded
Create a feature flag for experiment configuration
A human-readable name for the feature flag
Required string length:
3 - 255Pattern:
^(?!.*\x00)\S(.*\S)?$Configuration parameters for this feature flag
Show child attributes
Show child attributes
A description of what this feature flag controls
Required string length:
3 - 1024Pattern:
^(?!.*\x00)\S(.*\S)?$Response
Feature flag successfully created.
Pattern:
^flg_[A-HJ-NP-Za-km-z1-9]+$Filter by type. Exact match.
Available options:
auth0, self Filter by status. Exact match.
Available options:
draft, active, archived Configuration parameters for this feature flag
Show child attributes
Show child attributes
âI