APIs & Integrations

david_pearce
Member

Create Company creates dupicates

Hi,
When I use the create companies api it will allow me to create duplicate entries.
I am specifying the domain name in the data.
Is there anything I can do to avoid duplicates ?
Cheers
Dave

0 Upvotes
5 Replies 5
david_pearce
Member

Create Company creates dupicates

A domain check alone would not function correctly. Consider where you deal with a company who has multiple branches but a single domain.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Create Company creates dupicates

@david.pearce if you’re trying to update an existing company, you’ll need to use the separate update endpoint:

Update a Company | Companies API

PUT /companies/v2/companies/:companyId - Updates the existing company with the id :companyId

As you mentioned domain won’t be required to be unique in the same way that email would be for contacts, and we don’t have a single endpoint that would allow you to either update or create a company, so if you’re updating a company you’d need to store the companyId of the existing HubSpot record and then use the update endpoint.

0 Upvotes
david_pearce
Member

Create Company creates dupicates

I am specifying the domain in the data but still get duplicate entries,

0 Upvotes
david_pearce
Member

Create Company creates dupicates

As above that is what I am doing.

0 Upvotes
laupifrpar
Member

Create Company creates dupicates

Hi,

To avoid duplicates, you must specify the domain name in the data.

0 Upvotes