experiments
GET
https://lucidace.com /v1/projects/{project_id}/experiments Scope experiment:readParameters
project_idstringpathrequiredlimitintegerqueryqstringquerycursorstringqueryCode 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[]requiredShow child parameters
audienceobjectrequiredconclusionstringcreated_atstringrequiredcreated_bystringended_atstringexposureobjectrequiredflag_idstringrequiredflag_keystringKey of the flag
flag_id names; null only if that flag row is gone.guardrail_stateobjectrequiredholdout_idstringhypothesisstringrequiredidstringrequiredkindstringrequiredmetricsobjectrequired{primary: [metric id], secondary: [...], guardrail: [{metric, direction?}]}.namestringrequirednamespace_idstringproject_idstringrequiredrequires_approvalbooleanrequiredscheduleobjectrequiredshipped_atstringsnapshotobjectstarted_atstringstats_configobjectrequiredstatusstringrequiredtraffic_pctnumberrequiredupdated_atstringrequiredvariantsobjectrequiredwinnerstringnext_cursorstring404
POST
https://lucidace.com /v1/projects/{project_id}/experiments Scope experiment:writeParameters
project_idstringpathrequiredRequest body
application/json
audienceFilter[]Show child parameters
context_kindstringuser | device | org for context filters (LC-FLG-18).group_typestringkeystringrequiredopstringrequiredComparison:
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_kindstringuser | device | org for context filters (LC-FLG-18).group_typestringkeystringrequiredopstringrequiredComparison:
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}.scopestringsession | page for event filters (P-H6): where the event count is taken; empty = session.typestringrequiredWhat the
key is read from: person, group, cohort, device, geo, app_version, flag, context, event.valueobjectscopestringsession | page for event filters (P-H6): where the event count is taken; empty = session.typestringrequiredWhat the
key is read from: person, group, cohort, device, geo, app_version, flag, context, event.valueobjectexposureobjectfactorsarrayFull-factorial multivariate (
kind = multivariate, LC-EXT-33): 2-4 factors of 2-5 levels each.flag_keystringholdout_idstringhypothesisstringkindstringmetricsobject{"primary": [metric id], "secondary": [metric id], "guardrail": [{"metric": id}]}; help page experiments-api.namestringrequirednamespace_idstringnamespace_pctnumberShare of the layer this experiment takes (default:
traffic_pct).requires_approvalbooleanscheduleobjectstats_configobjecttraffic_pctnumbervariantsExperimentVariant[]Ignored when
factors is given (the variants are then every factor-level combination).Show child parameters
allocation_pctnumberrequiredkeystringrequirednamestringDisplay 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
audienceobjectrequiredconclusionstringcreated_atstringrequiredcreated_bystringended_atstringexposureobjectrequiredflag_idstringrequiredflag_keystringKey of the flag
flag_id names; null only if that flag row is gone.guardrail_stateobjectrequiredholdout_idstringhypothesisstringrequiredidstringrequiredkindstringrequiredmetricsobjectrequired{primary: [metric id], secondary: [...], guardrail: [{metric, direction?}]}.namestringrequirednamespace_idstringproject_idstringrequiredrequires_approvalbooleanrequiredscheduleobjectrequiredshipped_atstringsnapshotobjectstarted_atstringstats_configobjectrequiredstatusstringrequiredtraffic_pctnumberrequiredupdated_atstringrequiredvariantsobjectrequiredwinnerstring400
403
404
409
POST
https://lucidace.com /v1/projects/{project_id}/experiments/assets Scope experiment:writeParameters
project_idstringpathrequiredRequest 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
urlstringrequiredPublic URL to put in an
image change's src.400 not a PNG, JPEG, GIF or WebP image
404
413
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/assign Scope experiment:readBlock-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_idstringpathrequiredRequest body
application/json
seedintegerunitsAssignUnit[]requiredShow child parameters
idstringrequiredstratumstringStratum (a region, plan, size tier...); units without one share the
"" stratum.variantsAssignVariant[]requiredShow child parameters
keystringrequiredweightnumberrequired{
"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[]requiredShow child parameters
unitstringrequiredvariantstringrequired400
404
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/did Scope experiment:readDifference-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_idstringpathrequiredRequest body
application/json
alphanumbercontrol_postobjectrequiredCount, mean and unbiased variance of one cell.
Show child parameters
meannumberrequirednnumberrequiredvariancenumberrequiredcontrol_preobjectrequiredCount, mean and unbiased variance of one cell.
Show child parameters
meannumberrequirednnumberrequiredvariancenumberrequiredtreated_postobjectrequiredCount, mean and unbiased variance of one cell.
Show child parameters
meannumberrequirednnumberrequiredvariancenumberrequiredtreated_preobjectrequiredCount, mean and unbiased variance of one cell.
Show child parameters
meannumberrequirednnumberrequiredvariancenumberrequired{
"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_highnumberrequiredci_lownumberrequiredeffectnumberrequiredp_valuenumberrequiredsenumberrequired400
404
Updated