APIs & Integrations

german1
Member

Get the company Id

SOLVE

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.

0 Upvotes
1 Accepted solution
Flora
Solution
HubSpot Product Team
HubSpot Product Team

Get the company Id

SOLVE

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

View solution in original post

2 Replies 2
german1
Member

Get the company Id

SOLVE

Thanks for your help! I end up doing another query to add the deal to the contact, without any companyId.

0 Upvotes
Flora
Solution
HubSpot Product Team
HubSpot Product Team

Get the company Id

SOLVE

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