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

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

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

Requires `tenant:forge:admin`, or `tenant:forge:write` and project role maintainer or admin. 1 to 50 members, project members with at least the developer role (400 `memberRefs`); the first is the lead. Writes `forge.config.updated`.

### Parameters

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

### 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; Paul leitet das Team.",
  "key": "mobile",
  "memberRefs": [
    "paul.schmid@muster-it.example",
    "marie.wagner@muster-it.example"
  ],
  "name": "Mobile-Team"
}
```

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

- `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 201 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 POST 'https://api.mbcom.cloud/api/forge/v1/projects/string/teams' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"description":"Entwickler der iOS- und Android-App; Paul leitet das Team.","key":"mobile","memberRefs":["paul.schmid@muster-it.example","marie.wagner@muster-it.example"],"name":"Mobile-Team"}'
```
