APIs & Integrations

michaelbarley
Contributor

Get Parent Companies companyId

SOLVE

I have gotten a specific company via the companies API: 

GET: https://api.hubapi.com/companies/v2/companies/{companyId}

The companyId which I supplied is a child company. 

 

How would I get the companyId of the Parent Company?

 

Thanks in advance 

 

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get Parent Companies companyId

SOLVE

Hey @michaelbarley,

 

When looking to get the company ID of the parent company associated to the child company, you can use the CRM Associations API Overview.

 

Specially the Get associations for a CRM object and with definition ID - 14. 

 

E.g.

https://api.hubspot.com/crm-associations/v1/associations/{{child company id}}/HUBSPOT_DEFINED/14?hapikey=hapikey

 

This will return the company ID of the parent company associated to the child company.

View solution in original post

2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get Parent Companies companyId

SOLVE

Hey @michaelbarley,

 

When looking to get the company ID of the parent company associated to the child company, you can use the CRM Associations API Overview.

 

Specially the Get associations for a CRM object and with definition ID - 14. 

 

E.g.

https://api.hubspot.com/crm-associations/v1/associations/{{child company id}}/HUBSPOT_DEFINED/14?hapikey=hapikey

 

This will return the company ID of the parent company associated to the child company.

michaelbarley
Contributor

Get Parent Companies companyId

SOLVE

That is perfect! thanks @WendyGoh 

0 Upvotes