APIs & Integrations

IGNACIO1
Member

Check for duplicates by a specific property like telephone

I wanna check if there is already a contact with the same telephone number before to create a new contact. 

 

How can i do this with the API?

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee
HubSpot Employee

Check for duplicates by a specific property like telephone

Hi @IGNACIO1,

 

Currently, the HubSpot endpoint - Create a new contact | Contacts API will only show a 409 errors when you're trying to create a contact with the same email address and this will help to fend off any creation of contact with the same email address. This is only supported for email and not telephone which means you would be able to create a contact with the same telephone. 

 

That said, if you're looking to check if an existing contact has the telephone number before creating a new contact, it would be possible however your team would have to implement the logic on your system.

 

You could get all contacts with their telephone and save it in a database/array list, before creating a new contact, loop through the database/array list to cross check and if there's an existing telephone number, do not create the contact and log an error message. 

 

Hope this helps!