client.invitations
Invitations to join your organisation (emailed; the link is never returned). These methods are on client.invitations, 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()”Invite a user. Invites one person by email. They join with the role you chose when they accept (7 days). A seat is reserved for them: 402 plan_limit when none is free. Inviting an address that already has an open invitation replaces it (the old link stops working). The link is only emailed — the API never returns it.
def create(self, body: _m.InvitationCreateParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.Invitationclient.invitations.create() · await async_client.invitations.create() · POST /invitations · API reference
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
email |
string |
yes | Their email address. The invitation is emailed to it. |
role |
"owner" | "admin" | "supervisor" | "agent" |
no | Default agent. API keys invite agents and supervisors; owner and admin invitations come from an owner. |
team_id |
string | null |
no | team_… ID. |
Returns
Section titled “Returns”Invitation:
| Field | Type | Description |
|---|---|---|
id |
string |
The invitation’s ID. |
object |
"invitation" |
Always invitation. |
livemode |
boolean |
true in live mode, false in test mode. |
email |
string |
— |
role |
"owner" | "admin" | "supervisor" | "agent" |
The role they get when they accept. |
billing |
boolean |
— |
team_id |
string | null |
team_… ID. |
status |
"pending" | "expired" |
pending until it expires (7 days); accepted and withdrawn invitations are no longer listed. |
invited_by |
string | null |
The user who invited them (for an API key: the user who created the key). |
existing_user |
boolean |
The address already has an account (in another organisation): they join with it. |
created |
string |
An ISO-8601 timestamp in UTC. |
expires |
string |
An ISO-8601 timestamp in UTC. |
emailed |
boolean |
On create and resend: whether the invitation email went out. False when your organisation’s invitation emails are off — share the link from the dashboard. |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
invitation = client.invitations.create({ "email": "yossi@example.com", "role": "agent",})print(invitation)delete()
Section titled “delete()”Withdraw an invitation. Returns the deleted object’s id with deleted: true. Answers 404 with the code resource_missing when nothing has this ID in this organisation and mode.
def delete(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.DeletedInvitationclient.invitations.delete() · await async_client.invitations.delete() · DELETE /invitations/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A invitation ID (inv_t_…). |
Returns
Section titled “Returns”DeletedInvitation:
| Field | Type | Description |
|---|---|---|
id |
string |
A invitation ID (prefix inv_t_). |
object |
"invitation" |
Always invitation. |
deleted |
true |
— |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
deleted_invitation = client.invitations.delete("inv_t_7Hk2Lm9Qp")print(deleted_invitation)list()
Section titled “list()”List invitations. Open invitations, and those that expired in the last 30 days (resend them).
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.Invitation]client.invitations.list() · await async_client.invitations.list() · GET /invitations · 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 (InvitationList): data, has_more and next_cursor.
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
for invitation in client.invitations.list(): print(invitation)resend()
Section titled “resend()”Resend an invitation. Emails a new link, valid 7 more days (the previous link stops working). An expired invitation takes its seat back, so it is seat-checked again.
def resend(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.Invitationclient.invitations.resend() · await async_client.invitations.resend() · POST /invitations/{id}/resend · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A invitation ID (inv_t_…). |
Returns
Section titled “Returns”Invitation:
| Field | Type | Description |
|---|---|---|
id |
string |
The invitation’s ID. |
object |
"invitation" |
Always invitation. |
livemode |
boolean |
true in live mode, false in test mode. |
email |
string |
— |
role |
"owner" | "admin" | "supervisor" | "agent" |
The role they get when they accept. |
billing |
boolean |
— |
team_id |
string | null |
team_… ID. |
status |
"pending" | "expired" |
pending until it expires (7 days); accepted and withdrawn invitations are no longer listed. |
invited_by |
string | null |
The user who invited them (for an API key: the user who created the key). |
existing_user |
boolean |
The address already has an account (in another organisation): they join with it. |
created |
string |
An ISO-8601 timestamp in UTC. |
expires |
string |
An ISO-8601 timestamp in UTC. |
emailed |
boolean |
On create and resend: whether the invitation email went out. False when your organisation’s invitation emails are off — share the link from the dashboard. |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
invitation = client.invitations.resend("inv_t_7Hk2Lm9Qp")print(invitation)retrieve()
Section titled “retrieve()”Retrieve an invitation. Returns the Invitation 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.Invitationclient.invitations.retrieve() · await async_client.invitations.retrieve() · GET /invitations/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A invitation ID (inv_t_…). |
Returns
Section titled “Returns”Invitation:
| Field | Type | Description |
|---|---|---|
id |
string |
The invitation’s ID. |
object |
"invitation" |
Always invitation. |
livemode |
boolean |
true in live mode, false in test mode. |
email |
string |
— |
role |
"owner" | "admin" | "supervisor" | "agent" |
The role they get when they accept. |
billing |
boolean |
— |
team_id |
string | null |
team_… ID. |
status |
"pending" | "expired" |
pending until it expires (7 days); accepted and withdrawn invitations are no longer listed. |
invited_by |
string | null |
The user who invited them (for an API key: the user who created the key). |
existing_user |
boolean |
The address already has an account (in another organisation): they join with it. |
created |
string |
An ISO-8601 timestamp in UTC. |
expires |
string |
An ISO-8601 timestamp in UTC. |
emailed |
boolean |
On create and resend: whether the invitation email went out. False when your organisation’s invitation emails are off — share the link from the dashboard. |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
invitation = client.invitations.retrieve("inv_t_7Hk2Lm9Qp")print(invitation)