Table of Contents

Class ExperimentsClient

Namespace
Auth0.ManagementApi.Experimentation
Assembly
Auth0.ManagementApi.dll
public class ExperimentsClient : IExperimentsClient
Inheritance
ExperimentsClient
Implements
Inherited Members
Extension Methods

Methods

AdvanceRampAsync(string, AdvanceRampRequestContent, RequestOptions?, CancellationToken)

Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.

public WithRawResponseTask<AdvanceRampResponseContent> AdvanceRampAsync(string id, AdvanceRampRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
request AdvanceRampRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<AdvanceRampResponseContent>

Examples

await client.Experimentation.Experiments.AdvanceRampAsync(
    "id",
    new AdvanceRampRequestContent { TargetLevel = 1 }
);

CreateAsync(CreateExperimentRequestContent, RequestOptions?, CancellationToken)

Create a new experiment for A/B testing.

public WithRawResponseTask<CreateExperimentResponseContent> CreateAsync(CreateExperimentRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request CreateExperimentRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<CreateExperimentResponseContent>

Examples

await client.Experimentation.Experiments.CreateAsync(
    new CreateExperimentRequestContent
    {
        Name = "name",
        FeatureFlagId = "feature_flag_id",
        AuthenticationFlow = AuthenticationFlowEnum.Authentication,
    }
);

DeleteAsync(string, RequestOptions?, CancellationToken)

Permanently delete an experiment and its allocations by ID. Active experiments cannot be deleted; pause or complete first. Idempotent: returns 204 even if the experiment does not exist.

public WithRawResponseTask DeleteAsync(string id, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask

Examples

await client.Experimentation.Experiments.DeleteAsync("id");

GetAsync(string, RequestOptions?, CancellationToken)

Retrieve a single experiment with its allocations by ID.

public WithRawResponseTask<GetExperimentResponseContent> GetAsync(string id, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<GetExperimentResponseContent>

Examples

await client.Experimentation.Experiments.GetAsync("id");

ListAsync(ListExperimentsRequestParameters, RequestOptions?, CancellationToken)

Retrieve a paginated list of experiments for the tenant, with optional filters.

public Task<Pager<ExperimentListItem>> ListAsync(ListExperimentsRequestParameters request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request ListExperimentsRequestParameters
options RequestOptions
cancellationToken CancellationToken

Returns

Task<Pager<ExperimentListItem>>

Examples

await client.Experimentation.Experiments.ListAsync(
    new ListExperimentsRequestParameters
    {
        From = "from",
        Take = 1,
        Status = ExperimentStatusEnum.Draft,
        AuthenticationFlow = "authentication_flow",
        FeatureFlagId = "feature_flag_id",
    }
);

UpdateAsync(string, UpdateExperimentRequestParameters, RequestOptions?, CancellationToken)

Partially update an experiment by ID. Only provided fields are updated. Providing allocations replaces the entire allocations set.

public WithRawResponseTask<UpdateExperimentResponseContent> UpdateAsync(string id, UpdateExperimentRequestParameters request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
request UpdateExperimentRequestParameters
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<UpdateExperimentResponseContent>

Examples

await client.Experimentation.Experiments.UpdateAsync("id", new UpdateExperimentRequestParameters());

ValidateAsync(string, RequestOptions?, CancellationToken)

Checks whether an experiment is ready to be activated. Returns is_valid boolean and an errors array describing any blockers. Read-only; no state is modified.

public WithRawResponseTask<ValidateExperimentResponseContent> ValidateAsync(string id, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<ValidateExperimentResponseContent>

Examples

await client.Experimentation.Experiments.ValidateAsync("id");