# Create Links

Create one or more CloudFiles links from Apex.

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

## Signature

```apex
global static List<Link> createLinks(
  List<Types.CreateLinkInput> linkInputs,
  String library,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| linkInputs | List&lt;<a href="#/apex-type-create-link-input">Types.CreateLinkInput</a>&gt; | required | List of Types.CreateLinkInput objects, one per link to create. |
| library | String | required | Type of library, for example sharepoint. Get this value from your Content Library. |
| 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

List<Link&gt;

## Example

```apex
List<cldfs.Types.CreateLinkInput> createLinkInputs = new List<cldfs.Types.CreateLinkInput>{
  new cldfs.Types.CreateLinkInput(
    '01PLJOYLOAWJBFGBSE7FHK5AKOSIMDIO6H',
    'file',
    '006DO000004p2BzYAI',
    'test name',
    'b!ZfA15HRS1Uy9pH3Vw5tFjAHfP1lRYlZAvDwLnHYYq8sa-L6ejXB-TJbMYUxi1QfL'
  )
};

List<cldfs.Link> links = cldfs.Client.createLinks(createLinkInputs,'sharepoint','integrationUser');
```
