# Copy Resources

Copy files and folders to a new location within the same external storage drive from Apex.

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

## Signature

```apex
global static void copyResources(
  List<Types.CopyResourceInput> inputs,
  String library,
  String driveId,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| inputs | List&lt;<a href="#/apex-type-copy-resource-input">Types.CopyResourceInput</a>&gt; | required | List of Types.CopyResourceInput objects, one per resource to copy. |
| library | String | required | Type of library. Example: sharepoint. You can get this value from the Content Library. |
| driveId | String | optional | Only applicable for sharepoint and google libraries. Id of the drive in the library. You can get this value from the 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

void

## Example

```apex
List<cldfs.Types.CopyResourceInput> inputs = new List<cldfs.Types.CopyResourceInput>{
  new cldfs.Types.CopyResourceInput(
    '673f9fa0551db2164a42e392',
    '6761bc5d7e748db3f896e416',
    'workspace'
  )
};

cldfs.Client.copyResources(
  inputs,
  'cloudfiles',
  'workspace',
  'integrationUser'
);
```
