APIs & Integrations

fancyHS
Member

Companies Batch Upsert API endpoint

SOLVE

Facing the below error, While using batch upsert api for compaines object using "domain" as unique identifier.  Anyone facing the issue. 

 

Unable to perform update/upsert by non-unique 0-2 property domain in portal ID

 

 
But documentation specified that, For companies, "domain" is the primary unique identifier

https://developers.hubspot.com/docs/guides/api/crm/objects/companies#properties

0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Companies Batch Upsert API endpoint

SOLVE

Hi @fancyHS,

 

Your logic in attempting this is correct. However, it looks like the "primary unique identifier" does not necessarily mean that the property itself actually is a unique property (it does not require unique values) - as it is possible to enter the same domain name for multiple company records. Certainly confusing. 

 

Someone else recently asked about the Company upsert endpoint and I provided a suggestion on how to work around this limitation in this thread: https://community.hubspot.com/t5/APIs-Integrations/Create-or-update-a-batch-of-contacts-by-unique-pr...

 

I realize the solution is not ideal but hopefully helps explain the situation.


✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

2 Replies 2
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Companies Batch Upsert API endpoint

SOLVE

Hi @fancyHS,

 

Your logic in attempting this is correct. However, it looks like the "primary unique identifier" does not necessarily mean that the property itself actually is a unique property (it does not require unique values) - as it is possible to enter the same domain name for multiple company records. Certainly confusing. 

 

Someone else recently asked about the Company upsert endpoint and I provided a suggestion on how to work around this limitation in this thread: https://community.hubspot.com/t5/APIs-Integrations/Create-or-update-a-batch-of-contacts-by-unique-pr...

 

I realize the solution is not ideal but hopefully helps explain the situation.


✔️ Did this post help answer your query? Help the community by marking it as a solution.

fancyHS
Member

Companies Batch Upsert API endpoint

SOLVE
curl --request POST \
 --url https://api.hubapi.com/crm/v3/objects/companies/batch/upsert \
 --header 'authorization: Bearer <Access_Token>' \
 --header 'content-type: application/json' \
 --data '{
 "inputs": [
   {
     "idProperty": "domain",
     "id": "test3.com",
     "properties": {
       "name": "test3"
     }
   }
 ]
}'
0 Upvotes