/v1/workspaces/{workspace_id}/segments/{segment_id}AuthGet a segment
The segment with its conditions and every (setting, environment) that uses it (`used_by`).
Path parameters
segment_id*string · uuidId of the segment.
workspace_id*string · uuidId of the workspace.
Response · 200 The segment.
id*string · uuidThe segment's id.
workspace_id*string · uuidThe workspace that owns it.
project_id*string · uuidThe project; a segment can be used by any config of it.
key*stringUnique in the project, case-sensitive; SDKs see it in the config JSON.
Example: "qa_staff"
name*stringDisplay name.
Example: "QA staff"
description*stringFree-text description (may be empty).
Example: ""
seed*stringThe key at creation. It never changes, and confidential values are hashed with it, so renaming the segment keeps them valid.
Example: "qa_staff"
conditions*array1-20 conditions, ANDed in order; each is `{user: {attribute, comparator, values}}` (segments hold user conditions only). Confidential comparators take cleartext `values` (stored hashed with the segment's seed and the project salt, and encrypted at rest), `values_hashed`, or `list_id` with `values_add` / `values_remove` to edit a stored list. Confidential lists are shown as `{hashed: true, count, list_id, editable}`.
version*integerIncrements on every change; send it with an update to detect concurrent edits.
Example: 1
usage_count*integerHow many settings use the segment in at least one environment.
Example: 2
created_by*stringWho created it (user or API key id).
created_at*string · date-timeWhen it was created.
updated_at*string · date-timeWhen it last changed.
used_by*arrayEvery (setting, environment) whose rules use the segment. A segment listed anywhere cannot be deleted.
Example
Request
GET https://api.flags.productcraft.co/v1/workspaces/{workspace_id}/segments/{segment_id}
Authorization: Bearer YOUR_TOKENResponse
{
"id": "00000000-0000-0000-0000-000000000000",
"workspace_id": "00000000-0000-0000-0000-000000000000",
"project_id": "00000000-0000-0000-0000-000000000000",
"key": "qa_staff",
"name": "QA staff",
"description": "",
"seed": "qa_staff",
"conditions": [
{
"user": {}
}
],
"version": 1,
"usage_count": 2,
"created_by": "string",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z",
"used_by": [
{
"setting_id": "00000000-0000-0000-0000-000000000000",
"setting_key": "new_checkout",
"config_id": "00000000-0000-0000-0000-000000000000",
"config_key": "main",
"environment_id": "00000000-0000-0000-0000-000000000000",
"environment_key": "production"
}
]
}