APIs & Integrations

JeremyD1
Participant

Update or create contacts (v3)

SOLVE

I am trying to hit an one api endpoint to batch update or create contacts using the email as a unique identifier. I am wondering if that is possible using API v3. This is to sync contacts from an external database.

0 Upvotes
1 Accepted solution
JeremyD1
Solution
Participant

Update or create contacts (v3)

SOLVE

I found out that I had additional requirements on how to update. I ended up doing a batch read to get current information for all emails. If information was returned for the email I was able to compare to current data record what needed updated. If there were updates for a read, I would do a batch update. At the very end of reading and updating, I used the https://api.hubapi.com/crm/v3/imports endpoint to do a bulk create. This proccess will hopefully work well for me since most of the time I need to create. The only downside is that I will be heavilly hitting the read and update bulk APIs.

Before I did implement it using only https://api.hubapi.com/crm/v3/imports. Bulk create and update did work as expected with the email as the property to match on an update. I didn't test if it would work with multiple updates in the same csv.

 

I managed to do my solution 100% in the v3 API since I didn't want to think about EOL of v1.

View solution in original post

12 Replies 12
JeremyD1
Solution
Participant

Update or create contacts (v3)

SOLVE

I found out that I had additional requirements on how to update. I ended up doing a batch read to get current information for all emails. If information was returned for the email I was able to compare to current data record what needed updated. If there were updates for a read, I would do a batch update. At the very end of reading and updating, I used the https://api.hubapi.com/crm/v3/imports endpoint to do a bulk create. This proccess will hopefully work well for me since most of the time I need to create. The only downside is that I will be heavilly hitting the read and update bulk APIs.

Before I did implement it using only https://api.hubapi.com/crm/v3/imports. Bulk create and update did work as expected with the email as the property to match on an update. I didn't test if it would work with multiple updates in the same csv.

 

I managed to do my solution 100% in the v3 API since I didn't want to think about EOL of v1.

webdew
Guide | Diamond Partner
Guide | Diamond Partner

Update or create contacts (v3)

SOLVE

Hi @JeremyD1 ,

Please use this api for create and update contacts:
https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/<email>/?hapikey=demo

Documentation link :
https://legacydocs.hubspot.com/docs/methods/contacts/create_or_update

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards. 

0 Upvotes
JeremyD1
Participant

Update or create contacts (v3)

SOLVE

Hey Dennis. In looking for a solution I stumbled on the following endpoint:

 

https://api.hubapi.com/crm/v3/imports

 

Is this a dead end for what I am trying to do? I am currently trying to save the things that are updated or new in my database to a csv then uploading it here. I am hoping the behavior for duplicates will be to update them.

 

I am still working through errors in my own testing, but I will take a different route if I hear it won't work.

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Update or create contacts (v3)

SOLVE

@JeremyD1 , I believe for your use case, that should do the trick.  The csv will be deduplicated and the properties that have been changed should be updated.

If I were you, I would run a test with a small batch of contacts with various property changes.  Just to confirm 😀

bengavin
Member

Update or create contacts (v3)

SOLVE

@dennisedson - I'm in a similar situation to the original poster, and want to use the Import endpoint.  I'd like to determine whether I need to do multiple 'sets' of updates for each unique set of updated properties or if the import will simply skip fields in the CSV that do not contain any data.  Essentially, we need to update many thousands of records on a daily basis and the current batch update limitations (10 records per batch) means that we cannot use the v3 batch endpoints.  We want behavior similar to the batch endpoint where a non-specified property isn't updated, but the only way to achieve this via the import API endpoints appears to be multiple import calls (one for each 'subset' of properties across a set of contacts that need importing).  Is this correct?

 

Thanks!

JeremyD1
Participant

Update or create contacts (v3)

SOLVE

Thanks for the help!

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Update or create contacts (v3)

SOLVE

@JeremyD1 

Short answer.  No

But this is one of the last items that is being worked on to finish the v3 version of this API.  Hopefully, will be completed sooner than later 🤞

 

CDean
Contributor

Update or create contacts (v3)

SOLVE

Any updates on this?

AirswiftRob
Contributor

Update or create contacts (v3)

SOLVE

Hi, is there a v3 version of this API call ready? Or should we continue using the legacy version?

RafaCorrea
Participant

Update or create contacts (v3)

SOLVE

@dennisedson , could you please update us regarding this API feature?
We were using the CreateOrUpdate Contact (Documentation link : https://legacydocs.hubspot.com/docs/methods/contacts/create_or_update) in many of our calls, and now we'll have to basically take that intelligence in our own system, doing a List and then, after receiving the reponse, make another API call Creating or Updating the Contact. 

 

This means that for every create/update we have to do, we'll have to do two API calls. 

It would be great to still have this single API call, could you please let us know if it's being developed?

PFriederich
Participant

Update or create contacts (v3)

SOLVE

@dennisedson any news on this? 

Ampl_CohortSync
Participant

Update or create contacts (v3)

SOLVE

Hi Dennis,

We are facing a similar situation as the original post. Would you mind me asking the progress about v3 version of this API?