APIs & Integrations

rami435
Member

Get all deals to contact associations

Hello,

 

I want to extract all the contacts( specifically lead source) for all the deals.  Please let me know what API i will need to use for this.   I checked the portal and it has API below that is for a single object-

Get associations for CRM object

 I was looking to batch extract all the associations between deals and contacts for specific time period.

Thanks

0 Upvotes
1 Reply 1
jackcoldrick
HubSpot Employee
HubSpot Employee

Get all deals to contact associations

Hi @rami435,

 

For the most part the "CRM Associations API" is the best way to both create, delete and retrieve associations for an Object.  At present there is no batch functionality to GET associations. We can however batch CREATE and DELETE associations.

 

In this case I'd recommend using our "Get all deals" endpoint as this will return up to 250 deals per request and the payload will include associated contacts in the "associatedVids" array. For example see the below. They are the IDs of the Deals associated Contacts.

 

"associations": {
        "associatedVids": [
          393873, 734934
        ]
      }

I hope this helps,

Jack

 

Jack Coldrick
Solutions Engineer @ HubSpot
Add me on LinkedIn