Batch Update/Upsert with email as idProperty Fails – Treated as Non-Unique

Hi,

I’m trying to perform a batch update on Contacts using email as the idProperty , but I’m encountering the following error:

{
 "status": "error",
 "message": "Unable to perform update/upsert by non-unique 0-1 property email in portal ID 43945711",
 "correlationId": "124f585a-3afb-476b-80d7-da7d993fe41f",
 "category": "VALIDATION_ERROR"
}

Request body:

POST https://api.hubapi.com/crm/v3/objects/contacts/batch/update
{
 "inputs": [
 {
 "objectWriteTraceId": "0",
 "properties": { "firstname": "Ben" },
 "idProperty": "email",
 "id": "contact@email.com"
 },
 {
 "objectWriteTraceId": "1",
 "properties": { "firstname": "Jane" },
 "idProperty": "email",
 "id": "communications@email.com"
 }
 ]
}

Also, when I attempt a batch upsert with email as idProperty, same issue:

{
 "status": "error",
 "message": "Cannot perform a partial upsert with email. To get around this limitation, omit `objectWriteTraceId` and try again.",
 "correlationId": "a2297f02-7198-4aca-b0c2-56adac413a48",
 "category": "VALIDATION_ERROR"
}

Request body:

POST https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert
{
 "inputs": [
 {
 "objectWriteTraceId": "0",
 "properties": { "firstname": "Ben" },
 "idProperty": "email",
 "id": "contact@email.com"
 },
 {
 "objectWriteTraceId": "1",
 "properties": { "firstname": "Jane" },
 "idProperty": "email",
 "id": "communications@email.com"
 }
 ]
}

Additional notes:

Question:
Why is email documented as a unique identifier but restricted in batch update/upsert operations? Is this a known limitation or a bug?

Unfortunately, “partial upserts” don’t work on contacts using the email as an id.

155174i17628CD6E48E7DE0.png

https://community.hubspot.com/t5/APIs-Integrations/Batch-update-contacts-using-email-as-idProperty/m-p/976074

I’m not sure you can do a batch update using email as the identifier. It’s usually the Id for this method (albeit Contacts might be an exception).