# Batch update contacts using email as idProperty

**URL:** <https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [May 14, 2024, 12:38pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092 "2024-05-14T12:38:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohanL](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@JohanL](https://community.hubspot.com/u/JohanL)\
**Post date:** [May 14, 2024, 12:38pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/1 "2024-05-14T12:38:50Z")

</div>

Hello all,

I’m trying to get some confirmation if it’s possible to do a batch update of contacts using email as an idProperty.

I get an error back saying the property is non-unique, which is weird to me since email is the unique key for contacts, no?

I tried to create another unique property and added some test data and the same API call worked. Shouldn’t it be possible to use email?

Here’s an example payload:  
{ “inputs”: [{ “idProperty”: “email”, “id”: “[test.test@test.com](mailto:test.test@test.com)”, “properties”: { “firstname”: “John”, “lastname”: “Doe” } } ] }

…which gives the following:

{ “status”: “error”, “message”: “Unable to perform update/upsert by non-unique 0-1 property email in portal ID xxxxxxx” … }

Endpoint: [https://api.hubapi.com/crm/v3/objects/contacts/batch/update](https://api.hubapi.com/crm/v3/objects/contacts/batch/update)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 15, 2024, 2:46pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/2 "2024-05-15T14:46:50Z")

</div>

Hey, @JohanL 👋 That sounds frustrating. I see the [documentation](https://developers.hubspot.com/docs/api/crm/contacts#update-contacts) indicates this is possible. I’ll set up a really simple test and post back here.

Talk soon! — Jaycee

---

<div class="post-metadata">

**Author:** ![GMariani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gmariani/32/202712_2.png) [@GMariani](https://community.hubspot.com/u/GMariani)\
**Post date:** [May 21, 2024, 3:19pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/3 "2024-05-21T15:19:48Z")

</div>

Running into the same issue. I keep finding posts about how it’s supposed to be possible and then nothing comes of it. In face Jaycee said she was going to test this back in January of 2024 and nothing came of it ( [https://community.hubspot.com/t5/APIs-Integrations/Contacts-API-v3-Batch-Update-using-email-as-Unique-Id/td-p/904444](https://community.hubspot.com/t5/APIs-Integrations/Contacts-API-v3-Batch-Update-using-email-as-Unique-Id/td-p/904444) ). I would think HubSpot wouldn’t want folks to query all their contacts they want to update for the ID, and then hit the API again to now update said contacts. Seems like a giant waste of effort and resources. Hopefully Jaycee is able to figure out this issue.

---

<div class="post-metadata">

**Author:** ![CSewell1](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@CSewell1](https://community.hubspot.com/u/CSewell1)\
**Post date:** [September 18, 2024, 7:14pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/4 "2024-09-18T19:14:00Z")

</div>

[@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074), I double this

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 22, 2024, 8:14pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/5 "2024-05-22T20:14:24Z")

</div>

Hey y’all. I have an update — this is confirmed **not** possible.

I worked with the docs team to get the [documentation updated](https://developers.hubspot.com/docs/api/crm/contacts#update-contacts:~:text=To%20update%20contacts%20in%20batches%2C%20you%20can%20use%20the%20contacts%27%20record%20ID%20values%20(id).). Next, I need to track down the team that owns the endpoints tab examples and get that updated next. But we have our long-awaited conformation. I know this is not the answer we were hoping for, and I am grateful that the documentation won’t send anyone else on a wild goose chase using a method that isn’t possible.

Thank you for your patience.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![JohanL](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@JohanL](https://community.hubspot.com/u/JohanL)\
**Post date:** [May 23, 2024, 8:27am UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/6 "2024-05-23T08:27:45Z")

</div>

It’s indeed not what I hoped for but it’s good to have confirmation. Thank you for looking into it.

---

<div class="post-metadata">

**Author:** ![jonovirti](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jonovirti](https://community.hubspot.com/u/jonovirti)\
**Post date:** [July 24, 2024, 11:43pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/7 "2024-07-24T23:43:32Z")

</div>

I can’t get this to work anyway I try either. I am trying to use the [upsert feature](https://developers.hubspot.com/beta-docs/reference/api/crm/objects/contacts#post-%2Fcrm%2Fv3%2Fobjects%2Fcontacts%2Fbatch%2Fupsert) like [these folks](https://community.hubspot.com/t5/APIs-Integrations/Contact-batch-upsert-endpoint/td-p/1008345). The point of upsert is to create or update contacts but it apparently only works if you supply a hubspot ID (not email). Please tell me Hubspot, how am I supposed to get a hubspot ID for a contact that doesn’t exist yet? 😅

---

<div class="post-metadata">

**Author:** ![CSewell1](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@CSewell1](https://community.hubspot.com/u/CSewell1)\
**Post date:** [September 25, 2024, 6:20pm UTC](https://community.hubspot.com/t/batch-update-contacts-using-email-as-idproperty/107092/8 "2024-09-25T18:20:05Z")

</div>

@JohanL Try this using the **v1 APIs**. They are quite stable and still supported. The page itself quotes:

“Our APIs are in the [midst of a transition](https://developers.hubspot.com/blog/building-the-next-generation-of-hubspots-apis). As part of our effort to improve API consistency and completeness, we launched [the next generation of HubSpot’s API](https://developers.hubspot.com/docs/api/overview) in early 2020. **However, not every endpoint or API has been updated to the latest version, and our older endpoints are still stable and supported**.”

Use this v1 batch contacts endpoint:

[https://legacydocs.hubspot.com/docs/methods/contacts/batch\_create\_or\_update](https://legacydocs.hubspot.com/docs/methods/contacts/batch_create_or_update)

Use the following example request body

```lia-code-sample
[
 // assume existing email
 {
 "email": "test+old@hello.com",
 "properties": [
 {
 "property": "email",
 "value": "test+old@hello.com"
 },
 {
 "property": "firstname",
 "value": "User"
 },
 {
 "property": "lastname",
 "value": "Old Updated"
 }
 ]
 },
 // new email
 {
 "email": "test+new@hello.com",
 "properties": [
 {
 "property": "email",
 "value": "test+new@hello.com"
 },
 {
 "property": "firstname",
 "value": "User"
 },
 {
 "property": "lastname",
 "value": "New"
 }
 ]
 }
]

```

CC: [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) - I see a lot of users in the community suffering from the same issue. Maybe you can suggest them with using this.
