Flags API reference

Flags API · Segments

get/v1/workspaces/{workspace_id}/projects/{project_id}/segmentsAuth

List segments

The project's segments, oldest first, with `usage_count`.

Path parameters

project_id*string · uuid

Id of the project.

workspace_id*string · uuid

Id of the workspace.

Query parameters

cursorstring

Opaque cursor for pagination: the `next_cursor` of the previous page.

limitinteger

Page size.

Response · 200 A page of segments.

data*array

Segments, oldest first.

pagination*object

The cursor for the next page.

Example

Request

GET https://api.flags.productcraft.co/v1/workspaces/{workspace_id}/projects/{project_id}/segments
Authorization: Bearer YOUR_TOKEN

Response

{
  "data": [
    {
      "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"
    }
  ],
  "pagination": {}
}