Companies Batch Upsert API endpoint

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

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"
 }
 }
 ]
}'

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-property-values/m-p/1119484/highlight/true#M80755

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