# Batch update Contacts with 'idProperty'=\>'email'

**URL:** <https://community.hubspot.com/t/batch-update-contacts-with-idproperty-email/62818>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [August 11, 2022, 1:36pm UTC](https://community.hubspot.com/t/batch-update-contacts-with-idproperty-email/62818 "2022-08-11T13:36:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnnaKbn](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@AnnaKbn](https://community.hubspot.com/u/AnnaKbn)\
**Post date:** [August 11, 2022, 1:36pm UTC](https://community.hubspot.com/t/batch-update-contacts-with-idproperty-email/62818/1 "2022-08-11T13:36:03Z")

</div>

Hi everyone,  
I’m trying to batch update Contacts through the API using ‘idProperty’=\>‘email’ without success. I’m using the PHP library. If I do the update with regular ids it works, but with ‘idProperty’ I get an error message _‘Could not get some CONTACT objects, they may be deleted or not exist. Check that ids are valid.’_  
I tried rearranging the input and moving around ‘idProperty’ as I don’t know which is the right syntax, but none worked for me.

`$inputs = [["idProperty" => "email", "id"=>"xxxx@example.com", "properties" => ["evt_test"=>true]]];$BatchInputSimplePublicObjectBatchInput = new BatchInputSimplePublicObjectBatchInput(['inputs' => $inputs]);try { $apiResponse = $this->client->crm()->contacts()->batchApi()->update( $BatchInputSimplePublicObjectBatchInput );} catch (\HubSpot\Client\Crm\Contacts\ApiException $e) { $this->log->logError($e->getMessage());}`

I really hope you can help me! Thanks!

---

<div class="post-metadata">

**Author:** ![ChrisoKlepke](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrisoklepke/32/11213_2.png) [@ChrisoKlepke](https://community.hubspot.com/u/ChrisoKlepke)\
**Post date:** [August 11, 2022, 2:59pm UTC](https://community.hubspot.com/t/batch-update-contacts-with-idproperty-email/62818/2 "2022-08-11T14:59:53Z")

</div>

Hey @AnnaKbn ,

pretty sure idProperty is not available in the Batch Update endpoint. I’ve looked at the files of the BatchInputSimplePublicObjectBatchInput and there is no avail be parameter. It’s a different story for Batch Read.

Unless I’m missing something here, I’m sorry to disappoint you here.

Cheers,

Chriso

---

<div class="post-metadata">

**Author:** ![GordonRT](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gordonrt/32/75439_2.png) [@GordonRT](https://community.hubspot.com/u/GordonRT)\
**Post date:** [September 29, 2022, 9:35pm UTC](https://community.hubspot.com/t/batch-update-contacts-with-idproperty-email/62818/3 "2022-09-29T21:35:38Z")

</div>

Well to say the least the documentation is most misleading, extracted from:

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fcrm-contacts-v3%2Fguide)**

## Unique identifiers and deduplication

An email address is the [primary unique identifier](https://knowledge.hubspot.com/crm-setup/deduplication-of-contacts-companies-deals-tickets#automatic-deduplication-in-hubspot)for a contact in HubSpot. For existing contacts, the contact ID is also unique and will deduplicate contacts. To update a contact via the API, you can use either the contact ID or the contact’s email.

The idProperty query parameter doesn’t appear on the Endpoints tab due to technical limitations, but it can be used for contacts exclusively with email. To use an email address as the unique identifier, set the idProperty as email and enter the email address in place of the contact ID. This should be set as a query parameter rather than added to the request body.

It would seem a reasonable expectation that the batch update would work in a similar manner by specifying

],

“idProperty”: “email”

}

---

<div class="post-metadata">

**Author:** ![craigcri](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/craigcri/32/93509_2.png) [@craigcri](https://community.hubspot.com/u/craigcri)\
**Post date:** [November 11, 2022, 10:56pm UTC](https://community.hubspot.com/t/batch-update-contacts-with-idproperty-email/62818/4 "2022-11-11T22:56:03Z")

</div>

Gordon, I’m solving the same problem now. It seems ONLY Contact ID / HubSpot Vid is the only way to do it… but we don’t have HubSpot Contact IDs stored locally.

Did you have to update to run a contact lookup to retrieve integer ID, than use that to update?

---

<div class="post-metadata">

**Author:** ![GordonRT](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gordonrt/32/75439_2.png) [@GordonRT](https://community.hubspot.com/u/GordonRT)\
**Post date:** [November 14, 2022, 4:05pm UTC](https://community.hubspot.com/t/batch-update-contacts-with-idproperty-email/62818/5 "2022-11-14T16:05:19Z")

</div>

Yes that is what I ended up doing. Which was use a query to retrieve by email to get the associated integer Id for that email. Less than ideal but got the job done.
