# Get Attachments

Get the files and folders attached to one or more Salesforce records from Apex. Wraps the same Client.listAttachments() method as Get Connected Folder.

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

## Signature

```apex
global static List<List<Attachment>> listAttachments(
  List<String> parentIds,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| parentIds | List&lt;String&gt; | required | The Salesforce record Ids of the records where files/folders are attached. |
| runAs | String | required | Username to attribute the operation to; usually a static value — 'integrationUser'. |

## Return Type

List<List<Attachment&gt;&gt; — one inner list per parentId, in input order.

## Example

```apex
List<String> parentIds = new List<String>{
  '001dL00000ZJIYiQAP',
  '0010Y00000B1Q2HQAV'
};

List<List<cldfs.Attachment>> returnedAttachments = cldfs.Client.listAttachments(
  parentIds,
  'integrationUser'
);
```
