Get the company Id



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.



companyID and associatedcompanyid can accessed via API.

companyID can be found here on the company object.

associatedcompanyID can be found here: