// crm
Via APIHubSpot email verification with pingutil
HubSpot contacts come from forms, imports and integrations, and nothing checks the address before marketing emails and sequences go out. A workflow custom code action calls pingutil when a contact is created, returns the verification status and email category as outputs, and an Edit record action writes them to contact properties that lists and sequences can filter on.
Where it connects: Contact-based workflow with a Custom code action (Node.js), outputs copied to contact properties
What goes wrong without it
- Our hard bounce rate in HubSpot keeps creeping up after every webinar and content download.
- Sales gets notified about "new leads" that turn out to be throwaway inboxes and personal Gmail accounts.
- We pay for marketing contacts that will never receive an email.
What you can do with HubSpot and pingutil
Exclude invalid addresses from sends and sequences
Write `status` to an "Email verification status" property and add `is not invalid` to active lists, marketing email recipients and sequence enrollment criteria.
Flag typos for the contact owner
When `did_you_mean` differs from the address on file, set an "Email suggestion" property and create a task for the owner to confirm with the contact. Do not overwrite the email automatically.
Separate business contacts from personal ones
The same action calls `/v1/lookup` and writes `category` (company, free, isp, disposable…) to a property, so lead scoring and rotation can treat work addresses differently.
Add industry to new contacts
For `company` domains, the lookup returns `company.industry` and `company.employee_size_estimate`, which you can copy to contact or company properties.
Set it up
- 1
Create contact properties: Email verification status (dropdown: valid, invalid, risky, unknown), Email verification reason (text), Email suggestion (text), Email category (text) and Company industry (text).
- 2
Create a contact-based workflow that enrolls contacts when Email is known and Email verification status is unknown.
- 3
Add a Custom code action (Node.js), add a secret named `PINGUTIL_API_KEY`, and include the `email` property in the code.
- 4
Paste the code below and declare the outputs `verify_status`, `verify_reason`, `did_you_mean`, `email_category` and `industry` as strings.
- 5
Add an Edit record action for each property, using the custom code outputs as values.
- 6
Test on a few contacts, including a known-bad address and a role address like `info@`, before turning the workflow on.
const axios = require('axios');
const api = axios.create({
baseURL: 'https://pingutil.com',
headers: { Authorization: 'Bearer ' + process.env.PINGUTIL_API_KEY },
timeout: 14000, // custom code actions must finish within 20 seconds
});
exports.main = async (event, callback) => {
const email = event.inputFields['email'];
if (!email) {
return callback({ outputFields: { verify_status: 'unknown', verify_reason: 'no_email', did_you_mean: '', email_category: '', industry: '' } });
}
// Run both calls in parallel so the action stays under HubSpot's time limit.
const [verify, lookup] = await Promise.allSettled([
api.post('/v1/verify', { email }),
api.post('/v1/lookup', { input: email }),
]);
if (verify.status === 'rejected') {
const code = verify.reason.response ? verify.reason.response.status : 0;
// 429 (rate limit or daily quota), 5xx, timeouts: throw so HubSpot retries the action later.
if (code !== 400) throw verify.reason;
}
const v = verify.status === 'fulfilled' ? verify.value.data : null;
const l = lookup.status === 'fulfilled' ? lookup.value.data : null;
callback({
outputFields: {
verify_status: v ? v.status : 'unknown', // valid | invalid | risky | unknown
verify_reason: v ? v.reason : 'bad_request', // mailbox_not_found, accept_all, greylisted...
did_you_mean: v && v.did_you_mean && v.did_you_mean !== v.email ? v.did_you_mean : '',
email_category: l ? l.category : '', // company | free | isp | disposable | ...
industry: l && l.company ? l.company.industry || '' : '',
},
});
};What to do with each result
| pingutil result | Action in HubSpot |
|---|---|
| `status: "invalid"` | Exclude from marketing emails and sequences; consider setting the contact as non-marketing. |
| `status: "risky"`, `reason: "accept_all"` | Keep in nurture, leave out of high-volume sends. |
| `status: "unknown"` | Re-enroll in a delayed re-check workflow; it is not a verdict. |
| `did_you_mean` set | Fill Email suggestion and create a task for the contact owner. |
| `category: "company"` with `company.industry` | Copy industry to the contact or associated company and use it in lead scoring. |
Limits to plan for
- HubSpot documents that custom code actions need Data Hub Professional or Enterprise and must finish within 20 seconds, so the code uses a 14-second timeout. Verification of a slow mail server can take longer; HubSpot retries thrown errors, and cached results come back quickly on the retry.
- A first-time company profile can take a few seconds. If the lookup times out, the action still writes the verification result and leaves industry empty.
- pingutil allows 60 requests a minute and 300 verified addresses a day (3,000 a month) per account; a large enrollment drains over several days through HubSpot retries. Those are Free plan limits; Enterprise has custom limits.
HubSpot documentation
- developers.hubspot.com/docs/api/workflows/custom-code-actions
- knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows
HubSpot is a trademark of its owner. This integration uses HubSpot's documented extension points; it is not an official HubSpot app.
Common questions
- Can I use the Send a webhook action instead of custom code?
- HubSpot's Send a webhook action can POST contact data, but it is built for endpoints you control. For a third-party API that needs a Bearer header and a specific JSON body, the custom code action is easier, or you can put a small service of your own between HubSpot and pingutil.
- What happens when the daily verification budget runs out?
- pingutil returns 429 quota_exceeded until 00:00 UTC. The code throws on 429, and HubSpot retries the action later, so contacts get verified the next day instead of failing.
- Should I delete invalid contacts?
- No. Keep the property and use it to exclude contacts from sends. Deleting loses the record of where the bad address came from.
Stop bad addresses in HubSpot today
Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your HubSpot setup will receive.