APIs & Integrations

tanmay
Member

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

SOLVE

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.  

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

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

SOLVE

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

Associate Certification Manager

View solution in original post

0 Upvotes
5 Replies 5
Willson
HubSpot Employee
HubSpot Employee

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

SOLVE

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!

Product Manager @ HubSpot
0 Upvotes
tanmay
Member

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

SOLVE

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

0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

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

SOLVE

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

Associate Certification Manager
0 Upvotes
tanmay
Member

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

SOLVE

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

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

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

SOLVE

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

Associate Certification Manager
0 Upvotes