TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.experiments.list({
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.experiments.list({
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id",
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.ListExperimentsRequestParameters{
From: management.String(
"from",
),
Take: management.Int(
1,
),
Status: management.ExperimentStatusEnumDraft.Ptr(),
AuthenticationFlow: management.String(
"authentication_flow",
),
FeatureFlagID: management.String(
"feature_flag_id",
),
}
mgmt.Experimentation.Experiments.List(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "experimentation/experiments" --query "from=from" --query "take=1" --query "status=draft" --query "authentication_flow=authentication_flow" --query "feature_flag_id=feature_flag_id"using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
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.Experiments.ListAsync(
new ListExperimentsRequestParameters {
From = "from",
Take = 1,
Status = ExperimentStatusEnum.Draft,
AuthenticationFlow = "authentication_flow",
FeatureFlagId = "feature_flag_id"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.ListExperimentsRequestParameters;
import com.auth0.client.mgmt.types.ExperimentStatusEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().experiments().list(
ListExperimentsRequestParameters
.builder()
.from("from")
.take(1)
.status(ExperimentStatusEnum.DRAFT)
.authenticationFlow("authentication_flow")
.featureFlagId("feature_flag_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Experiments\Requests\ListExperimentsRequestParameters;
use Auth0\SDK\API\Management\Types\ExperimentStatusEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->experiments->list(
new ListExperimentsRequestParameters([
'from' => 'from',
'take' => 1,
'status' => ExperimentStatusEnum::Draft->value,
'authenticationFlow' => 'authentication_flow',
'featureFlagId' => 'feature_flag_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.experiments.list(
from_="from",
take=1,
status="draft",
authentication_flow="authentication_flow",
feature_flag_id="feature_flag_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.experiments.list(
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>'{
"experiments": [
{
"id": "<string>",
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"allocation_strategy": "percentage",
"status": "draft",
"is_valid": true,
"allocations": [
{
"variation_id": "<string>",
"variation_name": "<string>",
"segment_id": "<string>",
"segment_name": "<string>",
"weight": 123,
"priority": 123,
"is_control": true,
"is_fallback": true,
"variation_snapshot": {},
"segment_snapshot": {}
}
],
"editable_fields": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"feature_flag_name": "<string>",
"default_config": "tenant",
"feature_flag_snapshot": {},
"levels": [
123
],
"current_level": 123,
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}
],
"next": "<string>"
}List experiments for the tenant.
Retrieve a paginated list of experiments for the tenant, with optional filters.
GET
https://{tenantDomain}/api/v2
/
experimentation
/
experiments
TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.experiments.list({
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.experiments.list({
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id",
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.ListExperimentsRequestParameters{
From: management.String(
"from",
),
Take: management.Int(
1,
),
Status: management.ExperimentStatusEnumDraft.Ptr(),
AuthenticationFlow: management.String(
"authentication_flow",
),
FeatureFlagID: management.String(
"feature_flag_id",
),
}
mgmt.Experimentation.Experiments.List(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "experimentation/experiments" --query "from=from" --query "take=1" --query "status=draft" --query "authentication_flow=authentication_flow" --query "feature_flag_id=feature_flag_id"using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
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.Experiments.ListAsync(
new ListExperimentsRequestParameters {
From = "from",
Take = 1,
Status = ExperimentStatusEnum.Draft,
AuthenticationFlow = "authentication_flow",
FeatureFlagId = "feature_flag_id"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.ListExperimentsRequestParameters;
import com.auth0.client.mgmt.types.ExperimentStatusEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().experiments().list(
ListExperimentsRequestParameters
.builder()
.from("from")
.take(1)
.status(ExperimentStatusEnum.DRAFT)
.authenticationFlow("authentication_flow")
.featureFlagId("feature_flag_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Experiments\Requests\ListExperimentsRequestParameters;
use Auth0\SDK\API\Management\Types\ExperimentStatusEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->experiments->list(
new ListExperimentsRequestParameters([
'from' => 'from',
'take' => 1,
'status' => ExperimentStatusEnum::Draft->value,
'authenticationFlow' => 'authentication_flow',
'featureFlagId' => 'feature_flag_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.experiments.list(
from_="from",
take=1,
status="draft",
authentication_flow="authentication_flow",
feature_flag_id="feature_flag_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.experiments.list(
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>'{
"experiments": [
{
"id": "<string>",
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"allocation_strategy": "percentage",
"status": "draft",
"is_valid": true,
"allocations": [
{
"variation_id": "<string>",
"variation_name": "<string>",
"segment_id": "<string>",
"segment_name": "<string>",
"weight": 123,
"priority": 123,
"is_control": true,
"is_fallback": true,
"variation_snapshot": {},
"segment_snapshot": {}
}
],
"editable_fields": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"feature_flag_name": "<string>",
"default_config": "tenant",
"feature_flag_snapshot": {},
"levels": [
123
],
"current_level": 123,
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}
],
"next": "<string>"
}Authorizations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Optional Id from which to start selection.
Number of experiments to return per page. Defaults to 25, maximum 50.
Required range:
1 <= x <= 50Filter by status. Exact match.
Available options:
draft, active, paused, completed, archived Filter by authentication flow. Exact match.
Filter by feature flag ID. Exact match.