HubSpot Email Validation and CRM Verification: API and Webhook Patterns

workerslab ·

Your SDRs are working a pipeline full of ghosts. About 10-25% of CRM records contain critical errors, and email addresses are the worst offenders. That’s not speculation. Gartner’s data quality research puts the annual cost of bad data at $15 million per company, and your reps are eating a slice of that every time they sequence a dead inbox.

The fix isn’t manual. Nobody’s going to export a CSV every Friday, upload it to a validator, and re-import the results. That lasts two weeks before someone skips it. HubSpot email validation, like any CRM verification, has to be baked in so bad emails get flagged the moment they enter the system and existing records get cleaned on a schedule.

Two patterns handle this: real-time verification on lead creation, and batch cleanup for your existing database. Here’s how to wire both into HubSpot, Salesforce, or any CRM with an API.

How Do You Add HubSpot Email Validation to a CRM?

HubSpot email validation runs through a workflow custom code action (Operations Hub Professional or higher) that calls an external verification API the moment a contact is created. The action checks the address, then writes the result back to two custom contact properties so your reps know whether to sequence the lead. For records you already hold, a scheduled job re-validates stale contacts in batches. No CRM custom-code support? A webhook middleware does the same job across HubSpot, Salesforce, and any other CRM.

Two Custom Fields Every CRM Needs

Before you touch a single workflow, add these fields to your contact object.

email_validation_status: A dropdown with four values: valid, invalid, risky, unknown. This tells your reps at a glance whether they should sequence a contact or skip it.

validated_at: A datetime field. Lists decay at roughly 2.1% per month according to HubSpot and Marketing Sherpa research. A “valid” status from eight months ago is meaningless. The timestamp lets you trigger re-validation on stale records.

In HubSpot, create these as custom contact properties under Settings > Properties. In Salesforce, add them as custom fields on the Contact or Lead object. Takes five minutes. Skip this step and you’ll have validation results with nowhere to land.

Pattern 1: Real-Time Verification on Lead Creation

A new contact enters your CRM. Before anyone wastes a sequence slot on it, you want to know if the email is real. The goal: validate the address within seconds of creation and stamp the result on the record.

HubSpot: Workflow with Custom Code

HubSpot’s workflow engine supports custom code actions (requires Operations Hub Professional or higher). You write JavaScript directly inside the workflow, which means you can call any external API.

Set the trigger to “Contact is created.” Add a custom code action that hits a validation endpoint, parses the response, and updates the two custom fields.

The code inside the action looks like this:

const axios = require("axios");

exports.main = async (event, callback) => {
  const email = event.inputFields["email"];

  const response = await axios.post(
    "https://api.truemail.io/v1/verify",
    { email },
    { headers: { Authorization: `Bearer ${process.env.TRUEMAIL_KEY}` } }
  );

  const result = response.data;

  callback({
    outputFields: {
      email_validation_status: result.status,
      validated_at: new Date().toISOString(),
    },
  });
};

Map the output fields to your custom properties in the next workflow step. Every new contact gets verified before your reps even see it.

One thing to watch: HubSpot custom code actions have a 20-second execution limit. MailCop’s single-address verification returns in under 3 seconds on average, so you’re fine. But if you’re calling a provider with slow SMTP checks on catch-all domains, that timeout can bite you. Build in a fallback that sets the status to “unknown” if the call times out. Don’t block the lead from entering the system.

Salesforce: Flow Builder with HTTP Callout

Salesforce Flow Builder added HTTP Callout support, which means you can hit external APIs without writing Apex. Create a Record-Triggered Flow on the Contact or Lead object, set it to fire on create.

Add an HTTP Callout action. Point it at your validation endpoint. Pass the email field from the triggering record. Parse the JSON response and use an Update Records element to write the validation status and timestamp back to the record.

For teams comfortable with code, an Apex trigger gives you more control:

trigger ValidateEmailOnCreate on Lead (after insert) {
    for (Lead lead : Trigger.new) {
        EmailValidationService.validateAsync(lead.Id, lead.Email);
    }
}

The validateAsync method queues a callout (Salesforce doesn’t allow synchronous HTTP calls from triggers). It hits the API, parses the result, and updates the record. Same outcome, different path.

The Webhook Pattern (Any CRM)

What if your CRM doesn’t support custom code actions? Or what if you want a single middleware layer that works across HubSpot, Salesforce, Pipedrive, and whatever you migrate to next year?

The webhook pattern: CRM fires a webhook on new contact creation. Your middleware receives it, calls the validation API, and pushes the result back to the CRM via its API.

The flow looks like this:

  1. New contact created in CRM
  2. CRM sends webhook to your middleware endpoint
  3. Middleware extracts the email, calls validation API
  4. Validation API returns the result
  5. Middleware updates the CRM record via API

You can host this on a simple Express server, a Cloudflare Worker, or a serverless function. The email validation microservice post walks through building the middleware layer with Node.js and Redis.

Pattern 2: Batch Cleanup on a Schedule

Real-time verification catches new leads. But what about the 50,000 contacts already in your CRM? And what about records that were valid six months ago but aren’t anymore?

You need a scheduled job that sweeps your database, re-validates stale records, and updates their status. Think of it as a nightly janitor for your pipeline.

How Often to Run It

B2B email data decays at about 2% per month. That means a contact validated 90 days ago has roughly a 6% chance of being dead. For most teams, a weekly or biweekly sweep of records where validated_at is older than 30 days strikes the right balance between freshness and API costs.

