APIs & Integrations

Ryan450
Member

Hubspot auto-creates a company even if you specify "associatedcompanyid"

How to recreate:

 

1. Enable the setting "Create and associate companies with contacts" via: Settings > Data management > Objects > Companies

 

2. Create a contact using the API with "associatedcompanyid" for an existing company.

 

POST /crm/v3/objects/companies

{
  "properties": {
    "domain": "zappos-corp.com",
    "name": "Zappos"
  }
}

 

 

POST /crm/v3/objects/contacts

{
  "properties": {
    "associatedcompanyid": 123456 (ID from created company above),
    "firstname": "John",
    "lastname": "Doe",
    "jobtitle": "Founder",
    "email": "john@zappos.com"
  }
}

 

3. Hubspot will correctly associate the contact with the company you specified in "associatedcompanyid", but will also create a secondary empty company that's not associated with any contact (shouldn't)

 

Hubspot will always create a "zappos.com" company based on the contact's email even if you just want to associate with the "zappos-corp.com" company you created.

0 Upvotes
1 Reply 1
LeeBartelme
HubSpot Employee
HubSpot Employee

Hubspot auto-creates a company even if you specify "associatedcompanyid"

When creating the company, you need to add an additional domain to the company.

 

These additional domains will be used for checking during contact creation. The field you want to update is called "hs_additional_domains". I believe this is a list, so set the company domain to zappos.com and maybe additional domain to zappos-corp.com (or vice versa if that makes sense to you). If the company has the correct domains, you shouldn't need the associatecomapnyid proerty defined.

 

This should fix your issue.

0 Upvotes