• Créditos da HubSpot: Desbloqueie ferramentas poderosas para o crescimento

    Dúvidas?

Bulk Delete Emails logged

ROlson

You should have the ability to bulk delete emails logged to the CRM. 

 

74 Comentários
AShapiro16
Membro

We would also like to be able to bulk delete, as previous entries should not be visible for all and we no longer want them on record. Is this something you are building or that's in cue?

Status atualizado para: Being Reviewed
hroberts
Equipe de Produto da HubSpot

Hi everyone! I am updating this idea to Being Reviewed as we consider if we'll be able to deliver it this year.

TedLucidi
Participante

Tech support suggested hiring a developer to use the Search and Engagements APIs to delete these. Has anyone doe this?

andrew19
Colaborador(a)

Hi Aknight

We have received this notification from Hubspot

 

Your CONTACT_TO_TICKET association has a maximum limit of 10000 associated TICKETs per CONTACT. You will no longer be able to associate additional TICKET records to the impacted CONTACT record(s) without reducing your current usage.
The following CONTACT objects have reached 80% usage of CONTACT_TO_TICKET associations

 

We have reviewed the associated record, we have over 5 years of data being held and we want to be able to bulk delete everything older than 2 years to reduce the size of the record.

 

I am amazed there is no capability to do this bulk delete. We do not receive that many support tickets so we are struggling to understand how a large organisation can use the support function.

 

It would be great if HubSpot could provide a function to undertake a bulk delete within a contact record.

Thanks

Andrew

RCarroll
Membro


TedLucidi We had a similar issue and the code to delete the engagements was easy enough but getting the list of engagements only between internal users was a bit trickier as we have multiple email domains within our company. I was able to export an engagements report and then used Excel to identify rows (engagements) with only internal email addresses. I then exported the filtered engagement ids only into a text file and ran the following python script. Note you will need to make changes to include your own API Key and also if you use different engagement file name.


 

import requests

class HubSpotAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://api.hubapi.com/engagements/v1/engagements"

    def delete_engagement(self, engagement_id):
        url = f"{self.base_url}/{engagement_id}"
        headers = {"Authorization": f"Bearer {self.api_key}"}

        response = requests.delete(url, headers=headers)

        if response.status_code == 204:
            print(f"Engagement with ID {engagement_id} deleted successfully.")
        else:
            print(f"Failed to delete engagement with ID {engagement_id}. Error: {response.text}")

if __name__ == "__main__":
    # Replace with your HubSpot API key
    api_key = "YOUR_API_KEY"

    # Read engagement IDs from a text file (one ID per line)
    with open("engagement_ids.txt", "r") as file:
        engagement_ids = [line.strip() for line in file]

    hubspot_api = HubSpotAPI(api_key)

    for engagement_id in engagement_ids:
        hubspot_api.delete_engagement(engagement_id)
​

 


I also created another python script to check to confirm that the engagement list are deleted. You may want to run this just to confirm that everything is cleared out.

 

import requests

class HubSpotAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://api.hubapi.com/engagements/v1/engagements"

    def check_engagement_exists(self, engagement_id):
        url = f"{self.base_url}/{engagement_id}"
        headers = {"Authorization": f"Bearer {self.api_key}"}

        response = requests.get(url, headers=headers)

        if response.status_code == 200:
            print(f"Engagement with ID {engagement_id} exists in HubSpot.")
        else:
            print(f"Engagement with ID {engagement_id} does not exist in HubSpot.")

if __name__ == "__main__":
    # Replace with your HubSpot API key
    api_key = "YOUR_API_KEY"

    # Read engagement IDs from a text list (one ID per line)
    with open("engagement_ids.txt", "r") as file:
        engagement_ids = [line.strip() for line in file]

    hubspot_api = HubSpotAPI(api_key)

    for engagement_id in engagement_ids:
        hubspot_api.check_engagement_exists(engagement_id)

 

 

TedLucidi
Participante

RCarroll,

I cannot thank you enough. Your solution, with very slight modifications, worked as epected. Believe it or not, I never wrote anything in python, either! Never even used it. I am doing the happy dance right now! Don't look, cuz it's not pretty, but I don't care. Mark this as solved, for me at least! Very grateful.

 

Thanks again!

RCarroll
Membro
Glad to hear it. We found over 10,000 internal emails and it would have taken months to manually clean these. Enjoy your dance. Rob
BoFleming
HubSpot Employee

+1 needed ASAP

LCLaukkanen
Colaborador(a) | Parceiro Diamante

Agreed! No more reasons to get data via API!

TStaelens7
Membro

@hroberts, Any updates on this ticket?

hroberts
Equipe de Produto da HubSpot

Hi @TStaelens7! We're planning our next quarter right now, so I should hopefully have an update to share in a few weeks 🙂 

glebs
Membro

Would be euite useful, though there is an API workaround so not a super priority.

Status atualizado para: In Planning
hroberts
Equipe de Produto da HubSpot

Hi everyone! I'm very pleased to share that a solution for bulk management of email activities, including deleting, is In Planning! Stay tuned for updates

andrew19
Colaborador(a)

Hi Hannah

Perfect 

Please keep me posted.

Thanks

Andrew

LCoussens
Membro

This is a definite requirement. We are now in the quarter that it is promised so some timelines on the activation of this concept would be greatly appreciated @hroberts 

LiamJennings22
Membro

I would also be very interested to hear if there are any updates on this solution. We have a use case on our hands where this would be so helpful! 

kfavaloro
Participante

Is this in beta yet?

KPak
Colaborador(a) | Parceiro Elite

If anyone needs to add/update or delete associations/activities from records, an Integration Glue workflow action allows you to do this. You can install it via the App Marketplace!

KPak_0-1729029215277.png

 

Status atualizado para: In Beta
hroberts
Equipe de Produto da HubSpot

Hello all! I'm so excited to announced we have a Private Beta for the Emails index page, which will allow you to perform bulk actions, such as deletes, on email engagements. If you are interested in helping us test this out, you can request access here: https://app.hubspot.com/l/product-updates/?update=13961217 . We are prioritizing the requests of customers who currently need to perform bulk deletes. If you are in that position, please send me a message here on the community so we can connect about your use case and get you access 🙂 

andrew19
Colaborador(a)

Hi Hannah

I am pleased there is now a beta option available.

Prior to my post earlier this year, I have just been notified our Support inbox is reaching the 80% watermark and we need to undertake another bulk delete.

It would be great to try your beta release to resolve this.

I have requested the trial and would appreciate your assistance in gaining access to the beta trial.

Thanks for your help

Cheers

Andrew