# client.invitations

> The invitations methods of the morevoice Python SDK: Invitations to join your organisation (emailed; the link is never returned).

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](https://docs.morevoice.ai/sdk/python/#connect)). 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()`

**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.

```python
# client.invitations
def create(self, body: _m.InvitationCreateParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.Invitation
```

`client.invitations.create()` · `await async_client.invitations.create()` · `POST /invitations` · [API reference](https://docs.morevoice.ai/api/operations/invitations_create/)

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

`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

```python
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()`

**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.

```python
# client.invitations
def delete(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.DeletedInvitation
```

`client.invitations.delete()` · `await async_client.invitations.delete()` · `DELETE /invitations/{id}` · [API reference](https://docs.morevoice.ai/api/operations/invitations_delete/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `str` | yes | A invitation ID (`inv_t_…`). |

### Returns

`DeletedInvitation`:

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | A invitation ID (prefix `inv_t_`). |
| `object` | `"invitation"` | Always `invitation`. |
| `deleted` | `true` | — |

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

deleted_invitation = client.invitations.delete("inv_t_7Hk2Lm9Qp")
print(deleted_invitation)
```

## `list()`

**List invitations.** Open invitations, and those that expired in the last 30 days (resend them).

```python
# client.invitations
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](https://docs.morevoice.ai/api/operations/invitations_list/)

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

A page of results (`InvitationList`): `data`, `has_more` and `next_cursor`.

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

for invitation in client.invitations.list():
    print(invitation)
```

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

```python
# client.invitations
def resend(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.Invitation
```

`client.invitations.resend()` · `await async_client.invitations.resend()` · `POST /invitations/{id}/resend` · [API reference](https://docs.morevoice.ai/api/operations/invitations_resend/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `str` | yes | A invitation ID (`inv_t_…`). |

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

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

invitation = client.invitations.resend("inv_t_7Hk2Lm9Qp")
print(invitation)
```

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

```python
# client.invitations
def retrieve(self, id: str, *, more_voice_version: str | Unset = UNSET) -> _m.Invitation
```

`client.invitations.retrieve()` · `await async_client.invitations.retrieve()` · `GET /invitations/{id}` · [API reference](https://docs.morevoice.ai/api/operations/invitations_retrieve/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `str` | yes | A invitation ID (`inv_t_…`). |

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

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

invitation = client.invitations.retrieve("inv_t_7Hk2Lm9Qp")
print(invitation)
```
