Is there a unified API endpoint to retrieve all attachments from a Company/Deal regardless of source

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:

  1. Get all engagements associated with the company/deal (using associations API)
  2. Fetch each engagement individually to check for attachments
  3. Extract attachment IDs from the engagement’s attachments array
  4. 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:

  1. 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?

  2. 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?
  3. 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

Hey @SVenkatesan - thanks for posting in the Community!
I’d like to tag in some API experts here to see if they have any insight for us! @Ben_M, @alyssamwilie, and @Mike_Eastwood - any thoughts on this setup?

Shane, Senior Community Moderator

@Ben_M, @alyssamwilie, and @Mike_Eastwood - any thoughts on this setup would be helpful.

Hi, did you find any unified endpoint to just get all the attachments assosciated with a deal instead of getting from individual sources?

Hey @SVenkatesan and @Khawaja Thank you both for posting!

I want to share a couple of community threads that shows the current workaround for retrieving attachments associated with Companies and Deals:

https://community.hubspot.com/t5/APIs-Integrations/How-to-export-deal-atachments/m-p/699327

https://community.hubspot.com/t5/APIs-Integrations/finding-all-the-attachments/m-p/760104

Finally I also want to tag a few community experts in case they have additional insights to share. Hey there @ChrisoKlepke @coldrickjack @RomyFuchs1 — would love to hear your thoughts here!

Thanks