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}/flag-segmentsScope flag:write

Parameters

project_idstringpathrequired

Request body

application/json
descriptionstring
keystringrequired
1 to 100 chars of letters, digits, _, -, .; referenced from flag conditions.
kindstring
rules (default), list (uploaded members) or synced (members from a mirrored table).
namestring
rulesobject[]
[{filters: [Filter]}]: rules are OR-ed, a rule's filters AND-ed. Empty for member segments.
sourceobject
synced: {table, column} of a connector-mirrored warehouse table (column absent = row key).
{
  "description": "string",
  "key": "string",
  "kind": "string",
  "name": "string",
  "rules": [
    {}
  ],
  "source": {}
}

Code samples

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

Responses

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

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

404
PUThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}Scope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
descriptionstring
namestring
rulesobject[]
sourceobject
synced segments: replace the source.
{
  "description": "string",
  "name": "string",
  "rules": [
    {}
  ],
  "source": {}
}

Code samples

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

Responses

400
403
404
DELETEhttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}Scope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

204
403
404
409
GEThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/change-requestsScope flag:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

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

Responses

200 Pending and approved requests of the segment
Example
{
  "data": [
    {
      "applied_version": 0,
      "approvals": [
        {}
      ],
      "base_version": 0,
      "created_at": "2024-01-01T00:00:00Z",
      "environment": "string",
      "experiment_id": "string",
      "expires_at": "2024-01-01T00:00:00Z",
      "failure_reason": "string",
      "flag_id": "string",
      "id": "string",
      "policy_key": "string",
      "project_id": "string",
      "proposal": {},
      "quorum": 0,
      "requested_by": "string",
      "review_note": "string",
      "reviewed_at": "2024-01-01T00:00:00Z",
      "reviewed_by": "string",
      "status": "string",
      "subject": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
applied_versioninteger
approvalsobject[]required
[{user_id, note, at}], one entry per approver so far.
base_versioninteger
Flag version the request was made against; apply fails when the flag moved on.
created_atstringrequired
environmentstring
experiment_idstring
expires_atstring
Pending or approved requests past this instant expire unused.
failure_reasonstring
Why a failed request could not be applied.
flag_idstring
idstringrequired
policy_keystring
The approval-policy key whose rule governs this request (flag.rollout, ...).
project_idstringrequired
proposalobjectrequired
quorumintegerrequired
Approvals needed before the request counts as approved.
requested_bystring
review_notestring
reviewed_atstring
reviewed_bystring
statusstringrequired
subjectstringrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/change-requestsScope flag:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json

The segment body an edit writes (same fields as PUT /flag-segments/{id}).

descriptionstring
namestring
rulesobject[]
sourceobject
{
  "description": "string",
  "name": "string",
  "rules": [
    {}
  ],
  "source": {}
}

Code samples

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

Responses

201 Pending request; approving it with apply: true writes the edit
Example
{
  "applied_version": 0,
  "approvals": [
    {}
  ],
  "base_version": 0,
  "created_at": "2024-01-01T00:00:00Z",
  "environment": "string",
  "experiment_id": "string",
  "expires_at": "2024-01-01T00:00:00Z",
  "failure_reason": "string",
  "flag_id": "string",
  "id": "string",
  "policy_key": "string",
  "project_id": "string",
  "proposal": {},
  "quorum": 0,
  "requested_by": "string",
  "review_note": "string",
  "reviewed_at": "2024-01-01T00:00:00Z",
  "reviewed_by": "string",
  "status": "string",
  "subject": "string"
}
Schema
applied_versioninteger
approvalsobject[]required
[{user_id, note, at}], one entry per approver so far.
base_versioninteger
Flag version the request was made against; apply fails when the flag moved on.
created_atstringrequired
environmentstring
experiment_idstring
expires_atstring
Pending or approved requests past this instant expire unused.
failure_reasonstring
Why a failed request could not be applied.
flag_idstring
idstringrequired
policy_keystring
The approval-policy key whose rule governs this request (flag.rollout, ...).
project_idstringrequired
proposalobjectrequired
quorumintegerrequired
Approvals needed before the request counts as approved.
requested_bystring
review_notestring
reviewed_atstring
reviewed_bystring
statusstringrequired
subjectstringrequired
400
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/membersScope flag:read

Parameters

project_idstringpathrequired
idstringpathrequired
limitintegerquery
cursorstringquery

Code samples

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

Responses

200
Example
{
  "data": [
    {
      "added_at": "2024-01-01T00:00:00Z",
      "key": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
added_atstringrequired
keystringrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/membersScope flag:write

Add / remove members of a `list` segment (at most 10,000 keys per call).

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
addstring[]
= []
removestring[]
= []
replaceboolean
Drop every member first (upload a fresh list in batches: first batch with replace).
= false
{
  "add": [],
  "remove": [],
  "replace": false
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/flag-segments/{id}/members" \
  -H "Content-Type: application/json" \
  -d '{"add":[],"remove":[],"replace":false}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "member_count": 0
}
Schema
member_countintegerrequired
400
403
404
409

Updated