API Call creating two companies


#1

Hi,

I'm running an API that creates companies. The API call that I am using to create companies is:

https://api.hubapi.com/companies/v2/companies?hapikey=demo

Today I ran the API and the first company was created successfully created at 8:19am.

URL: https://app.hubspot.com/contacts/2597761/company/840415757/

My API successfully finished running at 9:36:29am

Except at around 10:38am another company was created, supposedly by the API, but the API had already finished, with no other programs running that utilize the above create companies API call.

HSCompany3

The URL of the mysterious duplicate is:
https://app.hubspot.com/contacts/2597761/company/840599967/

Could you help me track down why the extra company was made? It is tough for me to replicate it as it seems to happen randomly (I made the same call earlier and no duplicate was made).

Thanks in Advance

Sam


#2

Hi @sam_tdr,

That does sound very strange; does your integration happen to have any logic that tries to create companies after creating a contact without an existing company or something? I noticed that the 'duplicate' company has an associated contact, while the 'original' company record does not have any associated contacts.


#3

Hi @Derek_Gervais,

Thanks for the response.

It doesn't, which is why I'm so perplexed. There wasn't any software 'interacting' with hubspot via API calls at that time (10:38am). Is there any off chance it could have been done earlier and the create date time is somehow wrong/late?

Cheers,
Sam


#4

Hi @sam_tdr,

That's unlikely, since the create date is set permanently during the record creation process. All I can say for this specific example is that the odd duplicate version was created by the 'create and associate companies with contacts' setting. This could be the explanation for all of the duplicates you're seeing, but it's tough to say for sure without other examples.