Flags API reference

Flags API · Stale-Flags

get/v1/workspaces/{workspace_id}/projects/{project_id}/stale-flagsAuth

List stale flags

Flags that are probably dead code, longest unchanged first, each with its `reasons`: no value or targeting change in `days` (default the project's `stale_after_days`), serving one value to everyone in every environment (`rolled_out`, `turned_off`, `same_value_everywhere`), or marked `released` / `deprecated`. `suggested_value` is the literal to replace the flag read with when cleaning it up; `prerequisite_of` counts settings that still depend on it. Permanent flags are never listed. Flags collects no evaluation data, so the report cannot tell whether code still reads a flag (`evaluation_data: not_collected`).

Path parameters

project_id*string · uuid

Id of the project.

workspace_id*string · uuid

Id of the workspace.

Query parameters

daysinteger

Days without a value or targeting change before a flag counts as unchanged (the project's `stale_after_days`, default 30).

config_idstring · uuid

Only this config.

reasonenum (6)

Only flags with this reason.

cursorstring

Opaque cursor from `pagination.next_cursor`.

limitinteger

Page size.

Response · 200 A page of stale flags.

data*array

Stale flags, longest unchanged first. Permanent flags are never listed.

pagination*object

Cursor pagination.

days*integer

The `days` threshold used.

Example: 30

evaluation_data*object

Flags does not collect evaluation data (SDKs evaluate locally and report nothing), so the report is based on change history, targeting and lifecycle only.

Example: "not_collected"

Example

Request

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

Response

{
  "data": [
    {
      "setting_id": "00000000-0000-0000-0000-000000000000",
      "key": "new_checkout",
      "name": "New checkout",
      "type": "boolean",
      "config_id": "00000000-0000-0000-0000-000000000000",
      "config_key": "main",
      "lifecycle": "temporary",
      "owner_id": "00000000-0000-0000-0000-000000000000",
      "tags": [
        "checkout"
      ],
      "reasons": [
        "no_recent_change",
        "rolled_out"
      ],
      "last_changed_at": "2026-01-01T00:00:00.000Z",
      "days_since_change": 64,
      "suggested_value": true,
      "prerequisite_of": 0,
      "environments": [
        {
          "environment_id": "00000000-0000-0000-0000-000000000000",
          "environment_key": "production",
          "value": true,
          "has_targeting": false,
          "updated_at": "2026-01-01T00:00:00.000Z"
        }
      ]
    }
  ],
  "pagination": {},
  "days": 30,
  "evaluation_data": "not_collected"
}