APIs & Integrations

AHall94
Member

Batch uploading contacts that may or may not exist in Hubspot

SOLVE

Hi guys, we're working with our own database of marketing contacts and we want to be able to sync this with hubspot via an API call. From a users perspective the desired functionality is they can choose some contacts in our UI (that may or may not exist in hubspot) and click an Export to Hubspot button and those contacts will then get imported into their hubspot account. We're using 

hubspotClient.crm.contacts.batchApi.create from the Hubspot Client, and if any of the contacts uploaded in the batch already exist in hubspot, the whole operation fails with 
message: 'Contact already exists. Existing ID:<redacted>',
Is there's some kind of skip duplicates flag for batches?
I don't really want to do an API call for every single contact to check that they exist before uploading but I'm struggling to find a better solution. The thought occurred to me to export to csv and then use the file upload endpoint since that seems to have deduplication built in but wanted to double check I hadn't missed anything.
0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Batch uploading contacts that may or may not exist in Hubspot

SOLVE

Hey @AHall94 

 

There are at least 2 ways to do this:

 

1) pushing contacts individually using the legacy "create or update contact" endpoint.

    I would not suggest this due to API limit

 

2) use the import API to import the records

    This endpoint will not flag/error when importing existing record

 

Hope this gets you moving!

If you have any questions please don't hesitate to reach out!

View solution in original post

3 Replies 3
RBozeman
Participant

Batch uploading contacts that may or may not exist in Hubspot

SOLVE

As others have said, HubSpot will keep you from importing leads if they have a matching phone number. But if they don't have a matching phone number, the import is likely to create duplicates. 

 

However, I also wanted to mention that Insycle could help with this. Insycle allows you to choose an identity field (other than email, which HubSpot already does) to prevent duplicates on import. So you could use company names, full names, phone numbers, addresses, etc. Then, you can instruct Insycle to "only create net new" or "update existing" if it does find existing duplicate records to ensure you aren't creating duplicates or losing any important data in the process. Here's the help doc on this use case. 

 

RBozeman_0-1721756657961.png

 

0 Upvotes
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Batch uploading contacts that may or may not exist in Hubspot

SOLVE

Hey @AHall94 

 

There are at least 2 ways to do this:

 

1) pushing contacts individually using the legacy "create or update contact" endpoint.

    I would not suggest this due to API limit

 

2) use the import API to import the records

    This endpoint will not flag/error when importing existing record

 

Hope this gets you moving!

If you have any questions please don't hesitate to reach out!

AHall94
Member

Batch uploading contacts that may or may not exist in Hubspot

SOLVE

Also I did find this article from all the way back in 2020 but that still doesn't seem to have a solution
https://community.hubspot.com/t5/APIs-Integrations/Best-way-to-handle-409-Conflict-in-Batch-Contact-...

0 Upvotes