Documentation Index
Fetch the complete documentation index at: https://auth0-feat-experiment-center.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
To get started with Experiment Center, you need:- An Auth0 development tenant
-
A Machine-to-Machine application with the following Management API scopes:
1. Create and activate the feature flag
A feature flag defines what you are testing and the possible variations. To create a feature flag, make aPOST call to the /api/v2/experimentation/feature-flags endpoint.
- The response includes a
feature_flag_idvalue, you need the value in the subsequent steps. - The feature flag starts in
draftstatus.
Add two variations
The feature flag needs at least two variations before it can activate: a control and a treatment.Create the control variation
The control variation has empty overrides. It represents the unchanged baseline. To add a control variation, make aPOST call to the /api/v2/experimentation/feature-flags/{feature_flag_id}/variations endpoint.
The response includes a
variation_id value for the control. You will need it when setting up allocations.Create the treatment variation
The treatment variation overrides the parameters you want to change. To add the treatment variation, make aPOST call to the /api/v2/experimentation/feature-flags/{feature_flag_id}/variations endpoint and configure the overrides object.
Example
Activate the feature flag
Now that you have two variations, activate the feature flag. An experiment cannot activate unless its referenced feature flag is inactive status.
To transition the feature flag status to active, make a POST call to the /api/v2/experimentation/feature-flags/{feature_flag_id}/status endpoint.
2. Create a segment (optional)
If you want to target specific traffic, create a segment. Skip this step if you want a simple percentage split across all traffic. To create a segment, make aPOST call to the /api/v2/experimentation/segments endpoint.
This example creates a segment that matches mobile users in the United States:
Example
The response includes a
segment_id value. Segments apply only when you use the segment allocation strategy in the experiment.3. Create and activate an experiment
Create an experiment that references your feature flag and defines how to split traffic. To create an experiment, make aPOST call to the /api/v2/experimentation/experiments endpoint.
This example uses a 90/10 percentage split using the allocations object: 90% of users get the control, 10% get the treatment. This is a typical cautious rollout starting point.
Example
draft status with is_valid: false. This is expected; the full readiness check runs in the next step.
Validate the experiment
Before activating, confirm the experiment is ready. The validate endpoint returns the same checks that run on activation. To confirm the experiment, make aPOST call to the /api/v2/experimentation/experiments/{experiment_id}/validate endpoint.
The response includes the is_valid value to confirm if you are ready to activate.
Activate the experiment
When the experiment is valid and you have tested both variations, activate it. To transition the experiment status toactive, make a POST to the /api/v2/experimentation/experiments/{experiment_id}/status endpoint.
The experiment’s started_at value is set on first activation and does not change if you pause and reactivate.
One active experiment per tenant. If another experiment is already active, activation returns
400 experiment_active_limit_exceeded. Pause or complete the other experiment first.4. Trigger an auth event and observe results
Trigger a test login through your test tenant. For example, open a browser and navigate to your/authorize URL without any override parameters.
Complete the login flow. The Experiment Center resolves the active experiment, assigns a variation using deterministic hashing, injects the experiment context, and enriches the resulting auth event.
Verify enriched logs
You can review the Auth0 logs for experiment events:- Navigate to Auth0 Dashboard > Monitoring > Logs.
- Use Log streaming: if you already stream tenant logs to an analytics tool (Datadog, Splunk, Segment, etc.), enriched experiment metadata flows through the same stream automatically.
The event includes experiment metadata in the
details.experiment object. The variation_id field tells you which variation the user was assigned to.You have successfully run your first experiment when:
- Your auth events in tenant logs include
details.experimentwithexperiment_idandvariation_id - Both variations produce the correct behavior when tested with query parameter overrides
- The same device or user consistently gets the same
variation_idacross multiple auth events (deterministic assignment)
Learn more
- Read the ACUL integration guide to learn how to branch your ACUL component code on experiment context.
- Read the Actions integration guide to use
event.experimentin post-login and registration triggers.