/v1/workspaces/{workspace_id}/projects/{project_id}/stale-flagsAuthList 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 · uuidId of the project.
workspace_id*string · uuidId of the workspace.
Query parameters
daysintegerDays without a value or targeting change before a flag counts as unchanged (the project's `stale_after_days`, default 30).
config_idstring · uuidOnly this config.
reasonenum (6)Only flags with this reason.
cursorstringOpaque cursor from `pagination.next_cursor`.
limitintegerPage size.
Response · 200 A page of stale flags.
data*arrayStale flags, longest unchanged first. Permanent flags are never listed.
pagination*objectCursor pagination.
days*integerThe `days` threshold used.
Example: 30
evaluation_data*objectFlags 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_TOKENimport { Flags } from "@productcraft/flags";
// Reads PRODUCTCRAFT_API_KEY from the environment
const flags = new Flags();
for await (const staleFlag of flags.projects.staleFlags.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
console.log(staleFlag);
}
const page = await flags.projects.staleFlags.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });flags.projects.staleFlags.list(projectId, params?, options?): PagePromise<Flags.StaleFlag>
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"
}