## Create an iteration (tenant:forge:write and, as a member, at least developer)

`POST /api/forge/v1/projects/{key}/iterations`

Module: Forge · operationId: `createForgeIteration` · Tag: Iterations · Auth: access token (`Authorization: Bearer <accessToken>`)

Requires `tenant:forge:write`, and project role developer or higher (non-members of a tenant-visible project may), or `tenant:forge:admin`. `name`, `startsOn` and `endsOn` are required (`endsOn` not before `startsOn`). The iteration starts planned. Archived project 409 `project_archived`. Writes `forge.iteration.saved`.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `key` | path | string | yes | Project key (e.g. APP) |

### Request body

`application/json` (required)

- `endsOn` (string (date)): Last day (not before startsOn)
- `goal` (string): Goal of the iteration (max length 2000)
- `name` (string): Name (max length 80)
- `startsOn` (string (date)): First day
- `version` (integer): PATCH: the version the change is based on

Example:

```json
{
  "endsOn": "2027-01-12",
  "goal": "Anhänge im Ticketverlauf ansehen und herunterladen.",
  "name": "Iteration 4 – Anhänge",
  "startsOn": "2026-12-16"
}
```

### Responses

- **201** Created (`application/json`)
- **400** Error (`application/json`)
- **403** Error (`application/json`)
- **404** Error (`application/json`)
- **409** Error (`application/json`)

Fields of the 201 answer:

- `closedAt` (string (date-time), nullable, required): When it was closed; null until then
- `createdAt` (string (date-time), required): When it was created
- `endsOn` (string (date), required): Last day
- `goal` (string, required): Goal of the iteration
- `id` (string (uuid), required): Iteration id
- `name` (string, required): Name
- `position` (integer, required): Order of the iterations
- `startedAt` (string (date-time), nullable, required): When it was started; null while planned
- `startsOn` (string (date), required): First day
- `state` (string, required): planned, active (at most one per project) or closed (one of `planned`, `active`, `closed`)
- `updatedAt` (string (date-time), required): Last change
- `version` (integer, required): Optimistic-locking version; send it with PATCH
- `progress` (IterationProgress, required): Planned and active iterations count the items in them now; a closed iteration counts its snapshot (every item as it stood at the close, carried-over ones included).

Example 201 answer:

```json
{
  "closedAt": null,
  "createdAt": "2026-10-28T11:00:00Z",
  "endsOn": "2026-11-24",
  "goal": "Kunden sehen ihre Tickets mit Filtern und laden lange Listen nach.",
  "id": "f1b2c3d4-e5f6-4a7b-9c34-1f2a3b4c5d02",
  "name": "Iteration 2 – Ticketübersicht",
  "position": 1,
  "progress": {
    "byCategory": {
      "active": 2,
      "cancelled": 0,
      "done": 4,
      "on_hold": 0,
      "todo": 1,
      "triage": 0
    },
    "committed": 16,
    "estimate": {
      "done": 9,
      "total": 19
    },
    "total": 7
  },
  "startedAt": "2026-11-04T09:30:00Z",
  "startsOn": "2026-11-04",
  "state": "active",
  "updatedAt": "2026-11-04T09:30:00Z",
  "version": 3
}
```

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/forge/v1/projects/string/iterations' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"endsOn":"2027-01-12","goal":"Anhänge im Ticketverlauf ansehen und herunterladen.","name":"Iteration 4 – Anhänge","startsOn":"2026-12-16"}'
```
