Skip to content
B2BenrichA ContactLevel company

Inbound lead enrichment: route form fills to the right rep

Enrich a form fill from its email domain, score it for fit and route it to the right rep in seconds, without asking visitors for more fields.

Dag Holmen · Updated · 5 min read

View as Markdown

Inbound lead enrichment fills in what your form didn't ask for. A visitor types a work email, and before the thank-you page loads you know their company, its industry, its headcount and where it's based. That's enough to score the lead for fit and hand it to the right rep while the person is still thinking about the problem.

With B2Benrich, the core of it is one call. Take the domain from the email, send it to POST /v1/enrich/companies/domain-to-company, and route on what comes back. This guide walks the whole path from form submit to rep alert, including the leads that don't enrich.

The flow

  1. A visitor submits the form.
  2. You take the domain from their email and skip free mail providers.
  3. You enrich the company from the domain.
  4. You score it for fit.
  5. You route it: existing account owner first, then territory and size, then round robin.
  6. The rep gets an alert with the context attached.

Run steps 2 to 6 right after the submit, in the same handler or a queue job that picks it up at once. Speed to lead is the point of inbound: the person asked for help a minute ago, and a nightly batch loses that moment.

Step 1: Get the domain, skip free mail

const FREE_MAIL = new Set([
  'gmail.com', 'googlemail.com', 'yahoo.com', 'outlook.com', 'hotmail.com',
  'live.com', 'icloud.com', 'me.com', 'aol.com', 'proton.me', 'protonmail.com'
]);

function domainFromEmail(email = '') {
  const domain = (email.split('@')[1] || '').trim().toLowerCase();
  return domain && !FREE_MAIL.has(domain) ? domain : null;
}

Two pitfalls. Mail from eu.acme.com belongs to acme.com, so reduce subdomains with a public suffix library. Dropping the first label turns acme.co.uk into co.uk. And no free-mail list is complete: add local providers for the countries you sell into.

Step 2: Enrich the company

curl --request POST \
  --url https://api.b2benrich.com/v1/enrich/companies/domain-to-company \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --data '{ "input": "acme.com" }'

A match returns the company record (fictional values):

{
  "status": "found",
  "company_id": "123456",
  "data": {
    "name": "Acme",
    "domain": "acme.com",
    "industry": "Software Development",
    "hq_country": "United States",
    "employees_range": "201-500",
    "revenue_range": "$25M-$50M"
  }
}

Store the company_id on the lead. The company enrichment API guide covers every field. If you also want the person's title and LinkedIn URL, look them up by name and domain with POST /v1/search/first-last-domain.

Step 3: Score fit

Fit answers one question: is this the kind of company we sell to? Keep the score simple enough that a rep can read why a lead got it.

CheckFieldPoints
Headcount in your target bandsemployees_range40
Industry you sell toindustry30
Country you coverhq_country30

Keep fit separate from behavior. A great-fit company reading a blog post and a poor-fit company asking for a demo need different handling, and one blended score hides that. When you're ready to add research activity, intent lead scoring shows how to layer it on.

Step 4: Route to the right rep

Apply the rules in order:

  1. Existing owner. If the domain matches an account in your CRM, the account owner gets the lead.
  2. Territory. Map hq_country (and hq_state, if you split the US by region) to a team.
  3. Segment. Split by employees_range into mid-market and enterprise, or whatever bands you use.
  4. Round robin. Within the team, the next rep in line gets it.

Here's the handler. crm and notify stand in for your CRM client and whatever alert your reps watch:

const BASE = 'https://api.b2benrich.com';
const headers = { 'Content-Type': 'application/json', 'X-Api-Key': process.env.B2BENRICH_KEY };

const TEAMS = {
  'na-enterprise': ['priya', 'sam'],
  'na-midmarket': ['lee', 'ana', 'tom'],
  emea: ['jonas', 'ines'],
  triage: ['sdr_1', 'sdr_2']
};
const NA = new Set(['United States', 'Canada']);
const EMEA = new Set(['United Kingdom', 'Germany', 'France', 'Netherlands']);
const pointer = {}; // store this in your database in production

