Skip to content

// guide

How to verify and enrich form leads before they reach HubSpot or Salesforce

For revOps, marketing-ops and growth engineers who own the form-to-CRM pipeline · Updated · 7 min read

Our CRM is full of fake leads, typo'd addresses and vendor pitches, and sales has stopped trusting what's in it.

To verify and enrich form leads before they reach HubSpot or Salesforce, send your form's webhook to a small serverless function instead of straight to the CRM. The function calls pingutil twice: POST /v1/verify to check the mailbox, and POST /v1/lookup to get the domain category and company profile. Leads with an invalid address go to a review log; everything else is written to the CRM with its verification status, category and company fields already filled in, so routing and scoring rules in the CRM have data to work with from the first second.

This is the guide for the person who owns the pipe between the form and the CRM. The pattern works with any form tool that can send a webhook.

What this problem costs you

A CRM is only as useful as the worst data you let into it:

  • Reps stop trusting the CRM. After enough calls to fake numbers and emails to test@test.com, people start keeping their own spreadsheets. That's the real cost: the system of record stops being one.
  • Bounces on the first touch. A lead who typed gmial.com gets a welcome sequence that bounces. Your sending domain takes the hit, and the lead never hears from you.
  • Workflows fire on junk. Assignment rules, lead-score updates, Slack alerts and sequence enrollments all run on bad records before anyone can stop them.
  • Manual research on every lead. Without company data on the record, reps open a browser tab for each new lead to figure out who it is.
  • Reporting is wrong. Lead-source and conversion reports count fake leads as real pipeline.

Keeping CRM data clean from the email domain has more on the downstream effects.

How pingutil solves it

1. Get an API key

Sign in at the dashboard and create a key (it starts with pk_live_). Store it as a secret in whatever runs your function. You'll also need a CRM credential: a HubSpot private app token with contact write scope, or a Salesforce connected app.

2. Point the form webhook at your function

Most form tools (Typeform, Tally, Webflow, your own site) can post a JSON payload to a URL on submit. Send it to your function instead of directly to the CRM. If your form tool signs webhooks, check the signature first; filtering fake form leads with a webhook shows how for a couple of common tools.

3. Verify the mailbox

Call POST https://pingutil.com/v1/verify with {"email": "..."}. It runs syntax, the disposable list, DNS/MX and an SMTP RCPT TO check (no message is sent) plus a catch-all probe. You get back status (valid, invalid, risky, unknown), a reason, a 0 to 100 score and did_you_mean for likely typos.

4. Enrich the domain

Call POST https://pingutil.com/v1/lookup with {"input": "..."}. You get category and verdict for every address, and a company object (name, industry, employee_size_estimate, headquarters, LinkedIn URL and more) for company domains. Skip this call for invalid leads.

5. Write the lead with the results

Create the contact or lead in the CRM with verification and enrichment stored in custom fields. Then build CRM-side rules on those fields: route company leads to sales, keep risky leads out of automated sequences, and so on.

Decision table: response field to CRM action

Field and value CRM action
verify status: "invalid" Don't create. Write to a review log with reason
verify did_you_mean not null Don't auto-correct. Create with a "possible typo" note, or ask on the form
lookup verdict.is_spam: true Don't create. Review log
verify status: "valid" Create, eligible for sequences
verify status: "risky", reason: "accept_all" Create, flag "unconfirmed mailbox", no automated sequences
verify status: "risky", reason: "role_based" Create, flag "shared inbox"
verify status: "unknown" Create, flag for re-verification
lookup category: "company" Fill company name, industry, size, country, LinkedIn URL; route to sales
lookup category: "free" or "isp" Create as personal lead; route to self-serve or nurture
lookup verdict.reason: "sales_outreach" Create in a low-priority view, or skip; often a vendor
lookup company.confidence below 0.5 Fill only the company name, leave size and industry blank
Either call fails Create the lead with status "unverified". Never drop a lead because a check failed

The last row is the rule that keeps marketing on your side. A verification outage should never mean a lost lead.

Complete example: a serverless function for HubSpot

This is written for Cloudflare Workers, but it uses only the standard fetch, Request and Response APIs, so it ports to most serverless platforms with small changes. It uses HubSpot's create contact endpoint (POST /crm/v3/objects/contacts).

Before you deploy it, create these custom contact properties in HubSpot (single-line text is fine): email_status, email_reason, email_domain_category, company_size. company, industry and country are standard HubSpot contact properties.

// worker.js  (Cloudflare Workers module syntax)
// Secrets: PINGUTIL_KEY (pk_live_...), HUBSPOT_TOKEN (private app token)
const PINGUTIL = 'https://pingutil.com/v1';

async function pingutil(env, path, body) {
  try {
    const res = await fetch(`${PINGUTIL}${path}`, {
      method: 'POST',
      headers: {
        authorization: `Bearer ${env.PINGUTIL_KEY}`,
        'content-type': 'application/json',
      },
      body: JSON.stringify(body),
      signal: AbortSignal.timeout(25000),
    });
    return res.ok ? await res.json() : null;
  } catch {
    return null;
  }
}

