# File meetings and Magicasts into a folder

`POST /folder.addContents`

## Description

File up to 100 meetings and Magicasts into a folder in one call. Every
folder member can then read them with [`meeting.info`](/docs/api/meeting-info),
[`meeting.transcript`](/docs/api/meeting-transcript),
[`magicast.info`](/docs/api/magicast-info), and the related endpoints.
Filing an item that is already in the folder succeeds and changes nothing.

**Access:** Organization and Personal. Personal tokens need the `admin` role
on the folder: a viewer gets `403` `access_denied`, and a folder the token's
owner does not belong to returns `404` `folder_not_found`. Organization
tokens can change every folder in the account. Personal tokens can only file items the
token's owner can view. Organization tokens can file meetings from any roam
in the account and Magicasts owned by the account. Any other item fails
the whole call with `404` `meeting_not_found` or `magicast_not_found`, and
nothing is filed.

**Required scope:** `folders:write`

---

**OpenAPI Spec:** [chat-v1.json](https://developer.ro.am/chat-v1.json)

## Authentication

```
Authorization: Bearer YOUR_API_KEY
```

## Request Body

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | string | Yes | Folder ID. |
| `meetingIds` | string[] | No | Meeting IDs, as returned by [`meeting.list`](/docs/api/meeting-list). |
| `magicastIds` | string[] | No | Magicast IDs, as returned by [`magicast.list`](/docs/api/magicast-list). |

### Example Request

```json
{
  "id": "019a0000-0000-7000-8000-0000000000f1",
  "meetingIds": [
    "019a0000-0000-7000-8000-0000000000e1"
  ],
  "magicastIds": [
    "019a0000-0000-7000-8000-0000000000c1"
  ]
}
```

## Responses

### 200 - Items filed

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ok` | "true" | Yes | Always `true` on success. See [Responses and Errors](/docs/guides/responses-and-errors). |


#### Example Response

```json
{
  "ok": true
}
```

### 400 - Bad request. Common causes:
- Missing or invalid `id` (`missing_parameter` / `invalid_parameter`)
- Neither `meetingIds` nor `magicastIds` given (`missing_parameter`)
- More than 100 items in total, or an ID that is not a UUID (`invalid_parameter` / `invalid_arguments`)
- Malformed JSON body or an unknown field (`invalid_json`)


### 401 - Presented invalid authentication credentials.

### 403 - Forbidden. Common causes:
- Token is missing `folders:write` (`missing_scope`)
- Personal token whose owner is a viewer, not an admin, of the folder (`access_denied`)


### 404 - Not found. Common causes:
- Folder not found, or not visible to the caller (`folder_not_found`)
- A meeting or Magicast that does not exist or that the caller cannot file (`meeting_not_found` with `param: meetingIds`, `magicast_not_found` with `param: magicastIds`)


### 405 - An unsupported method was requested.

### 500 - An internal error occurred.

---

*Machine-readable API documentation.*
*Full documentation: https://developer.ro.am/docs/api/folder-add-contents*
