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}/experimentsScope experiment:read

Parameters

project_idstringpathrequired
limitintegerquery
qstringquery
cursorstringquery

Code samples

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

Responses

200
Example
{
  "data": [
    {
      "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"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
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
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/experimentsScope experiment:write

Parameters

project_idstringpathrequired

Request body

application/json
audienceFilter[]
Show child parameters
context_kindstring
user | device | org for context filters (LC-FLG-18).
group_typestring
keystringrequired
opstringrequired
Comparison: eq, neq, contains, ncontains, regex, nregex, gt, gte, lt, lte, is_set, is_not_set, in, not_in, icontains, not_icontains, starts_with, not_starts_with, ends_with, not_ends_with, between, not_between, is_date_before, is_date_after, semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, semver_wildcard, array_contains_any, array_contains_all, array_contains_none, ip_in_cidr, ip_not_in_cidr. event filters take only eq neq gt gte lt lte is_set is_not_set between not_between.
propertiesFilter[]
Predicates on the counted event's own properties (event filters only): only matching events count. Each is {type: "event_property", key, op, value}.
Show child parameters
context_kindstring
user | device | org for context filters (LC-FLG-18).
group_typestring
keystringrequired
opstringrequired
Comparison: eq, neq, contains, ncontains, regex, nregex, gt, gte, lt, lte, is_set, is_not_set, in, not_in, icontains, not_icontains, starts_with, not_starts_with, ends_with, not_ends_with, between, not_between, is_date_before, is_date_after, semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, semver_wildcard, array_contains_any, array_contains_all, array_contains_none, ip_in_cidr, ip_not_in_cidr. event filters take only eq neq gt gte lt lte is_set is_not_set between not_between.
propertiesFilter[]
Predicates on the counted event's own properties (event filters only): only matching events count. Each is {type: "event_property", key, op, value}.
scopestring
session | page for event filters (P-H6): where the event count is taken; empty = session.
typestringrequired
What the key is read from: person, group, cohort, device, geo, app_version, flag, context, event.
valueobject
scopestring
session | page for event filters (P-H6): where the event count is taken; empty = session.
typestringrequired
What the key is read from: person, group, cohort, device, geo, app_version, flag, context, event.
valueobject
exposureobject
factorsarray
Full-factorial multivariate (kind = multivariate, LC-EXT-33): 2-4 factors of 2-5 levels each.
flag_keystring
holdout_idstring
hypothesisstring
kindstring
metricsobject
{"primary": [metric id], "secondary": [metric id], "guardrail": [{"metric": id}]}; help page experiments-api.
namestringrequired
namespace_idstring
namespace_pctnumber
Share of the layer this experiment takes (default: traffic_pct).
requires_approvalboolean
scheduleobject
stats_configobject
traffic_pctnumber
variantsExperimentVariant[]
Ignored when factors is given (the variants are then every factor-level combination).
Show child parameters
allocation_pctnumberrequired
keystringrequired
namestring
Display label, editable at any status (PATCH ./variants/{key}); the key is immutable so history stays joined.
payloadobject
{
  "audience": [
    {
      "context_kind": "string",
      "group_type": "string",
      "key": "string",
      "op": "string",
      "properties": [
        null
      ],
      "scope": "string",
      "type": "string",
      "value": {}
    }
  ],
  "exposure": {},
  "factors": [
    {
      "key": "string",
      "levels": [
        {
          "key": "string",
          "payload": {}
        }
      ]
    }
  ],
  "flag_key": "string",
  "holdout_id": "string",
  "hypothesis": "string",
  "kind": "string",
  "metrics": {},
  "name": "string",
  "namespace_id": "string",
  "namespace_pct": 0,
  "requires_approval": true,
  "schedule": {},
  "stats_config": {},
  "traffic_pct": 0,
  "variants": [
    {
      "allocation_pct": 0,
      "key": "string",
      "name": "string",
      "payload": {}
    }
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments" \
  -H "Content-Type: application/json" \
  -d '{"audience":[{"context_kind":"string","group_type":"string","key":"string","op":"string","properties":[null],"scope":"string","type":"string","value":{}}],"exposure":{},"factors":[{"key":"string","levels":[{"key":"string","payload":{}}]}],"flag_key":"string","holdout_id":"string","hypothesis":"string","kind":"string","metrics":{},"name":"string","namespace_id":"string","namespace_pct":0,"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

201 The experiment. flag_key in the request attaches it to that existing multivariate flag (409 when the flag is another type or belongs to a live experiment); without it the experiment owns a new flag named from the experiment name. The flag key used is returned in the x-lucida-flag-key header.
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/assetsScope experiment:write

Parameters

project_idstringpathrequired

Request body

image/png
[
  0
]

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/assets" \
  -H "Content-Type: image/png" \
  -d '[0]'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
Example
{
  "url": "string"
}
Schema
urlstringrequired
Public URL to put in an image change's src.
400 not a PNG, JPEG, GIF or WebP image
404
413
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/assignScope experiment:read

Block-randomised assignment: inside each stratum the variants split the units to within one unit of their weights. Use it for geo experiments (units = regions, strata = size tiers) or any offline allocation.

Parameters

project_idstringpathrequired

Request body

application/json
seedinteger
unitsAssignUnit[]required
Show child parameters
idstringrequired
stratumstring
Stratum (a region, plan, size tier...); units without one share the "" stratum.
variantsAssignVariant[]required
Show child parameters
keystringrequired
weightnumberrequired
{
  "seed": 0,
  "units": [
    {
      "id": "string",
      "stratum": "string"
    }
  ],
  "variants": [
    {
      "key": "string",
      "weight": 0
    }
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/assign" \
  -H "Content-Type: application/json" \
  -d '{"seed":0,"units":[{"id":"string","stratum":"string"}],"variants":[{"key":"string","weight":0}]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "assignments": [
    {
      "unit": "string",
      "variant": "string"
    }
  ]
}
Schema
assignmentsAssignment[]required
Show child parameters
unitstringrequired
variantstringrequired
400
404
POSThttps://lucidace.com/v1/projects/{project_id}/experiments/designs/didScope experiment:read

Difference-in-differences from the four group-by-period cells (geo experiments: groups are treated and control regions). Valid under parallel trends; the cells are treated as independent samples.

Parameters

project_idstringpathrequired

Request body

application/json
alphanumber
control_postobjectrequired
Count, mean and unbiased variance of one cell.
Show child parameters
meannumberrequired
nnumberrequired
variancenumberrequired
control_preobjectrequired
Count, mean and unbiased variance of one cell.
Show child parameters
meannumberrequired
nnumberrequired
variancenumberrequired
treated_postobjectrequired
Count, mean and unbiased variance of one cell.
Show child parameters
meannumberrequired
nnumberrequired
variancenumberrequired
treated_preobjectrequired
Count, mean and unbiased variance of one cell.
Show child parameters
meannumberrequired
nnumberrequired
variancenumberrequired
{
  "alpha": 0,
  "control_post": {
    "mean": 0,
    "n": 0,
    "variance": 0
  },
  "control_pre": {
    "mean": 0,
    "n": 0,
    "variance": 0
  },
  "treated_post": {
    "mean": 0,
    "n": 0,
    "variance": 0
  },
  "treated_pre": {
    "mean": 0,
    "n": 0,
    "variance": 0
  }
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/did" \
  -H "Content-Type: application/json" \
  -d '{"alpha":0,"control_post":{"mean":0,"n":0,"variance":0},"control_pre":{"mean":0,"n":0,"variance":0},"treated_post":{"mean":0,"n":0,"variance":0},"treated_pre":{"mean":0,"n":0,"variance":0}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "ci_high": 0,
  "ci_low": 0,
  "effect": 0,
  "p_value": 0,
  "se": 0
}
Schema
ci_highnumberrequired
ci_lownumberrequired
effectnumberrequired
p_valuenumberrequired
senumberrequired
400
404

Updated