# Delete Resource

Delete one or more resources (files or folders) in connected external storage from Apex.

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

## Signature

```apex
global static void deleteResources(
  List<Types.DeleteResourcesInput> resourcesInput,
  String library,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| resourcesInput | List&lt;<a href="#/apex-type-delete-resources-input">Types.DeleteResourcesInput</a>&gt; | required | One entry per resource to delete. Each is a Types.DeleteResourcesInput. |
| library | String | required | Target storage library. Valid values: sharepoint, google, onedrive, dropbox, box, or cloudfiles (AWS S3). |
| 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.DeleteResourcesInput> resourcesInput = new List<cldfs.Types.DeleteResourcesInput>{
    new cldfs.Types.DeleteResourcesInput(
        new List<String>{'67e3f19b2dee6c355fc82416'},
        'file',
        ''
    )
};
cldfs.Client.deleteResources(resourcesInput, 'cloudfiles', 'integrationUser');
```
