# Update Team

Rename a team. Its members and shares stay as they are.

`PUT https://connect.mindcloud.co/v2/teams/:teamId`

Permissions: `role:manage`.

## Parameters

### Path

- `teamId` (string, required): The team's id, from List Teams.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Body

- `name` (string): A new name, up to 255 characters, unique in the company (ignoring case).

## Example request

```bash
curl --request PUT \
  --url 'https://connect.mindcloud.co/v2/teams/tm_Q8dL2vN6tRwe' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Finance (EMEA)"
}'
```

## Response fields

- `id` (string): Unique id of the team.
- `name` (string): The team's name, unique in the company (ignoring case).
- `memberUserIds` (array of string): The userIds of the people on the team (List Members), earliest added first.
- `memberCount` (number): How many people are on the team.
- `createdBy` (string): The userId of the member who created the team. Null when it is unknown.
- `createdOn` (date): When the team was created.
- `updatedOn` (date): When the team was last renamed, or created.

## Errors

- 400 Bad request (INVALID_QUERY, NO_FIELDS_TO_UPDATE): `VALIDATION_FAILED` / `NO_FIELDS_TO_UPDATE` "Provide "name"."
- 404 Team not found: `NOT_FOUND` "Team "tm_Q8dL2vN6tRwe" was not found."
- 409 Duplicate team name: `CONFLICT` / `TEAM_NAME_TAKEN` "Your organization already has a team with this name."
