# Rename a team

`PATCH https://api.morevoice.ai/v1/teams/{id}`

Changes only the fields you send. Returns the updated `Team`. Answers `404` with the code `resource_missing` when nothing has this ID in this organisation and mode.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `teams_update`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A team ID (`team_…`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Request body

Required, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | yes | — |

Example:

```json
{
  "name": "Sales"
}
```

## Responses

### 200 OK

OK Returns `Team`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | The team's ID. |
| `object` | `"team"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `name` | `string` | — |
| `member_count` | `integer` | Active members in the team. |
| `created` | `string` | An ISO-8601 timestamp in UTC. |

Example:

```json
{
  "created": "2026-10-01T12:00:00.000Z",
  "id": "team_7Hj2Kl4Mn6Pq8Rs0Tu2Vw",
  "livemode": true,
  "member_count": 6,
  "name": "Sales",
  "object": "team"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID exists in this organisation and mode. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const team = await mv.teams.update("team_7Hk2Lm9Qp", {
	name: "Sales",
});
console.log(team);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

team = client.teams.update("team_7Hk2Lm9Qp", {
    "name": "Sales",
})
print(team)
```

**cURL**

```sh
curl -X PATCH https://api.morevoice.ai/v1/teams/team_7Hk2Lm9Qp \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Sales"
}'
```
