# Update a user

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

Changes a member's role, team or extension. A role change signs them in again in this organisation. API keys manage agents and supervisors: granting `owner` or `admin`, or changing an owner or admin, answers 403 — an owner does that in the dashboard.

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

Operation ID: `users_update`.

## Parameters

### Path parameters

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

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

Optional, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `extension` | `string \| null` | no | Their extension (digits), or null / empty for none. |
| `role` | `"owner" \| "admin" \| "supervisor" \| "agent"` | no | A new role. API keys manage agents and supervisors; `owner` and `admin` are granted by an owner, in the dashboard. |
| `team_id` | `string \| null` | no | Their team, or null for none. |

Example:

```json
{
  "role": "supervisor",
  "team_id": "team_7Hj2Kl4Mn6Pq8Rs0Tu2Vw"
}
```

## Responses

### 200 OK

OK Returns `User`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | The user's ID. |
| `object` | `"user"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `name` | `string` | — |
| `email` | `string` | — |
| `role` | `"owner" \| "admin" \| "supervisor" \| "agent"` | Their role in the organisation: what they can see and change. |
| `billing` | `boolean` | They may manage billing (granted by owners only). |
| `team_id` | `string \| null` | `team_…` ID. |
| `extension` | `string \| null` | Their internal extension, unique in the organisation. |
| `status` | `"active" \| "deactivated" \| "invited"` | `active`; `deactivated` (cannot sign in here, keeps no seat); `invited` (added, has not set a password yet). |
| `takes_seat` | `boolean` | Counts towards the plan's seats. |
| `email_verified` | `boolean` | — |
| `last_login` | `string \| null` | — |
| `created` | `string` | When they joined the organisation. |

Example:

```json
{
  "billing": false,
  "created": "2026-10-01T12:00:00.000Z",
  "email": "dana@example.com",
  "email_verified": true,
  "extension": "204",
  "id": "usr_2Lm8Pq4Rt6Vx0Zb3Nd5Fh7",
  "last_login": "2026-11-03T08:01:10.000Z",
  "livemode": true,
  "name": "Dana Levi",
  "object": "user",
  "role": "agent",
  "status": "active",
  "takes_seat": true,
  "team_id": "team_7Hj2Kl4Mn6Pq8Rs0Tu2Vw"
}
```

### 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 user = await mv.users.update("usr_7Hk2Lm9Qp", {
	role: "supervisor",
	team_id: "team_7Hj2Kl4Mn6Pq8Rs0Tu2Vw",
});
console.log(user);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

user = client.users.update("usr_7Hk2Lm9Qp", {
    "role": "supervisor",
    "team_id": "team_7Hj2Kl4Mn6Pq8Rs0Tu2Vw",
})
print(user)
```

**cURL**

```sh
curl -X PATCH https://api.morevoice.ai/v1/users/usr_7Hk2Lm9Qp \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "role": "supervisor",
  "team_id": "team_7Hj2Kl4Mn6Pq8Rs0Tu2Vw"
}'
```
