Is it possible to batch update contacts using email instead of id?

Hello

I am attempting to update a batch of contacts through the batch update API, but I only have their email addresses. While updating a single contact with the “email” idProperty works, it doesn’t seem to work when attempting to update contacts in bulk through the API.

I have consulted the documentation, but it does not mention any limitations on updating contacts in batches using only email addresses. Is there a way to accomplish this? Perhaps I am overlooking something?

Thanks!

Hey, @Almog :waving_hand: Thanks for reaching out. To your question, the documentation is unclear. My instinct is this isn’t possible when using the batch endpoint here —POST/crm/v3/objects/contacts/batch/update. I’ll make a request to get this document updated to be more explicit regarding the Batch endpoint.

Outside of that, you can use this endpoint and use email addresses. There are some details to be aware of when using this endpoint:

  • POST /contacts/v1/contact/batch/
  • Performance is best when batch size is limited to 100 contacts or fewer.
  • When using this endpoint, please keep in mind that any errors with a single contact in your batch will prevent the entire batch from processing.
  • Note: Changes made through this endpoint are processed asynchronously, so can take several minutes for changes to be applied to contact records.

Best,

Jaycee

Hey @Jaycee_Lewis, unfortunately, the docs still don’t have that distinction. Also, I would like to emphasize how valuable that change would be when developing with the HubSpot API.

My experiments via Postman confirm it is not possible to update HubSpot contacts via email address as a key via this endpoint: /crm/v3/objects/contacts/batch/update. I’m curious if there is timeline to improve this API to include the feature the legacy V1 API already supports. Thanks!

Hello Jaycee,

Assuming your request was sent out, is there an update on this since your request was sent?

There isn’t an update to the documentation CRM API | Contacts (hubspot.com)

The workaround is limited to small scale of request and is fragile with single point of failures, no resilience of error handling.

In the meantime, there are so many other developers/companies who rely on HubSpot API are suffering the ambiguity of the documentation. Much time was wasted by so many in their failed attempts of making it work.

It has been over half a year. When can the documentation be updated? When can it be made possible to bulk update of contacts using email address as unique value property?

Your help is much appreciated.

Richard

Hi just a friendly addition that the integration I am working on would benefit from being able to update using the email as the key. It would save having to fetch records from hubspot to get the ID before updating

You can consider using batch upsert in Hubspot using crm v3:
POST: https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert
Payload:

{
 "inputs": [
 {
 "properties": {
 "firstname": "Hubspot",
 "lastname": "BatchTesterNo1"
 },
 "id": "hubspotbatch1@email.com",
 "idProperty": "email"
 },
 {
 "properties": {
 "firstname": "Hubspot",
 "lastname": "BatchTesterNo2"
 },
 "id": "hubspotbatch2@email.com",
 "idProperty": "email"
 }
 ]
}