C#
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.UpdateStatusAsync(
id: "id",
request: new UpdateExperimentStatusRequestContent {
Status = ExperimentTransitionStatusEnum.Active
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.UpdateExperimentStatusRequestContent;
import com.auth0.client.mgmt.types.ExperimentTransitionStatusEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().experiments().updateStatus(
"id",
UpdateExperimentStatusRequestContent
.builder()
.status(ExperimentTransitionStatusEnum.ACTIVE)
.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\UpdateExperimentStatusRequestContent;
use Auth0\SDK\API\Management\Types\ExperimentTransitionStatusEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->experiments->updateStatus(
'id',
new UpdateExperimentStatusRequestContent([
'status' => ExperimentTransitionStatusEnum::Active->value,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.experiments.update_status(
id="id",
status="active",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.experiments.update_status(
id: "id",
status: "active"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/experiments/{id}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments/{id}/status', 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/experiments/{id}/status"
payload := strings.NewReader("{}")
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>",
"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"
}Transition an experiment to a new status.
Transitions an experiment through its lifecycle: draft → active, active → paused, paused → active, active/paused → completed. Activation runs full readiness validation.
POST
https://{tenantDomain}/api/v2
/
experimentation
/
experiments
/
{id}
/
status
C#
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.UpdateStatusAsync(
id: "id",
request: new UpdateExperimentStatusRequestContent {
Status = ExperimentTransitionStatusEnum.Active
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.UpdateExperimentStatusRequestContent;
import com.auth0.client.mgmt.types.ExperimentTransitionStatusEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().experiments().updateStatus(
"id",
UpdateExperimentStatusRequestContent
.builder()
.status(ExperimentTransitionStatusEnum.ACTIVE)
.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\UpdateExperimentStatusRequestContent;
use Auth0\SDK\API\Management\Types\ExperimentTransitionStatusEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->experiments->updateStatus(
'id',
new UpdateExperimentStatusRequestContent([
'status' => ExperimentTransitionStatusEnum::Active->value,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.experiments.update_status(
id="id",
status="active",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.experiments.update_status(
id: "id",
status: "active"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/experiments/{id}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments/{id}/status', 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/experiments/{id}/status"
payload := strings.NewReader("{}")
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>",
"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"
}Authorizations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the experiment to transition.
Body
application/jsonapplication/x-www-form-urlencoded
The target lifecycle status for the experiment.
The target status to transition the experiment to.
Available options:
active, paused, completed, archived Response
Experiment status successfully updated.
Pattern:
^exp_[A-HJ-NP-Za-km-z1-9]+$Available options:
percentage, segment Show child attributes
Show child attributes
Filter by status. Exact match.
Available options:
draft, active, paused, completed, archived Show child attributes
Show child attributes
⌘I