# cycle_list

List Cycles

## Beschreibung

Lists cycles the caller can see. Cycles are per-workspace sprint
windows with a monotonic `number` per workspace (never reused
across deletions) and a `status` (planned / active / completed
/ cancelled). At most one cycle per workspace is `active` at a time.

Filter by `workspace_id`, `status`, or `bucket` (`current` /
`upcoming` / `past`, computed from today's date). Sorted by
start date ascending. Archived rows are excluded.

## Zugriff

Zugriffsprofil: `gated`. Module: `projects_tasks`.
Die Freigabe im Profil ersetzt keine Account-, Workspace- oder Rollenberechtigung.

## Parameter

| Name | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `account_id` | string | Ja |  |
| `workspace_id` | string | Nein | Workspace prefix ID or key (e.g. ENG). |
| `status` | string | Nein |  |
| `bucket` | string | Nein | Time-window relative to today. |
| `limit` | integer | Nein |  |

## Eingabeschema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "account_id": {
      "type": "string"
    },
    "workspace_id": {
      "type": "string",
      "description": "Workspace prefix ID or key (e.g. ENG)."
    },
    "status": {
      "type": "string",
      "enum": [
        "planned",
        "active",
        "completed",
        "cancelled"
      ]
    },
    "bucket": {
      "type": "string",
      "enum": [
        "current",
        "upcoming",
        "past"
      ],
      "description": "Time-window relative to today."
    },
    "limit": {
      "type": "integer",
      "default": 50
    }
  },
  "required": [
    "account_id"
  ],
  "type": "object"
}
```

## Ausgabeschema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "cycles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Cycle prefix ID (cyc_…)."
          },
          "number": {
            "type": "integer",
            "description": "Auto-increment per workspace, monotonic across deletions."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional label; falls back to 'Cycle #<number>'."
          },
          "status": {
            "type": "string",
            "enum": [
              "planned",
              "active",
              "completed",
              "cancelled"
            ]
          },
          "starts_on": {
            "type": "string",
            "format": "date"
          },
          "ends_on": {
            "type": "string",
            "format": "date"
          },
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "key": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "bucket": {
            "type": "string",
            "enum": [
              "current",
              "upcoming",
              "past"
            ],
            "description": "Computed from today's date."
          }
        },
        "required": [
          "id",
          "number",
          "status",
          "starts_on",
          "ends_on",
          "workspace",
          "bucket"
        ]
      }
    }
  },
  "required": [
    "cycles"
  ],
  "type": "object"
}
```
