experiments

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-experiments"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/6af814d4-70c1-4363-8381-689a51668c4d/social-card.svg?v=3e7ae33eec8b" alt="experiments" width="600" height="315"></a>
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/preview_linksScope experiment:read

Parameters

project_idstringpathrequired
idstringpathrequired
urlstringqueryrequired
Page to preview (http or https)

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/{id}/preview_links?url=<url>"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 One QA link per variant: opening it forces that variant in the visitor's browser and records no exposure
Example
{
  "data": [
    {
      "url": "string",
      "variant": "string"
    }
  ]
}
Schema
dataPreviewLink[]required
Show child parameters
urlstringrequired
variantstringrequired
400
404
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/rerandomizeScope experiment:write

Rotate the salt of the experiment's flag and, while it runs, restart its analysis window.

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
confirmstringrequired
The flag key, typed again to confirm.
reasonstringrequired
Why (1-500 chars); kept on the flag history row and the audit entry.
reset_stickyboolean
Also forget stored sticky assignments (default true); false keeps sticky units where they are.
{
  "confirm": "string",
  "reason": "string",
  "reset_sticky": true
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/{id}/rerandomize" \
  -H "Content-Type: application/json" \
  -d '{"confirm":"string","reason":"string","reset_sticky":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "environments": [
    "string"
  ],
  "flag_id": "string",
  "results_reset_at": "2024-01-01T00:00:00Z",
  "sticky_removed": 0,
  "warning": "string"
}
Schema
environmentsstring[]required
Environments whose own targeting got the new salt too.
flag_idstringrequired
results_reset_atstring
Set when a running experiment's analysis window restarted now.
sticky_removedintegerrequired
warningstringrequired
400
403
404
409
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/resetScope experiment:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/{id}/reset"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 back to draft, results cleared, flag off
Example
{
  "audience": {},
  "conclusion": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "ended_at": "2024-01-01T00:00:00Z",
  "exposure": {},
  "flag_id": "string",
  "flag_key": "string",
  "guardrail_state": {},
  "holdout_id": "string",
  "hypothesis": "string",
  "id": "string",
  "kind": "string",
  "metrics": {},
  "name": "string",
  "namespace_id": "string",
  "project_id": "string",
  "requires_approval": true,
  "schedule": {},
  "shipped_at": "2024-01-01T00:00:00Z",
  "snapshot": {},
  "started_at": "2024-01-01T00:00:00Z",
  "stats_config": {},
  "status": "string",
  "traffic_pct": 0,
  "updated_at": "2024-01-01T00:00:00Z",
  "variants": {},
  "winner": "string"
}
Schema
audienceobjectrequired
conclusionstring
created_atstringrequired
created_bystring
ended_atstring
exposureobjectrequired
flag_idstringrequired
flag_keystring
Key of the flag flag_id names; null only if that flag row is gone.
guardrail_stateobjectrequired
holdout_idstring
hypothesisstringrequired
idstringrequired
kindstringrequired
metricsobjectrequired
{primary: [metric id], secondary: [...], guardrail: [{metric, direction?}]}.
namestringrequired
namespace_idstring
project_idstringrequired
requires_approvalbooleanrequired
scheduleobjectrequired
shipped_atstring
snapshotobject
started_atstring
stats_configobjectrequired
statusstringrequired
traffic_pctnumberrequired
updated_atstringrequired
variantsobjectrequired
winnerstring
404
409
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/resultsScope experiment:read

Parameters

