flags

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-flags"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/b5c3688b-7e55-4666-be20-ed9c5f8c72a6/social-card.svg?v=3e7ae33eec8b" alt="flags" width="600" height="315"></a>
POSThttps://lucidace.com/v1/projects/{project_id}/flags/code-refsScope flag:write

Replace the stored scan of one repository.

Parameters

project_idstringpathrequired

Request body

application/json
flagsFlagRefs[]required
Show child parameters
keystringrequired
refsCodeRef[]required
Show child parameters
filestringrequired
Slash-separated path relative to the repository root.
kindstring
call | string | ... as classified by the scanner.
lineintegerrequired
repostringrequired
owner/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
flagsintegerrequired
repostringrequired
400
403
404
POSThttps://lucidace.com/v1/projects/{project_id}/flags/dry-runScope flag:read

What 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_idstringpathrequired

Request body

application/json
contextobjectrequired
The evaluation context (distinct_id, person_properties, groups, ...; see testdata/flags).
environmentstring
Default 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
GEThttps://lucidace.com/v1/projects/{project_id}/flags/sharedScope flag:read

Parameters

project_idstringpathrequired

Code 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[]required
Show child parameters
enabledbooleanrequired
flag_idstringrequired
keystringrequired
kindstringrequired
namestringrequired
owner_project_idstringrequired
owner_project_namestringrequired
shadowedbooleanrequired
True when this project has its own flag with the same key (that one is served instead).
404
GEThttps://lucidace.com/v1/projects/{project_id}/flags/{id}Scope flag:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code 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_atstringrequired
created_bystring
descriptionstringrequired
enabledbooleanrequired
environment_stateobjectrequired
expires_atstring
filtersobjectrequired
holdout_idstring
idstringrequired
keystringrequired
kindstringrequired
lifecyclestringrequired
draft | active | launched | deprecated (advisory; stale detection surfaces the last two).
namestringrequired
namespace_idstring
owner_user_idstring
payloadsobjectrequired
protected_envsstring[]required
stickinessstringrequired
tagsstring[]required
updated_atstringrequired
variantsobjectrequired
versionintegerrequired
404
DELETEhttps://lucidace.com/v1/projects/{project_id}/flags/{id}Scope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired
forcebooleanquery
Delete 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
PATCHhttps://lucidace.com/v1/projects/{project_id}/flags/{id}Scope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired
forcebooleanquery
Edit serving state although a running experiment owns the flag

Request body

application/json
descriptionstring
= null
enabledboolean
= null
encrypt_payloadboolean
Remote config: true seals the payload at rest, false stores it in clear (LC-FLG-26).
= null
environmentstring
= null
expires_atstring
= null
filtersFlagFilters
= null
Show child parameters
app_contextsstring[]
Serve only to SDKs declaring one of these app contexts (max 50; empty = everywhere).
compatstring
Foreign 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
aggregationAggregation
filtersFilter[]
payload_patchobject
RFC 7386 JSON merge patch applied to the served payload when this condition decides (P-L10).
rollout_pctnumberrequired
segmentstring
Key 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_overridestring
continuityboolean
Experience continuity (LC-FLG-34): an identified person keeps the bucket of the anonymous id they had before identify.
designobject
Experiment 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_exitboolean
Stop at the first condition whose filters match (a rollout miss there is final).
evaluation_runtimestring
client | server, or empty for both: public keys never see server-only flags and secret keys never see client-only ones.
holdoutobject
Holdout {id, salt, percentage}: units hashing under percentage never see the flag.
kill_switchboolean
namespaceobject
Layer 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
flagstringrequired
valueobjectrequired
saltstring
stickyboolean
Sticky 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.
kindstring
= null
lifecyclestring
draft | active | launched | deprecated.
= null
namestring
= null
owner_user_idstring
Absent keeps the owner, null clears it, a user id sets it.
= null
payloadsobject
= null
protected_envsarray
= null
reasonstring
Why the change is made (rollback / incident reason, LC-FLG-42); stored on the history row, not on the flag.
= null
stickinessstring
= null
tagsarray
= null
variantsarray
= null
{
  "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

400
403
404
409 experiment_running: a running experiment owns this flag and the patch changes what it serves (the kill switch stays allowed)
GEThttps://lucidace.com/v1/projects/{project_id}/flags/{id}/blast-radiusScope flag:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code 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[]required
Show child parameters
estimablebooleanrequired
False when the condition filters on something a profile sample cannot answer.
indexintegerrequired
matchinginteger
People matching the condition's filters (before the rollout percentage).
matching_pctnumber
matching as a share of all people.
reachedinteger
People this condition decides: matching and not already matched by an earlier condition.
rollout_pctnumberrequired
servinginteger
People expected to be served by this condition: reached x rollout.
sampledintegerrequired
Profiles actually inspected (total_persons is extrapolated from them when larger).
servingintegerrequired
People expected to be served overall, summed over estimable conditions.
serving_pctnumberrequired
total_personsintegerrequired
404
503

Updated