# Types.CreateContentVersionPayload

Describes one external-storage file to materialize as a Salesforce File.

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

Types.CreateContentVersionPayload describes a single external-storage file that should be materialized as a Salesforce File (ContentVersion). Pass a List<Types.CreateContentVersionPayload&gt; to Client.createContentVersion().

## Fields

### Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| fileId | String | required | The resource Id of each file for which content version needs to be created. |
| driveId | String | required | Drive Id in external storage. |
| library | String | required | The related files library such as cloudfiles, google, sharepoint etc. |
| context | String | required | This parameter is used to identify and manage the source of a created Salesforce File when a 'Content Version Created' event is triggered. It should be in JSON format, for example: {"recordId": "00QdL000009q8txUAA"}. |

## Constructors

```apex
global CreateContentVersionPayload(
  String fileId,
  String driveId,
  string library,
  String context
) {
  this.library = library;
  this.driveId = driveId;
  this.fileId = fileId;
  this.context = context;
}
```

## 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');
```