project_idstringpathrequired
idstringpathrequired
breakdownstringquery
as_ofstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/{id}/results"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "experiment_id": "string",
  "exposure_health": {
    "exposed_units": 0,
    "flagged": true,
    "ignored_before_start": 0,
    "ignored_internal": 0,
    "ignored_invalid_variant": 0,
    "multi_exposed_units": 0,
    "multi_exposure_rate": 0
  },
  "guardrail_breached": true,
  "links": [
    {
      "cohort": "string",
      "replays": {},
      "variant": "string"
    }
  ],
  "meta": {},
  "metrics": [
    {
      "cuped_theta": 0,
      "cuped_thetas": [
        0
      ],
      "guardrail": "ok",
      "id": "string",
      "name": "string",
      "role": "primary",
      "variance_reduction": 0,
      "variants": [
        {
          "chance_to_win": 0,
          "ci_high": 0,
          "ci_low": 0,
          "conversions": 0,
          "diff": 0,
          "expected_loss": 0,
          "exposed_units": 0,
          "harm_p_value": 0,
          "is_control": true,
          "lift_ci_high": 0,
          "lift_ci_low": 0,
          "mean": 0,
          "note": "string",
          "p_adjusted": 0,
          "p_value": 0,
          "relative_lift": 0,
          "significant": true,
          "units": 0,
          "variant": "string"
        }
      ]
    }
  ],
  "revenue": [
    {
      "buyers": 0,
      "exposed_units": 0,
      "revenue": 0,
      "revenue_per_exposed_unit": 0,
      "variant": "string"
    }
  ],
  "segments": {},
  "srm": {
    "chi2": 0,
    "flagged": true,
    "observed": [
      [
        null
      ]
    ],
    "p_value": 0
  },
  "status": "string",
  "switched_units": 0,
  "variant_names": {}
}
Schema
experiment_idstringrequired
exposure_healthExposureHealth
Show child parameters
exposed_unitsintegerrequired
flaggedbooleanrequired
ignored_before_startintegerrequired
Units exposed before the experiment started (left out of the analysis). Filled by the API from the event store; analyze itself leaves the three ignored_* counts at 0.
ignored_internalintegerrequired
Units of internal / test traffic left out (only when the experiment filters it).
ignored_invalid_variantintegerrequired
Units exposed with a variant key the experiment does not define.
multi_exposed_unitsintegerrequired
multi_exposure_ratenumberrequired
multi_exposed / (exposed + multi_exposed).
guardrail_breachedbooleanrequired
linksVariantLinks[]required
Per variant: replay search, exposed-units cohort.
Show child parameters
cohortstringrequired
POST here to snapshot the variant's exposed units as a static cohort.
replaysobjectrequired
POST this body to replays_search to list the variant's replays.
variantstringrequired
metaobjectrequired
{control, start, end, stats_config, post_stratified}; post_stratified is a list of {id, name, variants: [{variant, diff, se, ci_low, ci_high, p_value, strata_used}]} when stats_config.stratify names a property, else null.
metricsarray
Metrics of the whole population (segment "").
revenueVariantRevenue[]required
Per variant revenue of the exposed units (project revenue config).
Show child parameters
buyersintegerrequired
exposed_unitsintegerrequired
revenuenumberrequired
Sum of the purchase revenue property in the base currency (other currencies converted).
revenue_per_exposed_unitnumberrequired
variantstringrequired
segmentsobjectrequired
Per breakdown segment; "" without a breakdown.
srmSrmReport
Show child parameters
chi2numberrequired
flaggedbooleanrequired
observedobject[][]required
p_valuenumberrequired
statusstringrequired
switched_unitsinteger
variant_namesobjectrequired
Display name per variant key (variants never renamed are absent); keys never change.
404
503
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/results/dailyScope experiment:read

Per-day effect (metric events of that day only, among all units exposed so far) with a novelty verdict over the trend.

Parameters

project_idstringpathrequired
idstringpathrequired
metricstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/{id}/results/daily"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "metric": "string",
  "novelty": {
    "days": 0,
    "detected": true,
    "early_effect": 0,
    "late_effect": 0,
    "slope_per_day": 0,
    "z": 0
  },
  "slices": [
    {
      "as_of": "2024-01-01T00:00:00Z",
      "day": 0,
      "metric": {
        "cuped_theta": 0,
        "cuped_thetas": [
          0
        ],
        "guardrail": "ok",
        "id": "string",
        "name": "string",
        "role": "primary",
        "variance_reduction": 0,
        "variants": [
          {
            "chance_to_win": 0,
            "ci_high": 0,
            "ci_low": 0,
            "conversions": 0,
            "diff": 0,
            "expected_loss": 0,
            "exposed_units": 0,
            "harm_p_value": 0,
            "is_control": true,
            "lift_ci_high": 0,
            "lift_ci_low": 0,
            "mean": 0,
            "note": "string",
            "p_adjusted": 0,
            "p_value": 0,
            "relative_lift": 0,
            "significant": true,
            "units": 0,
            "variant": "string"
          }
        ]
      }
    }
  ]
}
Schema
metricstringrequired
noveltyNoveltyReport
Show child parameters
daysintegerrequired
detectedbooleanrequired
The effect is fading toward zero (or flipping sign) faster than noise explains: the early lift was probably novelty, not a lasting effect.
early_effectnumberrequired
Precision-weighted mean effect of the first / last third of the slices.
late_effectnumberrequired
slope_per_daynumberrequired
Weighted least-squares slope of the daily effect, per day.
znumberrequired
slicesDailySlice[]required
Show child parameters
as_ofstringrequired
End of the slice (exclusive); the slice covers the 24 hours before it.
dayintegerrequired
metricMetricResult
Show child parameters
cuped_thetanumber
cuped_thetasnumber[]required
One slope per covariate when CUPED used several (the first is the metric's own pre-period).
guardrailGuardrailStatus
idstringrequired
namestringrequired
rolestringrequired
primary | secondary | guardrail
variance_reductionnumber
variantsVariantResult[]required
400
404
503
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/results/distributionScope experiment:read

Per-variant histogram of the per-unit metric value (primary metric unless `metric` is given), over exposed units that saw one variant.

Parameters

project_idstringpathrequired
idstringpathrequired
metricstringquery
binsintegerquery
2 to 100, default 20

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/{id}/results/distribution"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "bins": 0,
  "hi": 0,
  "lo": 0,
  "metric": "string",
  "variants": [
    {
      "counts": [
        0
      ],
      "units": 0,
      "variant": "string"
    }
  ]
}
Schema
binsintegerrequired
hinumberrequired
lonumberrequired
Pooled range of the per-unit value; bin i covers lo + i * (hi - lo) / bins.
metricstringrequired
variantsVariantHistogram[]required
Show child parameters
countsinteger[]required
Units per bin, bins entries.
unitsintegerrequired
variantstringrequired
400
404
503

Updated