The moment it happens
Remove a list of contacts from HubSpot
Send a list of email addresses and those contacts are archived, with a count of how many were removed.
- Runs
- The moment it happens
- Apps
- HubSpot
- AI
- Not needed
- Access
- crm.objects.contacts.write
Send this to your assistant
Create a ClickRuntime automation: give me a link I can send a CSV of email addresses to. Delete those contacts in HubSpot and email me how many were removed.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Cleaning a HubSpot database is a job nobody wants. After a GDPR erasure batch, a bounced-email sweep, a list of competitors that signed up for a webinar or a trade-show import that went wrong, someone has a spreadsheet of 800 email addresses to remove. Searching for each one in the UI and clicking delete takes the better part of a day, and a mis-click removes the wrong person. Meanwhile, contacts who asked to be removed continue to get emails.
You send a list of email addresses to a private link. They are parsed, each is looked up to find its contact ID, the contacts are archived in batches, and you get an email with the number removed and any addresses that were not found.
It suits marketing operations, privacy officers and anyone who handles removal lists in bulk.
What you get out of it
Erasure requests are met on time
Privacy rules give you a limited period to act on a deletion request. A batch process helps you meet that window without a day of manual clicking. Meeting the deadline protects the company, and it also shows contacts their request is taken seriously.
Clean data improves deliverability
Removing bounced and invalid contacts lowers bounce rates and protects your sender reputation, which keeps campaigns reaching real inboxes. Fewer hard bounces also protect your sending domain, which keeps important emails reaching people for years.
Contact counts drop to what you pay for
HubSpot pricing for marketing contacts depends on how many you hold. Clearing out dead contacts can reduce the tier you pay for. Clearing out stale records can lower the bill and make reports about your real audience more meaningful.
Mistakes are less likely
Matching by exact email address avoids the wrong-person errors that happen when hundreds of rows are handled by hand. Precise matching keeps the cleanup safe, and the confirmation tells you which entries did not match and need review.
A confirmation you can keep
The count of removed and unmatched addresses is emailed to you, giving a simple record that the request was carried out. That record is useful if a privacy team or a regulator later asks you to show that a request was handled.
How it works
What happens, step by step
When you send ClickRuntime a list of email addresses, the automation reads every address in it.
It looks up the matching contact in HubSpot for each one.
The matching contacts are archived in batches.
You get an email with how many addresses were received and how many contacts were removed.
Before it runs live
- Connect HubSpot
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other HubSpot steps into one automation
Under the hood
The code that runs this automation
import csv, io, re
from clickruntime import on_event, credentials, http, notify
API = "https://api.hubapi.com/crm/v3/objects/contacts"
@on_event
def handle(event):
text = event.body or ""
emails = sorted({c.strip().lower() for row in csv.reader(io.StringIO(text)) for c in row
if re.match(r"[^@\s]+@[^@\s]+\.\w+", c.strip())})
headers = {"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}
ids = []
for i in range(0, len(emails), 100):
found = http.post(f"{API}/search", headers=headers, json={"limit": 100, "filterGroups": [{"filters": [
{"propertyName": "email", "operator": "IN", "values": emails[i:i + 100]}]}]}).json()["results"]
ids += [c["id"] for c in found]
for i in range(0, len(ids), 100):
http.post(f"{API}/batch/archive", headers=headers,
json={"inputs": [{"id": cid} for cid in ids[i:i + 100]]}).raise_for_status()
notify.email_me(f"Removed {len(ids)} HubSpot contacts", f"{len(emails)} emails received, {len(ids)} matching contacts deleted.")
return {"emails": len(emails), "deleted": len(ids)}FAQ
Common questions
Are the contacts permanently deleted?
What happens to addresses that are not in HubSpot?
Is there a limit on how many emails I can send at once?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Add new leads to HubSpot without duplicates
Leads from your forms, bookings and shop become HubSpot contacts, matched by email so nobody is added twice.
See how it worksLog call summaries in HubSpot with a follow-up task
After a call, the contact gets a short summary as a note and a follow-up task is waiting for you.
See how it worksGet a weekly CSV of your HubSpot contacts
A full export of your contacts arrives in your inbox every week, ready to open in a spreadsheet.
See how it worksKeep exploring
Set up “Remove a list of contacts from HubSpot” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.