How do I find File IDs to use in the Mailgun HubSpot Integration?

How to find file IDs to use as attachments to include in the Mailgun HubSpot Workflow action

Overview

Every file in HubSpot has a unique ID, this ID can be used in the HubSpot Mailgun Integration app Workflow actions to attach one or more files from a CRM Record or HubSpot Files.

If File IDs are captured against properties in the enrolled or associated enrolled records, you can use this to dynamically specify the ID - otherwise, you can enter a specific ID within the Workflow action where you want the same file to be attached for all files.

We expect in most cases, you will want to send non-generic files using this app - if this is the case, you will need to do one or more of the following:

  • Train your users in how to copy File IDs and add them to CRM records (as per the instructions below)
  • Use tools such as DocMergy to generate the files and add the IDs to your CRM records

Getting File IDs from CRM Record Attachments

Files attached directly to CRM records (like contacts, companies, or deals) in HubSpot can be identified by following these steps:

Step 1: Open the CRM Record

  • In HubSpot, navigate to the CRM record (e.g., a contact, company, or deal) that contains the attached file you need.

Step 2: Locate the Attached File

  • Scroll through the record's activity timeline or attachments area to locate the attached file.

Step 3: Open the File Preview

  • Click on the attached file. This should open a preview or download prompt for the file.

Step 4: Find the File ID in the URL

  • Once the file is previewed or downloaded, look at the URL in your browser’s address bar. The File ID will appear as a string of numbers in the URL (typically after “fileID=”).

Example:

  • If the URL is https://app.hubspot.com/files/123456789/fileID=987654321, the File ID is 987654321.

Getting File IDs from CRM Record File Upload Properties

Files can also be stored within CRM records under specific file upload properties. To retrieve File IDs from these properties:

Step 1: Open the CRM Record

  • Navigate to the CRM record that contains the file in a file upload property field.

Step 2: Locate the File Upload Property

  • Find the designated file upload property in the record’s details section. It might have a label like "Attached Document" or “File Upload.”

Step 3: Access the File

  • Click on the file icon or name within the property field to view the file or initiate a download.

Step 4: Identify the File ID in the URL

  • After the file opens, check the URL in your browser. The File ID will be displayed in the URL, similar to the previous method.

Note:

  • The File ID will be the number sequence immediately following “fileID=” in the URL.

Getting File IDs from the HubSpot Files Area 

For files stored directly in the HubSpot file manager (e.g., files used across marketing or sales activities):

Step 1: Access the Files Area

  • In HubSpot, go to Marketing > Files and Templates > Files.

Step 2: Search for the File

  • Use the search bar or browse the folders to find the file you need.

Step 3: Open File Details

  • Click on the file name to open its details pane.

Step 4: Copy the File ID from the Details

  • In the file details pane, look for the File ID in the “File URL” section. HubSpot typically includes the File ID as part of the URL here, just like with attached files.

Example:

  • If the file URL is https://cdn2.hubspot.net/hubfs/123456/fileID=876543210, then 876543210 is the File ID.