client.teams
Teams of users. These methods are on client.teams, 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.
create()
Section titled “create()”Create a team. Returns the new Team.
def create(self, body: _m.TeamParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.Teamclient.teams.create() · await async_client.teams.create() · POST /teams · API reference
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | — |
Returns
Section titled “Returns”Team:
| Field | Type | Description |
|---|---|---|
id |
string |
The team’s ID. |
object |
"team" |
Always 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
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
team = client.teams.create({ "name": "Sales",})print(team)delete()
Section titled “delete()”Delete a team. Deletes the team. Its members stay in the organisation, in no team; queues that list the team no longer reach them through it.
def delete(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.DeletedTeamclient.teams.delete() · await async_client.teams.delete() · DELETE /teams/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A team ID (team_…). |
Returns
Section titled “Returns”DeletedTeam:
| Field | Type | Description |
|---|---|---|
id |
string |
A team ID (prefix team_). |
object |
"team" |
Always team. |
deleted |
true |
— |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
deleted_team = client.teams.delete("team_7Hk2Lm9Qp")print(deleted_team)list()
Section titled “list()”List teams. Returns a page of Team objects, newest first. Pass next_cursor as starting_after for the next page; the SDKs iterate every page for you.
def list(self, *, limit: int | Unset = 20, starting_after: str | Unset = UNSET, ending_before: str | Unset = UNSET, more_voice_version: str | Unset = UNSET) -> AsyncPage[_m.Team]client.teams.list() · await async_client.teams.list() · GET /teams · 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). |
Returns
Section titled “Returns”A page of results (TeamList): data, has_more and next_cursor.
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
for team in client.teams.list(): print(team)retrieve()
Section titled “retrieve()”Retrieve a team. Returns the Team 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.Teamclient.teams.retrieve() · await async_client.teams.retrieve() · GET /teams/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A team ID (team_…). |
Returns
Section titled “Returns”Team:
| Field | Type | Description |
|---|---|---|
id |
string |
The team’s ID. |
object |
"team" |
Always 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
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
team = client.teams.retrieve("team_7Hk2Lm9Qp")print(team)update()
Section titled “update()”Rename a team. 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.
def update(self, id: str, body: _m.TeamParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET) -> _m.Teamclient.teams.update() · await async_client.teams.update() · PATCH /teams/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A team ID (team_…). |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | — |
Returns
Section titled “Returns”Team:
| Field | Type | Description |
|---|---|---|
id |
string |
The team’s ID. |
object |
"team" |
Always 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
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
team = client.teams.update("team_7Hk2Lm9Qp", { "name": "Sales",})print(team)