Duplicated companies records with API

Hi,

We imported companies records that were pre-existing in Hubspot having the same domain as the pre-existing one: Hubspot duplicated the records instead of merging the imported records with the existing ones having the same domain name.

Detailed description of what happened:

  1. Company with name A and domain name A exists in Hubspot
  2. Another Company B with domain B is created via API call (B has the same name and domain name as A)
  3. Instead of merging Companies A and B, Hubspot created two separate companies

How to avoid duplication?

Hi @Aliba,

I believe I was able to replicate this behavior in my own portal. Could you send me links to two company records where this happened?

Sure:

Hi @Isaac_Takushi, any update on this?
Thank you,

Alice

Hi @Aliba,

Not yet, but I’m investigating further with my team. I appreciate your patience.

Hi @Aliba,

Thanks for your patience.

I’ve confirmed with the relevant product team that HubSpot only deduplicates imported company records. Companies created via the API are not deduplicated by the Company domain name property at this time. Apologies for the confusion surrounding this distinction. I’ll have this article corrected.

This endpoint allows you to check for company records with a specific Company domain name value. You could add it to your app to programmatically deduplicate before creating new records with identical domains.

@IsaacTakushi where in the request JSON do I provide the domain that I would like to search. The example JSON in the doc just specifies the properties to be returned in the response.

{
 "limit": 2,
 "requestOptions": {
 "properties": [
 "domain",
 "createdate",
 "name",
 "hs_lastmodifieddate"
 ]
 },
 "offset": {
 "isPrimary": true,
 "companyId": 0
 }
}

Welcome, @raihaniqbal.

Happy to clarify.

With the Search for companies by domain endpoint, you specify the domain in the request URL itself.

Note where the :domain placeholder is below:

https://api.hubapi.com/companies/v2/domains/:domain/companies

For example, if I were searching for hubspot.com, I would use:

https://api.hubapi.com/companies/v2/domains/hubspot.com/companies

Other search settings like limits and desired properties are included in the payload.

This limitation still seems to exist in 2023, can you say if there are any plans to make deduplication for API-generated company records possible?