Duplicate check for unique identifier is failing while Create a Company, creating new record

SOLVE
Highlighted
New Contributor

I am using Create a Company (https://developers.hubspot.com/docs/methods/companies/create_company ) api to Crete new copmany.  I have created unique id for Comany. Every time when when i sending same unique id value, creating new comany records each and every time.  

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Moderator

Hi, @tanmay.

 

Happy to clarify.

 

The Companies API currently does not deduplicate records.

 

If you send repeated requests to the Create a company endpoint with the same data, it will create duplicate companies and will not return any errors.

 

Once you successfully create a company and capture the companyId HubSpot assigns, you can use it as the key in the Update a company endpoint when updating that company going forward.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
5 Replies 5
Highlighted
HubSpot Moderator

Hi @tanmay 

 

Would you be able to provide more clarification around this custom Unique ID you're using? It's worth noting that HubSpot only works using pre-defined unique ID's.

 

In this case, the unique ID used for Companies will be the Company Domain or, if you have it, the Company ID.

 

I hope this helps!

Matthew Willson

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

I just wanted to confirm, through api if I submit the same request morethan one, it should throgh an error like already exist. 

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hi, @tanmay.

 

Happy to clarify.

 

The Companies API currently does not deduplicate records.

 

If you send repeated requests to the Create a company endpoint with the same data, it will create duplicate companies and will not return any errors.

 

Once you successfully create a company and capture the companyId HubSpot assigns, you can use it as the key in the Update a company endpoint when updating that company going forward.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

If that is the case, is there any way (any Api) can I check the company alreadu exist or not before create new company. If company already exist need the company id as a resopnse.

 

Regards,

Tanmay

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hi, @tanmay.

 

Yes, you can search for company records by domain with this endpoint.

 

If that's not specific enough, the next best bet is the CRM Search API I mention in this other post of yours.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes