API: Create Autotask Attachments
The API: Create Autotask Attachments action attaches files from an incoming email to an Autotask entity. This is a low-level API action that creates attachment records in Autotask for each 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
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 |
|---|---|
| Attach email attachments to ticket | When enabled, attaches all files from the incoming email. Default: enabled. |
| Prevent duplicate attachments | When enabled, checks for existing attachments with the same name and skips duplicates. Only available when "Attach email attachments to ticket" is enabled. |
| Attach original email as .eml file | When enabled, attaches the complete original email as a downloadable .eml file. |
| Attachment Settings for .eml file | Configure the title and publish settings for the .eml attachment. Only shown when "Attach original email as .eml file" is enabled. |
| Attach HTML email as image | When enabled, converts the HTML email content to an image attachment. |
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}} |
| Attach email attachments to ticket | Enabled |
| Publish | All Autotask Users |
Preserve Original Email
Save the complete email for reference:
| Setting | Value |
|---|---|
| Parent Type | 4 (Ticket) |
| Parent ID | {{custom.ticket.id}} |
| Attach original email as .eml file | Enabled |
| Publish | All Autotask Users |
Attach to Account
Add documentation to an account record:
| Setting | Value |
|---|---|
| Parent Type | 1 (Account) |
| Parent ID | {{custom.account.id}} |
| Attach email attachments to ticket | Enabled |
| Publish | Internal Project Team |
Attach to Project
Add files to a project:
| Setting | Value |
|---|---|
| Parent Type | 3 (Project) |
| Parent ID | {{custom.project.id}} |
| Attach email attachments to ticket | Enabled |
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?
Before attaching each file, the action checks if an attachment with the same filename already exists on the parent entity. If found, it skips that file to avoid duplicates.
Related Actions
- API: Create an Object: Create other entity types
- Create Autotask Ticket: Includes built-in attachment options