function properties(email, form, check, info) {
  const props = {
    email,
    firstname: form.first_name ?? '',
    lastname: form.last_name ?? '',
    email_status: check?.status ?? 'unverified',
    email_reason: check?.reason ?? '',
    email_domain_category: info?.category ?? '',
  };
  const c = info?.company;
  if (c?.name) props.company = c.name;
  if (c && (c.confidence ?? 0) >= 0.5) {
    if (c.industry) props.industry = c.industry;
    if (c.employee_size_estimate) props.company_size = c.employee_size_estimate;
    if (c.headquarters?.country) props.country = c.headquarters.country;
  }
  return props;
}

export default {
  async fetch(request, env) {
    if (request.method !== 'POST') return new Response('method not allowed', { status: 405 });
    const form = await request.json().catch(() => ({}));
    const email = String(form.email ?? '').trim();
    if (!email) return Response.json({ error: 'email required' }, { status: 400 });

    const check = await pingutil(env, '/verify', { email });
    if (check?.status === 'invalid') {
      console.log('rejected lead', JSON.stringify({ email, reason: check.reason }));
      return Response.json({ created: false, reason: check.reason });
    }

    const info = await pingutil(env, '/lookup', { input: email });
    if (info?.verdict?.is_spam) {
      console.log('rejected lead', JSON.stringify({ email, reason: info.verdict.reason }));
      return Response.json({ created: false, reason: info.verdict.reason });
    }

    const res = await fetch('https://api.hubapi.com/crm/v3/objects/contacts', {
      method: 'POST',
      headers: {
        authorization: `Bearer ${env.HUBSPOT_TOKEN}`,
        'content-type': 'application/json',
      },
      body: JSON.stringify({ properties: properties(email, form, check, info) }),
    });
    if (!res.ok) {
      // e.g. the contact already exists; log and hand off to your update path
      console.log('hubspot error', res.status, await res.text());
      return Response.json({ created: false, hubspot_status: res.status }, { status: 502 });
    }
    return Response.json({ created: true, status: check?.status ?? 'unverified' });
  },
};

In production, replace the console.log lines with a write to a real review store (a spreadsheet, a database table or a Slack channel) so someone actually looks at rejected leads.

Using Salesforce instead

The same function works with Salesforce: replace the HubSpot call with a POST to /services/data/vXX.X/sobjects/Lead/ on your instance, as described in the Salesforce REST API guide to creating records. Leads require LastName and Company by default, so fill Company from company.name and fall back to a placeholder like the domain for personal addresses. Create custom fields for the verification status and category first. Salesforce lead email verification covers an Apex-based variant that runs inside Salesforce itself.

Edge cases and limits

  • Verification takes time. The mailbox check talks to the recipient's mail server, and slow servers can take several seconds. Answer the form tool quickly if it has a short webhook timeout: some platforms retry when you're slow, which can create duplicates. If yours does, queue the work and process it a moment later.
  • Budgets. On the Free plan an account verifies 300 addresses a day and 3,000 a month (API and dashboard combined), makes 2,000 lookups a day and 30,000 a month, and builds 50 fresh company profiles a day and 500 a month (cached profiles don't count). Over the verification budget, /v1/verify returns 429 quota_exceeded; the function above treats that as "unverified" and still creates the lead. For most inbound forms, these numbers are comfortable; for a high-volume consumer signup form, verify only the leads that matter to sales.
  • Catch-all and unknown are not verdicts. Catch-all domains come back risky / accept_all, never valid, and servers that greylist or block probes come back unknown. Keep those leads; just keep them out of automated sequences until they engage. Catch-all email domains explains why.
  • Company profiles can be wrong. They're produced by an LLM reading the company homepage and validated before storage, and they include a confidence value. For small or ambiguous companies, size and industry can be off. The example only writes firmographics when confidence is 0.5 or higher.
  • No webhooks or CRM app from pingutil. There's no native HubSpot or Salesforce integration and no SDK package. The function above is the integration; it's small enough to own.
  • Duplicates are the CRM's job. HubSpot treats email as a unique contact identifier, so creating an existing contact fails. Decide whether your function should update the existing record instead, and handle that error path explicitly.

Next step

Sign in at the dashboard to create an API key, deploy the function, and point a test copy of your form at it. Field definitions for both endpoints are in the API reference. If you also want leads sorted by fit before a rep sees them, add the point model from qualifying B2B leads by email, or see the CRM enrichment use case for the bigger picture.

Questions people ask

Why verify leads before they enter the CRM instead of cleaning the CRM later?
Once a bad lead is in the CRM it triggers workflows, gets assigned to a rep and may be enrolled in a sequence before anyone notices. Checking at the door is one function call per lead; cleaning later means finding and undoing everything the bad record already touched.
Do I need both email verification and enrichment?
They answer different questions. Verification tells you whether the mailbox exists. Enrichment tells you what kind of domain it is and, for companies, who they are. Many teams verify every lead and enrich only those that pass.
What happens to leads whose email can't be verified?
Write them to the CRM with their status so a person can decide. Unknown usually means the mail server wouldn't answer right now, and risky often means a catch-all domain. Both can be real buyers, so only invalid addresses should be kept out.