I’m working on a project to retrieve all attachments associated with Companies and Deals in HubSpot, and I’m running into some challenges with the current API structure.
Current Situation: Currently, to get attachments, I have to:
- Get all engagements associated with the company/deal (using associations API)
- Fetch each engagement individually to check for attachments
- Extract attachment IDs from the engagement’s attachments array
- Get file metadata for each attachment
This requires multiple API calls for each company/deal and is quite complex.
What I Need: I’m looking for a way to retrieve ALL attachments associated with a Company or Deal in a single (or fewer) API call(s), regardless of where they were attached from:
- Notes
- Emails
- Calls
- Meetings
- Tasks
- Or any other engagement type
Questions:
-
Is there a unified API endpoint that returns all attachments for a given Company ID or Deal ID without having to iterate through individual engagements?
-
If not, is there a more efficient way to batch retrieve attachments than the current approach of:
- Get associations - Get each engagement - Extract attachment IDs - Get file metadata?
-
Are there any plans to add a direct endpoint like this.
Any guidance, workarounds, or product roadmap insights would be greatly appreciated! Thank you in advance for your help