HubSpot: Scheduled Workflows + Bulk API

Create a workflow triggered on a date property. Set it to enroll contacts where validated_at is more than 30 days ago (or is empty). Use the same custom code action from Pattern 1, but now it’s running against a filtered list instead of individual creates.

For larger databases, HubSpot’s API supports batch operations. Pull contacts in pages, validate them through MailCop’s bulk validation endpoint, and push results back. This runs outside HubSpot’s workflow engine, typically as a cron job on your server.

Salesforce: Batch Apex

Salesforce was built for batch processing. Batch Apex lets you query millions of records and process them in chunks of 200.

global class EmailValidationBatch implements Database.Batchable<SObject>, Database.AllowsCallouts {
    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator(
            'SELECT Id, Email FROM Lead WHERE Validated_At__c < LAST_N_DAYS:30'
        );
    }

    global void execute(Database.BatchableContext bc, List<Lead> leads) {
        List<String> emails = new List<String>();
        for (Lead l : leads) { emails.add(l.Email); }

        Map<String, String> results = EmailValidationService.validateBatch(emails);

        for (Lead l : leads) {
            l.Email_Validation_Status__c = results.get(l.Email);
            l.Validated_At__c = Datetime.now();
        }
        update leads;
    }

    global void finish(Database.BatchableContext bc) {}
}

Schedule it with System.schedule('Email Validation', '0 0 2 ? * SUN', new EmailValidationBatchScheduler()) to run every Sunday at 2 AM. Your reps show up Monday to a clean pipeline.

For a deeper comparison of when to validate one-at-a-time versus in bulk, see the real-time vs bulk validation breakdown.

The No-Code Path: Zapier and Make

Not every team has a developer who can write Apex or deploy a webhook middleware. Zapier and Make handle both patterns without code.

In Zapier, the trigger is “New Contact” in your CRM. The action calls a validation API using the Webhooks by Zapier module (POST request with the email as the body). A second action updates the CRM record with the result. Total setup time: about 15 minutes.

Make (formerly Integromat) works the same way but gives you more control over error handling. You can add router modules that branch based on the validation result, automatically tagging invalid contacts and removing them from active sequences.

Zapier processes over 1.5 billion automated tasks monthly and offers a 99.9% uptime SLA for enterprise plans. For teams running under 10,000 validations a month, the no-code path is the right call. Save developer time for product work.

The tradeoff? Cost and speed. Zapier charges per task, and each validation requires multiple tasks (trigger + API call + CRM update). At high volumes, a direct API integration costs a fraction of the no-code approach.

Error Handling: When the Validation API Is Down

Your validation provider will have downtime. Every API does. The question is what happens to your leads when it does.

The wrong answer: block lead creation until validation succeeds. Your sales team stops getting new contacts because a third-party service is having a bad morning. That’s not acceptable.

The right answer: set the status to “unknown” and queue the record for retry. Your lead enters the CRM immediately. A background job picks up all “unknown” records every 15 minutes and attempts validation again. After three failures, it stays “unknown” and gets flagged for manual review.

In HubSpot, this means adding a branch in your workflow. If the custom code action fails (timeout, 5xx error, network issue), set email_validation_status to “unknown” and move on. A separate scheduled workflow retries unknowns daily.

In Salesforce, the Apex queueable pattern handles retries natively. Queue the validation callout, catch failures, re-queue with exponential backoff.

Never let a vendor outage stop your pipeline. Leads come first. Validation catches up.

What to Do With the Results

Validation data sitting in custom fields is useless unless you act on it. Here’s how the status field changes your workflow.

Contacts marked “invalid” get excluded from all outbound sequences. Period. Sending to known-bad addresses tanks your sender score and burns sender domains. One bad campaign above 5% bounce rate and Google starts throttling you.

Contacts marked “risky” (catch-all domains, full inboxes) go into a separate segment. Sequence them from your strongest domains at lower daily volumes. Monitor bounce rates from that segment independently.

Contacts marked “unknown” (validation API was down, or the result was inconclusive) get queued for re-validation. Don’t sequence them until you get a definitive answer.

SDRs waste 27% of their selling time on bad data according to industry research. That’s more than a full day per week chasing dead ends. Automated verification gives them that time back. If your team runs 50 sequences a week and 15% of contacts are invalid, you’re reclaiming roughly 7-8 hours of SDR capacity per week. Every week.

For the full picture on protecting your outbound reputation, the cold email deliverability playbook covers domain rotation, warm-up schedules, and bounce rate thresholds alongside validation.

Choosing Your Integration Path

Pick based on your team’s technical capacity and volume.

If you have developers and more than 10,000 contacts a month, go with direct API integration. Custom code in HubSpot, Apex triggers in Salesforce, or a webhook middleware that works across CRMs. Lowest per-validation cost, most flexibility, full control over retry logic.

If you don’t have developers (or they’re busy shipping product), Zapier or Make gets you 80% of the value in an afternoon. Set it up, forget it, revisit when volume outgrows the no-code tier.

If you’re running both HubSpot and Salesforce (it happens more than you’d think during migrations), the webhook middleware pattern is your best bet. One validation layer, two CRM integrations. The middleware becomes your source of truth for email quality regardless of which CRM holds the record.

Whatever path you choose, the two custom fields stay the same. The validation status and timestamp are your foundation. Build the automation around them, not the other way around.