Hi,
I am looking for a deals API attribute which links to lead (Contact or Company) from which the deal is created. I have pulled analytics_source_data_1 and analytics_source_data_2 attributes in deals API, but this not giving much information on leads.
Thanks, Bibi
@bibipaulp
Are you looking for associations?
@Mike_Eastwood puts me to shame with his knowledge. He might have more insights than I.
No. He will have more insights 
Hi @bibipaulp ,
The approach I recommend is the trusty old Get associations for a CRM object endpoint.
The relationships use Definition IDs e.g. “Contact to Deal” (4) or “Company to Deal” (6).
You can find a full list fo relationships here.
Warning: the Definition ID is directional so “Contact to Deal” is not the same as “Deal to Contact”.
For this example we plug in the Object ID (1748701) and the Definition ID (4).
https://api.hubapi.com/crm-associations/v1/associations/1748701/HUBSPOT_DEFINED/4?hapikey=
This will return a list of Objects IDs (Deal IDs in this case).
You can see here only a single deal (with the ID of 189656089) has been found:
{
"results": [
189656089
],
"hasMore": false,
"offset": 189656089
}
Have fun
Mike
p.s. thanks for the mention @dennisedson