mv.invitations
Invitations to join your organisation (emailed; the link is never returned). These methods are on mv.invitations, where mv is your client (see the Node.js SDK). Each one returns the response object and throws 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.
mv.invitations.create(body: InvitationsCreateData["body"], options?: RequestOptions): Promise<InvitationsCreateResponse>POST /invitations · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
body.email |
string |
yes | Their email address. The invitation is emailed to it. |
body.role |
"owner" | "admin" | "supervisor" | "agent" |
no | Default agent. API keys invite agents and supervisors; owner and admin invitations come from an owner. |
body.team_id |
string | null |
no | team_… ID. |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options.headers["Idempotency-Key"] |
string |
no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
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”import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const invitation = await mv.invitations.create({ email: "yossi@example.com", role: "agent",});console.log(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.
mv.invitations.delete(id: InvitationsDeleteData["path"]["id"], options?: RequestOptions): Promise<InvitationsDeleteResponse>DELETE /invitations/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
yes | A invitation ID (inv_t_…). |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options.headers["Idempotency-Key"] |
string |
no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
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”import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const deletedInvitation = await mv.invitations.delete("inv_t_7Hk2Lm9Qp");console.log(deletedInvitation);list()
Section titled “list()”List invitations. Open invitations, and those that expired in the last 30 days (resend them).
mv.invitations.list(query?: NonNullable<InvitationsListData["query"]>, options?: RequestOptions): PagedList<InvitationsListResponse["data"][number], NonNullable<InvitationsListData["query"]>>GET /invitations · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
query.limit |
integer |
no | How many objects to return, 1–100 (default 20). |
query.starting_after |
string |
no | A cursor (next_cursor) or object ID: return the objects after it (older). |
query.ending_before |
string |
no | A cursor or object ID: return the objects before it (newer). |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
Returns
Section titled “Returns”A PagedList: await it for the first page, for await it for every item.
Example
Section titled “Example”import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
for await (const invitation of mv.invitations.list()) { console.log(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.
mv.invitations.resend(id: InvitationsResendData["path"]["id"], options?: RequestOptions): Promise<InvitationsResendResponse>POST /invitations/{id}/resend · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
yes | A invitation ID (inv_t_…). |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options.headers["Idempotency-Key"] |
string |
no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
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”import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const invitation = await mv.invitations.resend("inv_t_7Hk2Lm9Qp");console.log(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.
mv.invitations.retrieve(id: InvitationsRetrieveData["path"]["id"], options?: RequestOptions): Promise<InvitationsRetrieveResponse>GET /invitations/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
yes | A invitation ID (inv_t_…). |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
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”import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const invitation = await mv.invitations.retrieve("inv_t_7Hk2Lm9Qp");console.log(invitation);