# Types.CreateAttachmentInput

Input describing a single attachment to create from an external storage resource.

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

Represents input for creating attachments using the Client.createAttachments() function. Each instance points at one file or folder in external storage and the Salesforce record to attach it to.

## Fields

### Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
| resourceId | String | required | Id of the file/folder in external storage, for which we're creating the attachment. |
| resourceType | String | required | One of file or folder. |
| parentId | String | required | Salesforce Id of the record for which we're creating the attachment. |
| driveId | String | required | Only applicable for SharePoint or Google Drive libraries. Supply null for other libraries. You can get this value from the Content Library. |
| objectType | String | optional | Optional Salesforce object type of the parent record. Supplied via the 5-parameter constructor; omit or use the 4-parameter constructor to leave it unset. |

## Constructors

```apex
CreateAttachmentInput(
  String resourceId,
  String resourceType,
  String parentId,
  String driveId
)
```

```apex
CreateAttachmentInput(
  String resourceId,
  String resourceType,
  String parentId,
  String driveId,
  String objectType
)
```
