# Add To Dataroom

Add content to a dataroom from Apex.

> Kind: Apex method · Updated: 2026-07-01

## Signature

```apex
global static void addToDataroom(
  List<Types.AddDataroomChildrenInput> childrenInputs,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| childrenInputs | List&lt;<a href="#/apex-type-add-dataroom-children-input">Types.AddDataroomChildrenInput</a>&gt; | required | List of Types.AddDataroomChildrenInput entries describing the children to add to the dataroom. |
| runAs | String | required | Email Id of the user on whose behalf the function should run. To run the action as the automation user, supply integrationUser. |

## Return Type

void

## Example

```apex
List<cldfs.Types.DataroomChild> children = new List<cldfs.Types.DataroomChild> {
   new cldfs.Types.DataroomChild('67a09ad4e249057a78212c17', 'file', 'sharepoint', 'b!nJBtPq_z5UeJtFrj_f24XEQqlPUD8vtFsg7GBcrXJepiUn9bkb_7QbDPtqHVD-cP')
};
List<cldfs.Types.AddDataroomChildrenInput>childrenInputs = new List<cldfs.Types.AddDataroomChildrenInput> {
   new cldfs.Types.AddDataroomChildrenInput('67a09ad4e249057a78212c16', children)
};
cldfs.Client.addToDataroom(childrenInputs, 'integrationUser');
```

> **Testing** — Use ClientFactory with default mock values to get coverage without callouts. See How to get test coverage of code that uses Client methods.
