Get the company Id


#1

Hello,

I am trying to add a new deal to the contacts of a company, but first it is required to set the 'associatedcompanyid' property to the contact so you can create a deal and associate that deal to the contact.
I tried to set that 'associatedcompanyid' but I think I am using the wrong companyId, since the request returns me a 400 error with the following message 'XXXX is not a valid company'. I realised I was using the hub-id instead of a company Id, but I have no idea which is the company id or where to find it.

Thanks in advance.


#2

Hello,

companyID and associatedcompanyid can accessed via API.

companyID can be found here on the company object. https://developers.hubspot.com/docs/methods/companies/get_company_contacts

associatedcompanyID can be found here: https://developers.hubspot.com/docs/methods/companies/get_company_contacts

Best,
Flora