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>
GEThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/schedulesScope flag:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

200
Example
{
  "data": [
    {
      "applied_at": "2024-01-01T00:00:00Z",
      "body": {},
      "change_request_id": "string",
      "created_at": "2024-01-01T00:00:00Z",
      "created_by": "string",
      "error": "string",
      "id": "string",
      "project_id": "string",
      "run_at": "2024-01-01T00:00:00Z",
      "segment_id": "string",
      "status": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
applied_atstring
bodyobjectrequired
{name, description, rules, source?}: the segment body written at run_at.
change_request_idstring
created_atstringrequired
created_bystring
errorstring
idstringrequired
project_idstringrequired
run_atstringrequired
segment_idstringrequired
statusstringrequired
awaiting_approval | pending | applied | failed | cancelled.
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/schedulesScope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
descriptionstring
namestring
rulesobject[]
sourceobject
run_atstringrequired
When to write the edit (future, at most a year ahead).
{
  "description": "string",
  "name": "string",
  "rules": [
    {}
  ],
  "source": {},
  "run_at": "2024-01-01T00:00:00Z"
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/schedules" \
  -H "Content-Type: application/json" \
  -d '{"description":"string","name":"string","rules":[{}],"source":{},"run_at":"2024-01-01T00:00:00Z"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 pending, or awaiting_approval with a change request when segment edits need approval
Example
{
  "applied_at": "2024-01-01T00:00:00Z",
  "body": {},
  "change_request_id": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "error": "string",
  "id": "string",
  "project_id": "string",
  "run_at": "2024-01-01T00:00:00Z",
  "segment_id": "string",
  "status": "string"
}
Schema
applied_atstring
bodyobjectrequired
{name, description, rules, source?}: the segment body written at run_at.
change_request_idstring
created_atstringrequired
created_bystring
errorstring
idstringrequired
project_idstringrequired
run_atstringrequired
segment_idstringrequired
statusstringrequired
awaiting_approval | pending | applied | failed | cancelled.
400
403
404
DELETEhttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/schedules/{sid}Scope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired
sidstringpathrequired

Code samples

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

Responses

403
404 No such schedule, or it already ran
POSThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/syncScope flag:write

Re-materialise a `synced` segment now. A failed read keeps the previous members and records `sync_error`.

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

200
Example
{
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "description": "string",
  "id": "string",
  "key": "string",
  "kind": "string",
  "member_count": 0,
  "name": "string",
  "rules": [
    {}
  ],
  "source": {},
  "sync_error": "string",
  "synced_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z"
}
Schema
created_atstringrequired
created_bystring
descriptionstringrequired
idstringrequired
keystringrequired
kindstringrequired
rules (expanded into definitions), list (uploaded members) or synced (members materialised from a connector-mirrored warehouse table).
member_countintegerrequired
namestringrequired
rulesobject[]required
[{filters: [Filter]}]: rules are OR-ed, a rule's filters AND-ed.
sourceobject
synced only: {table, column} of warehouse_rows (column empty = the row key).
sync_errorstring
synced_atstring
updated_atstringrequired
403
404
409
GEThttps://lucidace.com/v1/projects/{project_id}/flag-settingsScope flag:read

Parameters

project_idstringpathrequired

Code samples

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

Responses

200
Example
{
  "confirm_on_save": true,
  "default_conditions": [
    {}
  ],
  "max_conditions": 0,
  "max_flags": 0
}
Schema
confirm_on_savebooleanrequired
The editor asks for confirmation before saving a change to a live flag.
default_conditionsobject[]required
Conditions a new flag starts with when its draft names none.
max_conditionsinteger
max_flagsinteger
404
PUThttps://lucidace.com/v1/projects/{project_id}/flag-settingsScope admin

Parameters

project_idstringpathrequired

Request body

application/json
confirm_on_saveboolean
default_conditionsobject[]
max_conditionsinteger
At most this many conditions per flag (absent = unlimited).
max_flagsinteger
At most this many live flags (absent = unlimited).
{
  "confirm_on_save": true,
  "default_conditions": [
    {}
  ],
  "max_conditions": 0,
  "max_flags": 0
}

Code samples

cURL
curl -X PUT "https://lucidace.com/v1/projects/{project_id}/flag-settings" \
  -H "Content-Type: application/json" \
  -d '{"confirm_on_save":true,"default_conditions":[{}],"max_conditions":0,"max_flags":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/flag-staleScope flag:read

Parameters

project_idstringpathrequired
limitintegerquery
cursorstringquery
min_age_daysintegerquery
Only flags created at least this many days ago
excludestringquery
Comma-separated flag keys or tags to leave out

Code samples

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

Responses

200
Example
{
  "next_cursor": "string",
  "stale": [
    {
      "id": "string",
      "key": "string",
      "purpose": "string",
      "reasons": [
        "string"
      ],
      "variants": [
        "string"
      ],
      "winner": "string"
    }
  ]
}
Schema
next_cursorstring
Pass as ?cursor= for the next page (flags are ordered by key).
staleStaleFlag[]required
Show child parameters
idstringrequired
keystringrequired
purposestring
The flag's purpose, when set.
reasonsstring[]required
fully_rolled_out, not_evaluated_30d, expired, experiment_concluded, past_expected_lifetime (older than its purpose allows, N-EXP-12), ...
variantsstring[]required
Variant keys (a multivariate flag is cleaned up to one of them).
winnerstring
Winning variant of a finished experiment on this flag: clean the flag up to it.
404
GEThttps://lucidace.com/v1/projects/{project_id}/flag-templatesScope flag:read

Parameters

project_idstringpathrequired

Code samples

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

Responses

200
Example
{
  "data": [
    {
      "created_at": "2024-01-01T00:00:00Z",
      "definition": {},
      "description": "string",
      "id": "string",
      "name": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
created_atstringrequired
definitionobjectrequired
A flag draft body (kind, filters, variants, tags, ...) applied by the editor.
descriptionstringrequired
idstringrequired
namestringrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/flag-templatesScope flag:write

Parameters

project_idstringpathrequired

Request body

application/json
definitionobjectrequired
A flag draft body without key: kind, filters, variants, tags, ...
descriptionstring
namestringrequired
{
  "definition": {},
  "description": "string",
  "name": "string"
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/flag-templates" \
  -H "Content-Type: application/json" \
  -d '{"definition":{},"description":"string","name":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
Example
{
  "created_at": "2024-01-01T00:00:00Z",
  "definition": {},
  "description": "string",
  "id": "string",
  "name": "string"
}
Schema
created_atstringrequired
definitionobjectrequired
A flag draft body (kind, filters, variants, tags, ...) applied by the editor.
descriptionstringrequired
idstringrequired
namestringrequired
400
403
404
409

Updated