APIs & Integrations

przemyslawcelej
Participant

Is there a way to delete secondary email address via API?

Hi,

recently HubSpot introduced feature which allows contact to have multiple (secondary) emails, so now if contact (bound by cookie) refills any form with different email, its new email address is added as secondary (rather than just changing email to new - like it was in the past). Unfortunately this new behaviour damaged our integration

Can we somehow delete this secondary email address via API (for example by editing “identity-profiles” JSON) ?

The second question is, is there a way to disable this new feature on form or globally in HubSpot ?

Thank you.

8 Replies 8
tomas1
Member

Is there a way to delete secondary email address via API?

here is a Ruby/Rails solution https://gist.github.com/equivalent/9e3174a471b138401b420bff506ac09e

 

Only dependancy is HTTParty (no hubspot gem)

 

Uses hubspot v1 API endpoint "https://api.hubapi.com/contacts/v1/secondary-email/..." with "private apps token" (meaning it will work after Nov 2022)

0 Upvotes
beuner
Participant

Is there a way to delete secondary email address via API?

0 Upvotes
JerryReid
Contributor

Is there a way to delete secondary email address via API?

Here is how I think this should be designed. Instead of the option to allow for tracking (cookies) or not to be turned on or off to deal the effects of this standard behavior, there should be some options. For example:

 

1) Disregard new emails provided on previously cookied contacts.

2) Use new emails provided on previously cookied contacts as primary (default).

3) Use new emails provided on previously cookied contacts as secondary (default). I would want this since I use salesforce and we otherwise not have an easy way to register these secondary emails as our email mapping doesn't allow updates in SFDC of the primary email, but I would want to keep the secondary emails to help with future deduping.

4) Use new emails provided on previously cookied contacts as new contact and add to system static list which contacts were created via this process (similar to what is done with an import). This could aid in then determing when a merge should happen or whether to keep as a dupe.

 

Come to think of it, I think having a static list for each of these options makes sense. I still think even with all these added behavior having the API to manage emails is key.

 

I also think with the world of GDPR that there should be an option on how to deal with the subscription types. For example, should the subscription types set on the form update the contact regardless of what happens to the new email. In my oppinion, probably, unless you are going to default a email subsription popup from any form to show them what we currently have associated to the contact tied to the cookie and allow them to reset that opt-in on the new email address.

 

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Is there a way to delete secondary email address via API?

@przemyslaw.celej I know we just released the secondary email feature recently. Let me reach back to the right team on my side so I can get you the right answer.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Is there a way to delete secondary email address via API?

@przemyslaw.celej

At the moment secondary emails are not supported through the API.
There is also not a way to turn off the secondary email feature.

To answer your point in your first paragraph, The second form submission would become the primary email and not the secondary.

image

If you are experiencing a different result please reach out to support and see if they can help .

0 Upvotes
przemyslawcelej
Participant

Is there a way to delete secondary email address via API?

@pmanca

Thank you for pointing it out.

Is there any plan to add API for manipulating secondary email addresses ?
Or do you know any workaroud to create new independent contact with email address equal to secondary address of already existing contact ?

Also disabling this feature entirely would be a big help.

This is pretty important for us because currently we can’t operate on such “secondary” contacts (even mass emails aren’t send to secondary addresses !).

Regards.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Is there a way to delete secondary email address via API?

@przemyslaw.celej

There is a plan but I wouldn’t expect anything imminent as of today.

I’m not aware of any workaround since you cannot remove the contact’s secondary email via the API at the moment.

Do you mind expanding a bit on your use case as to why this is such a problem? I’d be happy to pass it along to Product for you.

0 Upvotes
przemyslawcelej
Participant

Is there a way to delete secondary email address via API?

@pmanca

Thank you for answer.

The problem with secondary emails is, that in our company HubSpot is also CRM and analytics tool, and it frequently happens that secondary email is NOT new email of the same client, but it is completely new client (different person with different phone number, living in different place) which just once filled some form using firend’s computer/phone. This secondary email is effectively not present in HubSpot.

@pmanca please inform me if API for editing secondary emails will be available (even in beta phase).

Thank you.