## Change an item template (tenant:forge:write and maintainer, or tenant:forge:admin)

`PATCH /api/forge/v1/projects/{key}/item-templates/{id}`

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

Same permission as creating. `version` is required (409 `version_conflict`); keys never change.

### Parameters

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

### Request body

`application/json` (required)

- `body` (string): Description it prefills (Markdown) (max length 100000)
- `key` (string): Create: template key; fixed afterwards
- `labelIds` (array of string (uuid)): Labels it sets
- `name` (string): Display name (max length 80)
- `title` (string): Title it prefills (max length 300)
- `typeId` (string (uuid), nullable): Item type it sets; null clears it
- `version` (integer): PATCH: the version the change is based on

Example:

```json
{
  "labelIds": [
    "8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c04",
    "8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c02"
  ],
  "version": 1
}
```

### Responses

- **200** Changed (`application/json`)
- **400** Error (`application/json`)
- **403** Error (`application/json`)
- **404** Error (`application/json`)
- **409** Error (`application/json`)

Fields of the 200 answer:

- `body` (string, required): Markdown
- `id` (string (uuid), required): Template id
- `key` (string, required): Template key (`templateKey` of a new item)
- `labelIds` (array of string (uuid), required): Labels it sets
- `name` (string, required): Display name
- `position` (integer, required): Order in the configuration
- `title` (string, required): Title it prefills
- `version` (integer, required): Optimistic-locking version; send it with PATCH
- `typeId` (string (uuid), nullable): Item type it sets; null = none

Example 200 answer:

```json
{
  "body": "## Beobachtet\n\n## Erwartet\n\n## Schritte zum Nachstellen\n\n1. \n",
  "id": "ac6d7e8f-9a0b-4c1d-8ecf-6a7b8c9d0e01",
  "key": "fehlerbericht",
  "labelIds": [
    "8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c04"
  ],
  "name": "Fehlerbericht",
  "position": 0,
  "title": "",
  "typeId": "7f3a4b5c-6d7e-4f8a-9b9c-3d4e5f6a7b04",
  "version": 1
}
```

### Example request

```bash
curl -X PATCH 'https://api.mbcom.cloud/api/forge/v1/projects/string/item-templates/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"labelIds":["8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c04","8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c02"],"version":1}'
```
