experiments
POST
https://lucidace.com /v1/projects/{project_id}/experiments/surrogates Scope experiment:writeParameters
project_idstringpathrequiredRequest body
application/json
cohort_eventstringrequiredEvent that starts a unit's clock in the training cohort (signup, first purchase, ...).
horizon_daysintegerrequirednamestringrequiredoutcome_metric_idstringrequiredridgenumbershort_daysintegerrequiredsurrogate_metric_idsstring[]required1 to
LC_CUPED_MAX_COVARIATES (default 3) metrics.train_daysinteger{
"cohort_event": "string",
"horizon_days": 0,
"name": "string",
"outcome_metric_id": "string",
"ridge": 0,
"short_days": 0,
"surrogate_metric_ids": [
"string"
],
"train_days": 0
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates" \
-H "Content-Type: application/json" \
-d '{"cohort_event":"string","horizon_days":0,"name":"string","outcome_metric_id":"string","ridge":0,"short_days":0,"surrogate_metric_ids":["string"],"train_days":0}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201
Example
{
"coef": [
0
],
"cohort_event": "string",
"created_at": "2024-01-01T00:00:00Z",
"created_by": "string",
"horizon_days": 0,
"id": "string",
"n": 0,
"name": "string",
"outcome_metric_id": "string",
"r2": 0,
"resid_var": 0,
"ridge": 0,
"short_days": 0,
"surrogate_metric_ids": [
"string"
],
"train_days": 0,
"trained_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}Schema
coefarray[intercept, b_1, ..., b_k]; null until trained.cohort_eventstringrequiredcreated_atstringrequiredcreated_bystringhorizon_daysintegerrequiredidstringrequirednintegernamestringrequiredoutcome_metric_idstringrequiredr2numberresid_varnumberridgenumberrequiredshort_daysintegerrequiredsurrogate_metric_idsstring[]requiredtrain_daysintegerrequiredtrained_atstringupdated_atstringrequired400
404
409
GET
https://lucidace.com /v1/projects/{project_id}/experiments/surrogates/{id} Scope experiment:readParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}"TypeScript
Python
Go
PHP
Ruby
Java
DELETE
https://lucidace.com /v1/projects/{project_id}/experiments/surrogates/{id} Scope experiment:writeParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
404
POST
https://lucidace.com /v1/projects/{project_id}/experiments/surrogates/{id}/train Scope experiment:writeFit the model on the cohort whose `cohort_event` fell in the `train_days` before `now - horizon_days`.
Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/surrogates/{id}/train"TypeScript
Python
Go
PHP
Ruby
Java
GET
https://lucidace.com /v1/projects/{project_id}/experiments/timeline Scope experiment:readEverything that runs in `[from, to)` (default: the last 30 days to 60 days ahead).
Parameters
project_idstringpathrequiredfromstringquerytostringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/timeline"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"from": "2024-01-01T00:00:00Z",
"items": [
{
"auto_stop": true,
"end": "2024-01-01T00:00:00Z",
"id": "string",
"kind": "string",
"name": "string",
"planned_end": "2024-01-01T00:00:00Z",
"start": "2024-01-01T00:00:00Z",
"status": "string"
}
],
"to": "2024-01-01T00:00:00Z"
}Schema
fromstringrequireditemsItem[]requiredShow child parameters
auto_stopbooleanrequiredThe experiment stops itself at
planned_end (schedule.auto_stop).endstringActual end; null while running (open-ended).
idstringrequiredkindstringrequiredexperiment | guide | flag_schedule.namestringrequiredplanned_endstringPlanned end (
schedule.end_at), when one is set.startstringrequiredstatusstringrequiredtostringrequired400
404
POST
https://lucidace.com /v1/projects/{project_id}/experiments/traffic-preview Scope experiment:readPre-launch traffic preview: how many persons a design would enrol per day and per variant, from the last `days` of traffic matching the audience.
Parameters
project_idstringpathrequiredRequest body
application/json
audienceFilter[]Flag-style audience filters;
person filters are applied, others are counted in unsupported_filters.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.valueobjectdaysintegerLook-back days, 1 to 30 (default 7).
eventstringEvent that marks eligible traffic (default
$pageview).sample_size_per_variantintegerSample size per variant to reach; gives
days_to_sample.traffic_pctnumberDefault 100.
variantsPreviewVariant[]Show child parameters
allocation_pctnumberrequiredkeystringrequired{
"audience": [
{
"context_kind": "string",
"group_type": "string",
"key": "string",
"op": "string",
"properties": [
null
],
"scope": "string",
"type": "string",
"value": {}
}
],
"days": 0,
"event": "string",
"sample_size_per_variant": 0,
"traffic_pct": 0,
"variants": [
{
"allocation_pct": 0,
"key": "string"
}
]
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/traffic-preview" \
-H "Content-Type: application/json" \
-d '{"audience":[{"context_kind":"string","group_type":"string","key":"string","op":"string","properties":[null],"scope":"string","type":"string","value":{}}],"days":0,"event":"string","sample_size_per_variant":0,"traffic_pct":0,"variants":[{"allocation_pct":0,"key":"string"}]}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"avg_daily_persons": 0,
"daily": [
{
"bucket": "string",
"persons": 0
}
],
"days_to_sample": 0,
"eligible_daily_persons": 0,
"unsupported_filters": 0,
"variants": [
{
"daily_persons": 0,
"key": "string"
}
]
}Schema
avg_daily_personsnumberrequireddailyPreviewDay[]requiredShow child parameters
bucketstringrequiredpersonsnumberrequireddays_to_samplenumbereligible_daily_personsnumberrequiredunsupported_filtersintegerrequiredvariantsPreviewArm[]requiredShow child parameters
daily_personsnumberrequiredkeystringrequired400
404
503
GET
https://lucidace.com /v1/projects/{project_id}/experiments/{id} Scope experiment:readParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/{id}"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
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_atstringrequiredvariantsobjectrequiredwinnerstring404
Updated