## Change a team (tenant:forge:write and maintainer, or tenant:forge:admin)

`PATCH /api/forge/v1/projects/{key}/teams/{id}`

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

Same permission as creating. `version` is required (409 `version_conflict`); the key never changes; `memberRefs` replaces the members.

### 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)

- `description` (string): Description (max length 2000)
- `key` (string): Create: team key; fixed afterwards
- `memberRefs` (array of string): E-mails, the first is the lead
- `name` (string): Display name (max length 80)
- `version` (integer): PATCH: the version the change is based on

Example:

```json
{
  "description": "Entwickler der iOS- und Android-App; Marie leitet das Team.",
  "memberRefs": [
    "marie.wagner@muster-it.example",
    "paul.schmid@muster-it.example"
  ],
  "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:

- `description` (string, required): Description (max length 2000)
- `id` (string (uuid), required): Team id
- `key` (string, required): Team key; never changes
- `memberRefs` (array of string, required): E-mails, the first is the lead
- `name` (string, required): Display name (max length 80)
- `position` (integer, required): Order in the configuration
- `version` (integer, required): Optimistic-locking version; send it with PATCH

Example 200 answer:

```json
{
  "description": "Entwickler der iOS- und Android-App; Paul leitet das Team.",
  "id": "ce8f9a0b-1c2d-4e3f-8a01-8c9d0e1f2a01",
  "key": "mobile",
  "memberRefs": [
    "paul.schmid@muster-it.example",
    "marie.wagner@muster-it.example"
  ],
  "name": "Mobile-Team",
  "position": 0,
  "version": 1
}
```

### Example request

```bash
curl -X PATCH 'https://api.mbcom.cloud/api/forge/v1/projects/string/teams/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"description":"Entwickler der iOS- und Android-App; Marie leitet das Team.","memberRefs":["marie.wagner@muster-it.example","paul.schmid@muster-it.example"],"version":1}'
```