const headcount = (range = '') => parseInt(range.replace(/,/g, ''), 10) || 0; // '201-500' -> 201

function pickTeam(c) {
  if (!c) return 'triage';
  if (EMEA.has(c.hq_country)) return 'emea';
  if (NA.has(c.hq_country)) return headcount(c.employees_range) >= 1001 ? 'na-enterprise' : 'na-midmarket';
  return 'triage';
}

function nextRep(team) {
  pointer[team] = ((pointer[team] ?? -1) + 1) % TEAMS[team].length;
  return TEAMS[team][pointer[team]];
}

async function enrichCompany(domain) {
  const res = await fetch(`${BASE}/v1/enrich/companies/domain-to-company`, {
    method: 'POST', headers, body: JSON.stringify({ input: domain }),
    signal: AbortSignal.timeout(5000)
  }).catch(() => null);
  return res?.ok ? (await res.json()).data ?? null : null;
}

async function routeLead(lead) {
  const domain = domainFromEmail(lead.email);
  const company = domain ? await enrichCompany(domain) : null;
  const account = domain ? await crm.findAccountByDomain(domain) : null;
  const owner = account?.ownerId ?? nextRep(pickTeam(company));
  await crm.createLead({ ...lead, domain, company, owner, enrich_status: company ? 'found' : 'not_found' });
  await notify(owner, lead, company);
}

Make the alert do the research: company, size, industry, country, fit score and what the person asked for, so the rep can reply without opening five tabs. For a strong-fit demo request, a call can beat a reply. The phone number API guide covers getting the number.

Step 5: Shorten the form

Once enrichment fills in company, size and industry, stop asking for them. Every field you remove is one less reason to leave the page, and enriched values are more consistent than a visitor's guess from a dropdown.

Keep the questions only the visitor can answer: what they're trying to do, their timeline, how they heard about you. If enrichment misses, ask for the company name on the thank-you page instead of putting the field back on the form for everyone.

Handle the leads that don't enrich

Don't build logic on one exact status string. Treat a response with no data as not found.

  • Free mail. Don't drop these leads. Route them to triage and ask for a company on the thank-you page. POST /v1/search/company-name can resolve a name to a domain; check fuzzy matches by hand.
  • Domain not found. Route to triage, store not_found with a date, and retry in your scheduled CRM enrichment job.
  • Slow or failed calls. Set a short timeout and route on what you have. A lead in triage now beats a perfectly routed lead tomorrow.
  • Junk. Competitors, students, your own staff. Keep a domain blocklist and route them away from reps.

There's no reason to filter before you enrich. B2Benrich is unlimited API usage for $500 a month, so enriching every form fill costs the same as enriching only the good ones.

Frequently asked questions

What is inbound lead enrichment?
Adding company and contact details to a lead the moment it comes in, using data from an outside source. Usually you start from the work email on a form, look up the company from its domain, and use the result to score and route the lead.
How do I enrich a lead from just an email address?
Take the part after the @, skip free mail providers like gmail.com, and send the domain to a company enrichment endpoint. With B2Benrich that’s POST /v1/enrich/companies/domain-to-company, which returns the company’s industry, headcount range, revenue range and location.
What should I do with leads that use a Gmail address?
Keep them, but don’t enrich the free mail domain. Route them to a triage queue and ask for a company name on the thank-you page. If they give one, resolve it to a domain with a company name search and enrich from there.
How do I route inbound leads by territory and company size?
Check for an existing account owner first. If there isn’t one, map the enriched headquarters country to a team, split by headcount range into segments, and assign round robin within the team. Store the round robin pointer in a database so it survives restarts.
Can I remove company size and industry from my lead forms?
Yes, if you enrich every submission. The enriched values are more consistent than what visitors pick from a dropdown. Keep the questions only the visitor can answer, and ask for a company name after submit when enrichment finds nothing.
What if the enrichment call is slow or finds nothing?
Never block the lead on it. Use a short timeout, route to a triage queue when there’s no data, and retry the lookup later in a scheduled job. Store the not-found result with a date so you can see what’s missing.

Get your API key.

Sign up, make your first call and start building your lists.

We’ll email you a link to log in. · Read the docs