A/B testing and experimentation framework for feature flags, traffic allocation, and results analysis.
| Method | Path | Summary |
|---|---|---|
GET | /experiments | List experiments |
POST | /experiments | Create experiment |
GET | /experiments/{experimentId} | Get experiment details |
GET | /experiments/{experimentId}/results | Get experiment results |
POST | /experiments/{experimentId}/assignment | Get variant assignment |
{% api-endpoint method=“GET” path=“/experiments” /%}
List experiments
Operation ID: listExperiments
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | No | Default: 1 |
perPage | integer | No | Default: 20 |
status | string | No | Values: draft, running, paused, completed, archived |
type | string | No | Values: ab_test, multivariate, feature_flag, rollout |
Paginated list of experiments
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | Yes | - |
pagination | object | Yes | - |
{% tabs %} {% tab label=“cURL” %}
curl -X GET 'https://api.wave.online/api/v1/experiments?status=running&page=1' \
-H 'Authorization: Bearer YOUR_API_KEY'
{% /tab %} {% tab label=“TypeScript” %}
import { WaveClient } from "@wave/sdk";
const client = new WaveClient({ apiKey: "your-api-key" });
const experiments = await client.experiments.list({ status: "running" });
console.log(experiments);
{% /tab %} {% /tabs %}
{% api-endpoint method=“POST” path=“/experiments” /%}
Create a new experiment
Operation ID: createExperiment
Content-Type: application/json
| Required
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Experiment name |
description | string | No | - |
type | string | Yes | Values: ab_test, multivariate, feature_flag, rollout |
variants | object[] | Yes | Variant definitions |
targetAudience | object | No | Targeting criteria |
startDate | string | No | ISO 8601 start date |
endDate | string | No | ISO 8601 end date |
Each variant in the variants array:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Variant name (e.g., control) |
description | string | No | - |
trafficAllocation | number | Yes | Percentage (0-100) |
isControl | boolean | Yes | Whether this is the control |
config | object | No | Variant-specific configuration |
Experiment created
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | - |
name | string | Yes | - |
type | string | Yes | - |
status | string | Yes | Values: draft, running, paused, completed, archived |
variants | object[] | Yes | - |
createdAt | string (date-time) | Yes | - |
{% tabs %} {% tab label=“cURL” %}
curl -X POST 'https://api.wave.online/api/v1/experiments' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "New Player UI",
"type": "ab_test",
"variants": [
{ "name": "control", "trafficAllocation": 50, "isControl": true },
{ "name": "new_ui", "trafficAllocation": 50, "isControl": false, "config": { "playerVersion": "v2" } }
]
}'
{% /tab %} {% /tabs %}
{% api-endpoint method=“GET” path=“/experiments/{experimentId}” /%}
Get experiment details
Operation ID: getExperiment
| Name | Type | Required | Description |
|---|---|---|---|
experimentId | string | Yes | Experiment ID |
Experiment details including variants, status, and configuration.
{% tabs %} {% tab label=“cURL” %}
curl -X GET 'https://api.wave.online/api/v1/experiments/exp_abc123' \
-H 'Authorization: Bearer YOUR_API_KEY'
{% /tab %} {% /tabs %}
{% api-endpoint method=“GET” path=“/experiments/{experimentId}/results” /%}
Get experiment results and statistical analysis
Operation ID: getExperimentResults
| Name | Type | Required | Description |
|---|---|---|---|
experimentId | string | Yes | Experiment ID |
Experiment results
| Field | Type | Required | Description |
|---|---|---|---|
experimentId | string | Yes | - |
status | string | Yes | - |
variants | object[] | Yes | Per-variant results |
winner | string | No | Winning variant name |
confidence | number | No | Statistical confidence (0-1) |
totalParticipants | integer | Yes | - |
{% tabs %} {% tab label=“cURL” %}
curl -X GET 'https://api.wave.online/api/v1/experiments/exp_abc123/results' \
-H 'Authorization: Bearer YOUR_API_KEY'
{% /tab %} {% /tabs %}
{% api-endpoint method=“POST” path=“/experiments/{experimentId}/assignment” /%}
Get a user’s variant assignment for an experiment
Operation ID: getExperimentAssignment
| Name | Type | Required | Description |
|---|---|---|---|
experimentId | string | Yes | Experiment ID |
Content-Type: application/json
| Required
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | No | User ID for assignment |
anonymousId | string | No | Anonymous ID for assignment |
attributes | object | No | User attributes for targeting |
Variant assignment
| Field | Type | Required | Description |
|---|---|---|---|
variant | string | Yes | Assigned variant name |
config | object | No | Variant-specific config |
isNew | boolean | Yes | Whether this is a new assignment |
{% tabs %} {% tab label=“cURL” %}
curl -X POST 'https://api.wave.online/api/v1/experiments/exp_abc123/assignment' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"userId": "usr_xyz789"
}'
{% /tab %} {% /tabs %}