# Create a team

Create a team, optionally naming its lead by account id. Admin only. 409 when a team of that name is already here.

Access class: `workspace:admin`.

## Endpoint

`POST /v1/workspace/teams`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "leadAccountId": "",
    "name": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "createdAt": "string",
    "id": "",
    "leadAccountId": "",
    "memberIds": [
      "string"
    ],
    "name": "string",
    "parentTeamId": ""
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
