# Email invitations

`POST https://api.morevoice.ai/v1/conference_rooms/{id}/invite`

Emails each address the room's guest link, phone dial-in and a calendar file, in the room's language. Needs a live key.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `conference_rooms_invite`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A conference room ID (`room_…`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |
| `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. |

## Request body

Required, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emails` | `string[]` | yes | Up to 50 addresses. |
| `message` | `string` | no | A personal note in the invitation. |
| `pin` | `string` | no | Print this participant PIN in the invitation (otherwise it says a PIN is required). |

Example:

```json
{
  "emails": [
    "dana@example.com"
  ],
  "message": "Agenda: Q4 pipeline."
}
```

## Responses

### 200 OK

OK Returns `ConferenceInviteBatch`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"conference_invite_batch"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `room_id` | `string` | A conference room ID (prefix `room_`). |
| `sent` | `integer` | — |
| `results` | `object[]` | — |

Example:

```json
{
  "livemode": true,
  "object": "conference_invite_batch",
  "results": [
    {
      "email": "dana@example.com",
      "error": null,
      "status": "sent"
    }
  ],
  "room_id": "room_2dXk9QmZ4rTv",
  "sent": 1
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID exists in this organisation and mode. Returns `ErrorEnvelope`.

### 409 Conflict

The request conflicts with the object's state, or the Idempotency-Key was reused with other parameters. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const conferenceInviteBatch = await mv.conferenceRooms.invite("room_7Hk2Lm9Qp", {
	emails: [
		"dana@example.com",
	],
	message: "Agenda: Q4 pipeline.",
});
console.log(conferenceInviteBatch);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

conference_invite_batch = client.conference_rooms.invite("room_7Hk2Lm9Qp", {
    "emails": [
        "dana@example.com",
    ],
    "message": "Agenda: Q4 pipeline.",
})
print(conference_invite_batch)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/conference_rooms/room_7Hk2Lm9Qp/invite \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "emails": [
    "dana@example.com"
  ],
  "message": "Agenda: Q4 pipeline."
}'
```
