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>
DELETEhttps://lucidace.com/v1/projects/{project_id}/experiments/{id}Scope experiment:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

204
403
404
409 The experiment is running: stop it first
PATCHhttps://lucidace.com/v1/projects/{project_id}/experiments/{id}Scope experiment:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
audiencearray
confirm_running_changeboolean
LC-EXT-46: changing metrics, stats config or exposure of a started experiment changes results already seen; without this the change is refused with 409 running_change.
exposureobject
{event?, filters?, multiple_variants?: exclude|first_seen, filter_test_accounts?}; freeze enrolment with POST .../freeze.
hypothesisstring
metricsobject
namestring
requires_approvalboolean
scheduleobject
stats_configobject
traffic_pctnumber
variantsarray
{
  "audience": [
    {
      "context_kind": "string",
      "group_type": "string",
      "key": "string",
      "op": "string",
      "properties": [
        null
      ],
      "scope": "string",
      "type": "string",
      "value": {}
    }
  ],
  "confirm_running_change": true,
  "exposure": {},
  "hypothesis": "string",
  "metrics": {},
  "name": "string",
  "requires_approval": true,
  "schedule": {},
  "stats_config": {},
  "traffic_pct": 0,
  "variants": [
    {
      "allocation_pct": 0,
      "key": "string",
      "name": "string",
      "payload": {}
    }
  ]
}

Code samples

cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/experiments/{id}" \
  -H "Content-Type: application/json" \
  -d '{"audience":[{"context_kind":"string","group_type":"string","key":"string","op":"string","properties":[null],"scope":"string","type":"string","value":{}}],"confirm_running_change":true,"exposure":{},"hypothesis":"string","metrics":{},"name":"string","requires_approval":true,"schedule":{},"stats_config":{},"traffic_pct":0,"variants":[{"allocation_pct":0,"key":"string","name":"string","payload":{}}]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
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
400
403
404
409
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/archiveScope experiment:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

404
409 running or paused
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/bandit/contextualScope experiment:read

The multi-feature policy of a bandit experiment whose `stats_config.bandit.contextual` names `properties` (2 or 3). Empty lists until the experiment has data.

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

200
Example
{
  "choices": [
    {
      "values": [
        "string"
      ],
      "variant": "string"
    }
  ],
  "importance": [
    {
      "importance": 0,
      "property": "string"
    }
  ],
  "properties": [
    "string"
  ]
}
Schema
choicesMultiChoice[]required
Show child parameters
valuesstring[]required
One value per property, in property order.
variantstringrequired
importanceImportance[]required
Show child parameters
importancenumberrequired
Share in [0, 1]; all attributes sum to 1 (or all 0 without signal).
propertystringrequired
propertiesstring[]required
400
404
503
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/checklistScope experiment:read

Pre-launch checks of an experiment as currently configured.

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

200
Example
{
  "items": [
    {
      "detail": "string",
      "key": "string",
      "label": "string",
      "status": "pass"
    }
  ],
  "ready": true
}
Schema
itemsCheckItem[]required
Show child parameters
detailstringrequired
keystringrequired
labelstringrequired
statusstringrequired
pass | warn | fail
readybooleanrequired
No item fails: the experiment can start (warnings do not block).
404
GEThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/checksScope experiment:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

200
Example
{
  "aa": {
    "passed": true,
    "significant": [
      "string"
    ]
  },
  "biased": true,
  "experiment_id": "string",
  "exposure_ignored": {
    "ignored_before_start": 0,
    "ignored_internal": 0,
    "ignored_invalid_variant": 0
  },
  "pre_exposure": [
    {
      "biased": true,
      "p_value": 0,
      "pre_diff": 0,
      "variant": "string"
    }
  ]
}
Schema
aaAaVerdict
Show child parameters
passedbooleanrequired
No treatment arm differs significantly on any metric (what an A/A test should show).
significantstring[]required
metric id / variant pairs that came out significant (expected in about alpha of tests).
biasedbooleanrequired
Any arm differed before exposure (randomization or assignment problem).
experiment_idstringrequired
exposure_ignoredobjectrequired
Exposure units left out of the results, by reason (ignored_before_start, ignored_internal, ignored_invalid_variant); the same counts as exposure_health of the results.
Show child parameters
ignored_before_startintegerrequired
Exposed before the experiment's start time.
ignored_internalintegerrequired
Internal or test-account traffic (0 unless exposure.filter_test_accounts is on).
ignored_invalid_variantintegerrequired
Exposure with a variant key the experiment does not define (or an empty one).
pre_exposureBiasReport[]required
Pre-exposure balance of the first metric; empty before any unit is exposed.
Show child parameters
biasedbooleanrequired
p_value < alpha: the arms already differed before exposure.
p_valuenumberrequired
pre_diffnumberrequired
Treatment minus control in the pre-exposure metric: should be ~0 under randomization.
variantstringrequired
404
503
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/duplicateScope experiment:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
flag_keystring
Default <flag key>-copy.
= null
namestring
Default <name> (copy).
= null
project_idstring
LC-EXT-44: create the copy in this project (needs write access there). Metrics are matched by name in the target, or copied; layer, holdout and metric groups are not carried.
= null
{
  "flag_key": null,
  "name": null,
  "project_id": null
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/{id}/duplicate" \
  -H "Content-Type: application/json" \
  -d '{"flag_key":null,"name":null,"project_id":null}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 a draft with the same design, metrics and settings on a new flag (layer allocation not copied)

Same as 200 · PATCH /v1/projects/{project_id}/experiments/{id}

400
404
409
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/{id}/freezeScope experiment:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
frozenboolean
false unfreezes.
snapshotboolean
LC-EXT-43: also snapshot the units exposed so far into a static cohort and narrow the flag release to that cohort, so new users stop entering. Unfreezing undoes the narrowing.
{
  "frozen": true,
  "snapshot": true
}

Code samples

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

Responses

200 exposure.frozen_at set (or cleared): later first exposures are left out of the analysis

Same as 200 · PATCH /v1/projects/{project_id}/experiments/{id}

404
409

Updated