# Create Salesforce File

Copy a file from external storage into Salesforce as a native Salesforce File, from Apex.

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

## Signature

```apex
global static void createContentVersion(
  List<Types.CreateContentVersionPayload> files,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| files | List&lt;<a href="#/apex-type-create-content-version-payload">Types.CreateContentVersionPayload</a>&gt; | required | One entry per file to copy into Salesforce. Each is a Types.CreateContentVersionPayload carrying the source file metadata. |
| runAs | String | optional | 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.CreateContentVersionPayload> files = new List<cldfs.Types.CreateContentVersionPayload>{
    new cldfs.Types.CreateContentVersionPayload(
        '01KEHAKUUSU3E5OUXBBJGLYTD3IZU4BCRV', //fileId
        'b!nJBtPq_z5UeJtFrj_f24XEQqlPUD8vtFsg7GBcrXJepiUn9bkb_7QbDPtqHVD-cP', //driveId
        'sharepoint', //Library
        '{"recordId": "00QdL000009q8txUAA"}' //recordId Json
    )
};
cldfs.Client.createContentVersion(files, 'integrationUser');
```

> **Parameter name** — The first parameter is named files (per the Client.cls signature). Older Archbee docs labelled it inputs.
