# Delete Attachment

Disconnect a file or folder from a Salesforce record by deleting its attachment object.

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

## Signature

```apex
global static void deleteAttachments(
  List<Types.DeleteAttachmentInput> attachmentInputs,
  String library,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| attachmentInputs | List&lt;<a href="#/apex-type-delete-attachment-input">Types.DeleteAttachmentInput</a>&gt; | required | List of Types.DeleteAttachmentInput. |
| library | String | required | Type of Library. Example - sharepoint |
| runAs | String | required | Email Id of the user on whom behalf the function should run. If you want to run the action as automation user, supply integrationUser. |

## Return Type

void

## Example

```apex
List<cldfs.Types.DeleteAttachmentInput> deleteAttachmentInputs = new List<cldfs.Types.DeleteAttachmentInput>{
  new cldfs.Types.DeleteAttachmentInput(
    '6761bc5d7e748db3f896e416',
    'file',
    '006DXXXXXXXXXXXX'
  )
};

cldfs.Client.deleteAttachments(deleteAttachmentInputs,'google','integrationUser');
```
