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>
DELETEhttps://lucidace.com/v1/projects/{project_id}/flag-templates/{id}Scope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/flag-templates/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/flagsScope flag:read

Parameters

project_idstringpathrequired
limitintegerquery
qstringquery
cursorstringquery

Code samples

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

Responses

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

Parameters

project_idstringpathrequired

Request body

application/json

A create / replace request for a flag.

descriptionstring
enabledboolean
encrypt_payloadboolean
Remote config: seal the payload at rest (LC-FLG-26); only secret keys see the plaintext.
filtersobject
Contents of the feature_flags.filters column (and of a per-environment override).
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.
keystringrequired
kindstring
boolean | multivariate | remote_config | migration | ai_config; only multivariate, migration and ai_config take variants.
namestring
payloadsobject
{default: ..} for remote config, or {variant key: payload}.
stickinessstring
Bucketing unit: distinct_id | person_id | device_id | group:<type> | context:<user|device|org>. Not the same as filters.sticky, which pins stored assignments.
tagsstring[]
variantsVariant[]
Show child parameters
keystringrequired
payloadobject
rollout_pctnumberrequired
{
  "description": "string",
  "enabled": true,
  "encrypt_payload": true,
  "filters": {
    "app_contexts": [
      "string"
    ],
    "compat": "string",
    "conditions": [
      {
        "aggregation": {
          "context_kind": "string",
          "group_type": "string",
          "kind": "string"
        },
        "filters": [
          {
            "context_kind": "string",
            "group_type": "string",
            "key": "string",
            "op": "string",
            "properties": [
              null
            ],
            "scope": "string",
            "type": "string",
            "value": {}
          }
        ],
        "payload_patch": {},
        "rollout_pct": 0,
        "segment": "string",
        "variant_override": "string"
      }
    ],
    "continuity": true,
    "design": {},
    "early_exit": true,
    "evaluation_runtime": "string",
    "holdout": {},
    "kill_switch": true,
    "namespace": {},
    "prerequisites": [
      {
        "flag": "string",
        "value": {}
      }
    ],
    "salt": "string",
    "sticky": true
  },
  "key": "string",
  "kind": "string",
  "name": "string",
  "payloads": {},
  "stickiness": "string",
  "tags": [
    "string"
  ],
  "variants": [
    {
      "key": "string",
      "payload": {},
      "rollout_pct": 0
    }
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/flags" \
  -H "Content-Type: application/json" \
  -d '{"description":"string","enabled":true,"encrypt_payload":true,"filters":{"app_contexts":["string"],"compat":"string","conditions":[{"aggregation":{"context_kind":"string","group_type":"string","kind":"string"},"filters":[{"context_kind":"string","group_type":"string","key":"string","op":"string","properties":[null],"scope":"string","type":"string","value":{}}],"payload_patch":{},"rollout_pct":0,"segment":"string","variant_override":"string"}],"continuity":true,"design":{},"early_exit":true,"evaluation_runtime":"string","holdout":{},"kill_switch":true,"namespace":{},"prerequisites":[{"flag":"string","value":{}}],"salt":"string","sticky":true},"key":"string","kind":"string","name":"string","payloads":{},"stickiness":"string","tags":["string"],"variants":[{"key":"string","payload":{},"rollout_pct":0}]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
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
400
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/flags-deletedScope flag:read

Parameters

project_idstringpathrequired
limitintegerquery
cursorstringquery

Code samples

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

Responses

200
Example
{
  "data": [
    {
      "deleted_at": "2024-01-01T00:00:00Z",
      "id": "string",
      "key": "string",
      "name": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
deleted_atstringrequired
idstringrequired
keystringrequired
namestringrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/flags/bulkScope flag:write

Apply one action to many flags. Each flag commits on its own, through the same validation, approval gate and policy as a single edit; failures are reported per flag.

Parameters

project_idstringpathrequired
forcebooleanquery
Edit serving state although a running experiment owns the flag; otherwise that flag's result is an error

Request body

application/json
actionstringrequired
add_tags | remove_tags | enable | disable | delete | copy_environment
environmentstring
enable / disable: the environment (absent = base state).
fromstring
copy_environment: source and target environments.
idsstring[]required
1 to 100 flag ids.
tagsstring[]
tostring
{
  "action": "string",
  "environment": "string",
  "from": "string",
  "ids": [
    "string"
  ],
  "tags": [
    "string"
  ],
  "to": "string"
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/flags/bulk" \
  -H "Content-Type: application/json" \
  -d '{"action":"string","environment":"string","from":"string","ids":["string"],"tags":["string"],"to":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
[
  {
    "error": "string",
    "id": "string",
    "ok": true
  }
]
Schema
errorstring
idstringrequired
okbooleanrequired
400
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/flags/code-refsScope flag:read

Parameters

project_idstringpathrequired
flag_keystringquery
limitintegerquery
cursorstringquery

Code samples

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

Responses

200
Example
{
  "data": [
    {
      "flag_key": "string",
      "refs": [
        {
          "file": "string",
          "kind": "string",
          "line": 0
        }
      ],
      "repo": "string",
      "scanned_at": "2024-01-01T00:00:00Z"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
flag_keystringrequired
refsCodeRefView[]required
[{file, line, kind}]
Show child parameters
filestringrequired
kindstringrequired
call | string | ... as classified by the scanner.
lineintegerrequired
repostringrequired
scanned_atstringrequired
next_cursorstring
404

Updated