flags
POST
https://lucidace.com /v1/projects/{project_id}/flags/code-refs Scope flag:writeReplace the stored scan of one repository.
Parameters
project_idstringpathrequiredRequest body
application/json
flagsFlagRefs[]requiredShow child parameters
keystringrequiredrefsCodeRef[]requiredShow child parameters
filestringrequiredSlash-separated path relative to the repository root.
kindstringcall | string | ... as classified by the scanner.lineintegerrequiredrepostringrequiredowner/name (or any stable repository label); one upload replaces that repo's earlier scan.scanned_atstring{
"flags": [
{
"key": "string",
"refs": [
{
"file": "string",
"kind": "string",
"line": 0
}
]
}
],
"repo": "string",
"scanned_at": "2024-01-01T00:00:00Z"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/flags/code-refs" \
-H "Content-Type: application/json" \
-d '{"flags":[{"key":"string","refs":[{"file":"string","kind":"string","line":0}]}],"repo":"string","scanned_at":"2024-01-01T00:00:00Z"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"flags": 0,
"repo": "string"
}Schema
flagsintegerrequiredrepostringrequired400
403
404
POST
https://lucidace.com /v1/projects/{project_id}/flags/dry-run Scope flag:readWhat the gateway would evaluate for one person: the served definitions for the environment (segments expanded) and the context with big-segment memberships resolved into `cohorts`. The caller evaluates with the shared evaluator (`@lucida-analytics/sdk-core`); cohort filters stay `requires_server`. Nothing is written: no exposure, no sticky assignment.
Parameters
project_idstringpathrequiredRequest body
application/json
contextobjectrequiredThe evaluation context (
distinct_id, person_properties, groups, ...; see testdata/flags).environmentstringDefault
production.{
"context": {},
"environment": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/flags/dry-run" \
-H "Content-Type: application/json" \
-d '{"context":{},"environment":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
{environment, flags: [flageval.Flag], context}: the served definitions and the resolved context, not an evaluation; evaluate them with the shared evaluator (SDK core or the Go flageval package)400
404
GET
https://lucidace.com /v1/projects/{project_id}/flags/shared Scope flag:readParameters
project_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/flags/shared"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Flags other projects of the organization share into this one (read-only here)
Example
{
"data": [
{
"enabled": true,
"flag_id": "string",
"key": "string",
"kind": "string",
"name": "string",
"owner_project_id": "string",
"owner_project_name": "string",
"shadowed": true
}
]
}Schema
dataSharedFlag[]requiredShow child parameters
enabledbooleanrequiredflag_idstringrequiredkeystringrequiredkindstringrequirednamestringrequiredowner_project_idstringrequiredowner_project_namestringrequiredshadowedbooleanrequiredTrue when this project has its own flag with the same key (that one is served instead).
404
GET
https://lucidace.com /v1/projects/{project_id}/flags/{id} Scope flag:readParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/flags/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"created_at": "2024-01-01T00:00:00Z",
"created_by": "string",
"description": "string",
"enabled": true,
"environment_state": {},
"expires_at": "2024-01-01T00:00:00Z",
"filters": {},
"holdout_id": "string",
"id": "string",
"key": "string",
"kind": "string",
"lifecycle": "string",
"name": "string",
"namespace_id": "string",
"owner_user_id": "string",
"payloads": {},
"protected_envs": [
"string"
],
"stickiness": "string",
"tags": [
"string"
],
"updated_at": "2024-01-01T00:00:00Z",
"variants": {},
"version": 0
}Schema
created_atstringrequiredcreated_bystringdescriptionstringrequiredenabledbooleanrequiredenvironment_stateobjectrequiredexpires_atstringfiltersobjectrequiredholdout_idstringidstringrequiredkeystringrequiredkindstringrequiredlifecyclestringrequireddraft | active | launched | deprecated (advisory; stale detection surfaces the last two).namestringrequirednamespace_idstringowner_user_idstringpayloadsobjectrequiredprotected_envsstring[]requiredstickinessstringrequiredtagsstring[]requiredupdated_atstringrequiredvariantsobjectrequiredversionintegerrequired404
DELETE
https://lucidace.com /v1/projects/{project_id}/flags/{id} Scope flag:writeParameters
project_idstringpathrequiredidstringpathrequiredforcebooleanqueryDelete although other flags or running experiments depend on it
Code samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/flags/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
403
404
409 Dependents block the delete
PATCH
https://lucidace.com /v1/projects/{project_id}/flags/{id} Scope flag:writeParameters
project_idstringpathrequiredidstringpathrequiredforcebooleanqueryEdit serving state although a running experiment owns the flag
Request body
application/json
descriptionstringenabledbooleanencrypt_payloadbooleanRemote config:
true seals the payload at rest, false stores it in clear (LC-FLG-26).environmentstringexpires_atstringfiltersFlagFiltersShow child parameters
app_contextsstring[]Serve only to SDKs declaring one of these app contexts (max 50; empty = everywhere).
compatstringForeign evaluation dialect of an imported flag (
posthog): the gateway buckets and matches it the way that vendor did, so migrated users keep their variants. Empty = Lucida's own.conditionsCondition[]Show child parameters
aggregationAggregationfiltersFilter[]payload_patchobjectRFC 7386 JSON merge patch applied to the served payload when this condition decides (P-L10).
rollout_pctnumberrequiredsegmentstringKey of a reusable flag segment (LC-FLG-15): the condition matches units in any of the segment's rules AND this condition's own
filters. The gateway expands it before serving.variant_overridestringcontinuitybooleanExperience continuity (LC-FLG-34): an identified person keeps the bucket of the anonymous id they had before identify.
designobjectExperiment design the gateway assigns by (LC-EXT-22), multivariate flags only:
{kind: "switchback", start, slice_seconds, run_len, geo_key?, control?, treated?} serves the arm of the current time block (per region when geo_key is set), {kind: "geo", geo_key, regions: {region: variant}} serves each region its variant. Units outside the design fall through to the next condition. Checked by [validate_design].early_exitbooleanStop at the first condition whose filters match (a rollout miss there is final).
evaluation_runtimestringclient | server, or empty for both: public keys never see server-only flags and secret keys never see client-only ones.holdoutobjectHoldout
{id, salt, percentage}: units hashing under percentage never see the flag.kill_switchbooleannamespaceobjectLayer range
{id, salt, start, end, total}: only units hashing into [start, end) of total buckets are eligible (evaluator support: see the lane report).prerequisitesPrerequisite[]Show child parameters
flagstringrequiredvalueobjectrequiredsaltstringstickybooleanSticky bucketing (LC-EXT-29): units keep their stored assignment when allocation changes. Only on-values are stored (boolean
true, the served variant); a unit that was out of the rollout is not pinned and is re-hashed, so raising a rollout only adds units.kindstringlifecyclestringdraft | active | launched | deprecated.namestringowner_user_idstringAbsent keeps the owner,
null clears it, a user id sets it.payloadsobjectprotected_envsarrayreasonstringWhy the change is made (rollback / incident reason, LC-FLG-42); stored on the history row, not on the flag.
stickinessstringtagsarrayvariantsarray{
"description": null,
"enabled": null,
"encrypt_payload": null,
"environment": null,
"expires_at": null,
"filters": null,
"kind": null,
"lifecycle": null,
"name": null,
"owner_user_id": null,
"payloads": null,
"protected_envs": null,
"reason": null,
"stickiness": null,
"tags": null,
"variants": null
}Code samples
cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/flags/{id}" \
-H "Content-Type: application/json" \
-d '{"description":null,"enabled":null,"encrypt_payload":null,"environment":null,"expires_at":null,"filters":null,"kind":null,"lifecycle":null,"name":null,"owner_user_id":null,"payloads":null,"protected_envs":null,"reason":null,"stickiness":null,"tags":null,"variants":null}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
400
403
404
409
experiment_running: a running experiment owns this flag and the patch changes what it serves (the kill switch stays allowed)GET
https://lucidace.com /v1/projects/{project_id}/flags/{id}/blast-radius Scope flag:readParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/flags/{id}/blast-radius"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"conditions": [
{
"estimable": true,
"index": 0,
"matching": 0,
"matching_pct": 0,
"reached": 0,
"rollout_pct": 0,
"serving": 0
}
],
"sampled": 0,
"serving": 0,
"serving_pct": 0,
"total_persons": 0
}Schema
conditionsConditionReach[]requiredShow child parameters
estimablebooleanrequiredFalse when the condition filters on something a profile sample cannot answer.
indexintegerrequiredmatchingintegerPeople matching the condition's filters (before the rollout percentage).
matching_pctnumbermatching as a share of all people.reachedintegerPeople this condition decides: matching and not already matched by an earlier condition.
rollout_pctnumberrequiredservingintegerPeople expected to be served by this condition:
reached x rollout.sampledintegerrequiredProfiles actually inspected (
total_persons is extrapolated from them when larger).servingintegerrequiredPeople expected to be served overall, summed over estimable conditions.
serving_pctnumberrequiredtotal_personsintegerrequired404
503
Updated