# List experiment

URL: https://docs.hanzo.ai/docs/openapi/experiment/get-experiment

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

`GET /v1/experiment`

> [Experiment →](https://docs.hanzo.ai/docs/openapi/experiment) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/experiment`   |
| **Method**    | `GET`                                  |
| **Operation** | `get_experiment`                       |
| **Auth**      | `Authorization: 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

| Status    | Body                      | Meaning |
| --------- | ------------------------- | ------- |
| `200`     | experiment.experimentList | ok      |
| `default` | problem-details           | refused |

`200` body — 20 fields.

| Field                       | In   | Type                | Always | Description                                                              |
| --------------------------- | ---- | ------------------- | ------ | ------------------------------------------------------------------------ |
| `data`                      | body | experiment.Trial\[] | —      | Data is the org's experiments, ordered by project then id.               |
| `data[].createdAt`          | body | string              | —      | when it started assigning                                                |
| `data[].createdBy`          | body | string              | —      | the credential that registered it                                        |
| `data[].decidedAt`          | body | string              | —      | when the promotion took effect                                           |
| `data[].decidedBy`          | body | string              | —      | the credential that promoted the winner                                  |
| `data[].exposureEvent`      | body | string              | —      | the event that enrols a subject — the analysis denominator               |
| `data[].flagKey`            | body | string              | —      | the assignment flag this experiment drives                               |
| `data[].id`                 | body | string              | —      | the experiment's slug, unique within the project                         |
| `data[].metricEvent`        | body | string              | —      | the event that counts as a conversion — the numerator                    |
| `data[].name`               | body | string              | —      | free text for a reader                                                   |
| `data[].project`            | body | string              | —      | the sub-scope within the org, stamped from the principal                 |
| `data[].status`             | body | string              | —      | running while it assigns and measures, decided once a winner is promoted |
| `data[].subjectKind`        | body | string              | —      | the unit assigned and measured: user, org, session or audience           |
| `data[].variants`           | body | experiment.Arm\[]   | —      | the arms, weighted, one of them the control                              |
| `data[].variants[].control` | body | boolean             | —      | true on the baseline arm every other arm is compared to                  |
| `data[].variants[].key`     | body | string              | —      | the arm's slug, unique within the experiment                             |
| `data[].variants[].payload` | body | any                 | —      | opaque JSON the arm carries, which the consumer interprets               |
| `data[].variants[].weight`  | body | number (double)     | —      | its share of the rollout; the arms sum to 100                            |
| `data[].winner`             | body | string              | —      | the arm promoted to the whole rollout                                    |
| `total`                     | body | integer (int64)     | —      | Total is how many rows Data holds.                                       |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo experiment list
```

**SDK**

**.ts**

```ts
import { Configuration, ExperimentApi } from 'hanzoai';

const api = new ExperimentApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getExperiment();
```

**.py**

```python
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()
```

**.go**

```go
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
}
```

**.rs**

```rust
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?;
```

**.java**

```java
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();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/experiment \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/experiment) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
