client.users
Users in the organisation. These methods are on client.users, where client is a MoreVoice client (see the Python SDK). On AsyncMoreVoice the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.
delete()
Section titled “delete()”Deactivate a user. Deactivates the membership: they are signed out of this organisation, free their seat, and their open callbacks go back to their queue. They keep their account (and other organisations); POST /v1/users/{id}/reactivate undoes it.
def delete(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.Userclient.users.delete() · await async_client.users.delete() · DELETE /users/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A user ID (usr_…). |
Returns
Section titled “Returns”User:
| Field | Type | Description |
|---|---|---|
id |
string |
The user’s ID. |
object |
"user" |
Always 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
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
user = client.users.delete("usr_7Hk2Lm9Qp")print(user)list()
Section titled “list()”List users. Your organisation’s members (deactivated ones included), newest first.
def list(self, *, limit: int | Unset = 20, starting_after: str | Unset = UNSET, ending_before: str | Unset = UNSET, role: _m.UsersListRole | Unset = UNSET, status: _m.UsersListStatus | Unset = UNSET, team_id: str | Unset = UNSET, more_voice_version: str | Unset = UNSET) -> AsyncPage[_m.User]client.users.list() · await async_client.users.list() · GET /users · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer |
no | How many objects to return, 1–100 (default 20). |
starting_after |
string |
no | A cursor (next_cursor) or object ID: return the objects after it (older). |
ending_before |
string |
no | A cursor or object ID: return the objects before it (newer). |
role |
"owner" | "admin" | "supervisor" | "agent" |
no | Only members with this role. |
status |
"active" | "deactivated" | "invited" |
no | Only members in this status. |
team_id |
string |
no | Only members of this team. |
Returns
Section titled “Returns”A page of results (UserList): data, has_more and next_cursor.
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
for user in client.users.list(): print(user)reactivate()
Section titled “reactivate()”Reactivate a user. Reactivates a deactivated member. They take a seat again (402 plan_limit when none is free).
def reactivate(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.Userclient.users.reactivate() · await async_client.users.reactivate() · POST /users/{id}/reactivate · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A user ID (usr_…). |
Returns
Section titled “Returns”User:
| Field | Type | Description |
|---|---|---|
id |
string |
The user’s ID. |
object |
"user" |
Always 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
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
user = client.users.reactivate("usr_7Hk2Lm9Qp")print(user)retrieve()
Section titled “retrieve()”Retrieve a user. Returns the User object. Answers 404 with the code resource_missing when nothing has this ID in this organisation and mode.
def retrieve(self, id: str, *, more_voice_version: str | Unset = UNSET) -> _m.Userclient.users.retrieve() · await async_client.users.retrieve() · GET /users/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A user ID (usr_…). |
Returns
Section titled “Returns”User:
| Field | Type | Description |
|---|---|---|
id |
string |
The user’s ID. |
object |
"user" |
Always 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
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
user = client.users.retrieve("usr_7Hk2Lm9Qp")print(user)update()
Section titled “update()”Update a user. 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.
def update(self, id: str, body: _m.UserUpdateParamsInput | Mapping[str, Any] | Unset = UNSET, *, more_voice_version: str | Unset = UNSET) -> _m.Userclient.users.update() · await async_client.users.update() · PATCH /users/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A user ID (usr_…). |
Request body
Section titled “Request body”| 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. |
Returns
Section titled “Returns”User:
| Field | Type | Description |
|---|---|---|
id |
string |
The user’s ID. |
object |
"user" |
Always 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
Section titled “Example”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)