API: Create Autotask Attachments
The API: Create Autotask Attachments action attaches Files from an incoming email, form upload, or earlier action to an Autotask entity. This is a low-level API action that creates attachment records in Autotask for each selected file.
This is a direct API action. You must supply the parent entity type and ID directly. Learn more about the difference between workflow actions and direct API actions.
When to Use This Action
Use this action when:
- You need to attach email files to an existing Autotask entity
- You want to attach files to entity types other than tickets (e.g., Accounts, Projects)
- You need control over attachment visibility settings
- You need to attach form uploads or generated files to a known Autotask entity
Note: The Create Autotask Ticket and Update Existing Autotask Ticket workflow actions include built-in attachment options. Use this action only when those don't meet your needs.
Configuration
Connection
| Field | Description |
|---|---|
| Autotask Connection | Select the Autotask connection to use. If you have multiple connections, you can override the default. |
Attachment Information
Configure where attachments will be stored. These fields are part of the Autotask AttachmentInfo entity.
| Field | Description |
|---|---|
| Parent Type | The type of entity to attach files to. See supported parent types below. Default: 4 (Ticket). |
| Parent ID | The ID of the parent entity. Supports template variables like {{custom.ticket.id}}. The action fails if this field is empty or the template returns no value, unless you enable Suppress Autotask API exceptions. Not used when Parent Type is Opportunity (use Opportunity ID instead). |
| Opportunity ID | The ID of the Opportunity to attach to. Only shown when Parent Type is 14 (Opportunity). |
| Publish | Controls visibility of attachments (e.g., All Autotask Users, Internal Only). Default: All Autotask Users. |
Which Attachments?
| Field | Description |
|---|---|
| Files | Add ordered sources from email properties, form input fields, previous custom results, or All Files. The default sources are email.attachments followed by email.inline_images. |
| Prevent duplicate attachments | Checks for existing attachments with the same content hash and skips duplicates. |
| Attachment Settings for .eml file | Configure the title and publish settings used when Files includes the original email or rendered email image. |
The action processes rows in order and keeps the first occurrence of each file. Apply optional Filename, MIME type, and Maximum bytes filters to each source row. All Files includes every available file and creates the original EML and original email image when available in an email workflow. Select email.attachments when you want only regular files attached to the incoming email.
The action can run without an incoming email when the workflow contains selected Files. It uses the Publish setting from Attachment Information for file visibility.
Advanced
| Field | Description |
|---|---|
| Impersonate Resource | Optionally create attachments as a resource. Select a resource, or unlock the field and enter a text expression that resolves to an Autotask Resource ID. Leave No impersonation selected to use the API connection identity. |
| Retry Impersonated Request Without Resource Impersonation | Appears only when Impersonate Resource has a value and is checked by default. When checked, an impersonation failure records a warning and retries the same attachment operation once as the API user without resource impersonation. When unchecked, the action does not retry. |
| Suppress Autotask API exceptions | Controls whether a non-retried impersonation failure or a failed fallback stops execution. It also applies to other supported Autotask API errors. |
Supported Parent Types
| Value | Entity Type |
|---|---|
| 1 | Account |
| 3 | Project |
| 4 | Ticket or Task |
| 6 | Resource |
| 11 | Expense Report |
| 12 | Knowledge Base Article |
| 13 | Installed Product (Configuration Item) |
| 14 | Opportunity |
| 15 | Sales Order |
| 18 | Time Entry |
| 20 | Account Note |
| 21 | Contract Note |
| 22 | Project Note |
| 23 | Ticket Note or Task Note |
| 24 | Installed Product Note |
| 25 | Document |
For Parent Type 4, the action checks for a matching Ticket and then a matching Task. For Parent Type 23, it checks for a matching Ticket Note and then a matching Task Note.
How to Create Attachments
- Select Autotask Direct API: Create Autotask Attachments from the action dropdown
- Choose the Parent Type (e.g., 4 for Ticket)
- Enter the Parent ID from a previous action
- Enable the attachment options you need
- Configure the Publish setting for visibility
Returned Variables
This action does not return variables. Success or failure for each attachment is logged to the workflow history.
Example Use Cases
Attach Files to Ticket
After creating or finding a ticket:
| Setting | Value |
|---|---|
| Parent Type | 4 (Ticket) |
| Parent ID | {{custom.ticket.id}} |
| Files | Email attachments and inline images |
| Publish | All Autotask Users |
Preserve Original Email
Save the complete email for reference:
| Setting | Value |
|---|---|
| Parent Type | 4 (Ticket) |
| Parent ID | {{custom.ticket.id}} |
| Files | Original email file |
| Publish | All Autotask Users |
Attach to Account
Add documentation to an account record:
| Setting | Value |
|---|---|
| Parent Type | 1 (Account) |
| Parent ID | {{custom.account.id}} |
| Files | Email attachments and inline images |
| Publish | Internal Project Team |
Attach to Project
Add files to a project:
| Setting | Value |
|---|---|
| Parent Type | 3 (Project) |
| Parent ID | {{custom.project.id}} |
| Files | Email attachments and inline images |
Attach a Generated PDF
After a Generate PDF action stores its results in generatedPdf:
| Setting | Value |
|---|---|
| Parent Type | 4 (Ticket) |
| Parent ID | {{custom.ticket.id}} |
| Files | custom.generatedPdf |
FAQs
What file types can be attached?
Most common file types are supported. Autotask may block certain file types (e.g., executable files) based on your security settings.
Is there a file size limit?
Yes. The Autotask API accepts individual files of 6 to 7 megabytes, which is lower than the limit imposed by the Autotask user interface. Autotask also accepts a maximum of 10 megabytes of attachments in any five-minute period. When the action creates an attachment that is larger than the Autotask API limit, Autotask rejects the call and the action reports the failure without retrying the file. See Attachment Limits for details.
What does the .eml attachment contain?
The .eml file contains the complete original email including headers, body, and all attachments. Recipients can open it in any email client to see the message exactly as it was received.
Can I attach files to multiple entities?
Use this action multiple times with different Parent Type and Parent ID values, or use the Iterate action to attach to multiple entities.
What does "Prevent duplicate attachments" do?
For email attachments, this option skips files whose content hash already exists on the parent entity. Selected form uploads and generated files always use the same content-based duplicate check, regardless of this option.
What happens if the file already exists on the entity?
The action skips the file and records the duplicate in workflow history. It compares file content rather than filenames.
Related Actions
- API: Create an Object: Create other entity types
- Create Autotask Ticket: Includes built-in attachment options
- Generate PDF: Creates a PDF file that this action can attach