List experiment

Every experiment in the caller's org, with its variants, status and decision, ordered by project then id.

GET /v1/experiment

Addresshttps://api.hanzo.ai/v1/experiment
MethodGET
Operationget_experiment
AuthAuthorization: Bearer $HANZO_API_KEY

Every experiment in the caller's org, with its variants, status and decision, ordered by project then id.

Scoped to the org resolved from the validated principal — a distinct org is a distinct physical store, so no query here can reach another tenant's rows — and further narrowed to the caller's project scope when the credential carries one. A principal with NO project scope sees the org's experiments across all of its projects, which is the answer a reader most often expects to be filtered and is not.

Requires a validated principal; refuses without one rather than answering an empty list.

Request

GET /v1/experiment takes no parameters and no body — the credential is the whole request.

Response

StatusBodyMeaning
200experiment.experimentListok
defaultproblem-detailsrefused

200 body — 20 fields.

FieldInTypeAlwaysDescription
databodyexperiment.Trial[]—Data is the org's experiments, ordered by project then id.
data[].createdAtbodystring—when it started assigning
data[].createdBybodystring—the credential that registered it
data[].decidedAtbodystring—when the promotion took effect
data[].decidedBybodystring—the credential that promoted the winner
data[].exposureEventbodystring—the event that enrols a subject — the analysis denominator
data[].flagKeybodystring—the assignment flag this experiment drives
data[].idbodystring—the experiment's slug, unique within the project
data[].metricEventbodystring—the event that counts as a conversion — the numerator
data[].namebodystring—free text for a reader
data[].projectbodystring—the sub-scope within the org, stamped from the principal
data[].statusbodystring—running while it assigns and measures, decided once a winner is promoted
data[].subjectKindbodystring—the unit assigned and measured: user, org, session or audience
data[].variantsbodyexperiment.Arm[]—the arms, weighted, one of them the control
data[].variants[].controlbodyboolean—true on the baseline arm every other arm is compared to
data[].variants[].keybodystring—the arm's slug, unique within the experiment
data[].variants[].payloadbodyany—opaque JSON the arm carries, which the consumer interprets
data[].variants[].weightbodynumber (double)—its share of the rollout; the arms sum to 100
data[].winnerbodystring—the arm promoted to the whole rollout
totalbodyinteger (int64)—Total is how many rows Data holds.

Failure carries the platform error shape — see Errors.

Examples

hanzo experiment list
import { Configuration, ExperimentApi } from 'hanzoai';

const api = new ExperimentApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getExperiment();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ExperimentApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ExperimentApi(client).get_experiment()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ExperimentAPI.GetExperiment(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, experiment_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = experiment_api::get_experiment(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ExperimentApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ExperimentApi(client).getExperiment();
curl https://api.hanzo.ai/v1/experiment \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches experiment through the experiment tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_experiments"
         }
       }
     }'

Experiment API · All Hanzo APIs · Interactive reference

Was this page useful?