// crm
Via APIClose email verification with pingutil
Close teams email and sequence straight from the lead, so a dead address costs a touch and a bit of sending reputation every time. A webhook subscription on lead creation sends each new lead to a small service that verifies every contact email with pingutil and writes the result to contact custom fields, plus company industry and size to the lead.
Where it connects: Close webhook subscription (object_type lead, action created) to a service that updates contact and lead custom fields via the Close API
What goes wrong without it
- Our Close sequences pause on bounces, and by then the rep has already wasted the first step.
- Inbound leads land in Close with a contact name and an email and nothing else about the company.
- We keep calling and emailing people who signed up with a throwaway inbox to see pricing.
What you can do with Close and pingutil
Verify every contact on a new lead
A Close lead can hold several contacts with several emails. The service verifies each address and writes `status` to a contact custom field, so Smart Views can exclude `invalid` before a sequence starts.
Fill company fields on the lead
In Close a lead is usually the company. `/v1/lookup` returns `company.industry` and `company.employee_size_estimate`, which go into lead custom fields.
Mark throwaway signups
When `category` is `disposable` or `verdict.is_spam` is true, write that to the lead so the inbound team can skip it.
Set it up
- 1
Create contact custom fields "Email status" and "Email reason", and lead custom fields "Industry" and "Company size", then copy each field id (`cf_...`) from Settings or the custom fields API.
- 2
Deploy the service below with `CLOSE_API_KEY`, `PINGUTIL_KEY`, `CLOSE_SIG_KEY` and the field ids as environment variables.
- 3
Create the subscription with `POST https://api.close.com/api/v1/webhook/` and the body `{"url": "https://your-host/close", "events": [{"object_type": "lead", "action": "created"}]}`.
- 4
Save the `signature_key` from the response as `CLOSE_SIG_KEY`; the service uses it to check `close-sig-hash` on every delivery.
- 5
Build a Smart View that hides contacts whose Email status is invalid.
// node >= 18, npm install express
import express from 'express';
import crypto from 'node:crypto';
const CLOSE = 'https://api.close.com/api/v1';
const auth = 'Basic ' + Buffer.from(process.env.CLOSE_API_KEY + ':').toString('base64');
const closeHeaders = { authorization: auth, 'content-type': 'application/json' };
const pu = { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' };
const app = express();
app.use(express.text({ type: '*/*' })); // raw body for the signature
app.post('/close', (req, res) => {
const sig = crypto.createHmac('sha256', Buffer.from(process.env.CLOSE_SIG_KEY, 'hex'))
.update(req.headers['close-sig-timestamp'] + req.body).digest('hex');
if (sig !== req.headers['close-sig-hash']) return res.sendStatus(401);
res.sendStatus(200); // Close expects a 2xx within 15 seconds
const event = JSON.parse(req.body).event;
if (event?.lead_id) handleLead(event.lead_id).catch((e) => console.error(e));
});
async function pingutil(path, body) {
const r = await fetch('https://pingutil.com' + path, {
method: 'POST', headers: pu, body: JSON.stringify(body), signal: AbortSignal.timeout(30_000),
});
return r.ok ? r.json() : null; // fail open: on 429 or errors, leave fields empty
}
async function handleLead(leadId) {
const lead = await fetch(CLOSE + '/lead/' + leadId + '/', { headers: closeHeaders }).then((r) => r.json());
let firstEmail = null;
for (const contact of lead.contacts ?? []) {
const email = contact.emails?.[0]?.email;
if (!email) continue;
firstEmail ??= email;
const v = await pingutil('/v1/verify', { email });
if (!v) continue;
await fetch(CLOSE + '/contact/' + contact.id + '/', {
method: 'PUT', headers: closeHeaders,
body: JSON.stringify({
['custom.' + process.env.CF_EMAIL_STATUS]: v.status,
['custom.' + process.env.CF_EMAIL_REASON]: v.reason,
}),
});
}
const l = firstEmail && (await pingutil('/v1/lookup', { input: firstEmail }));
if (l?.company) {
await fetch(CLOSE + '/lead/' + leadId + '/', {
method: 'PUT', headers: closeHeaders,
body: JSON.stringify({
['custom.' + process.env.CF_INDUSTRY]: l.company.industry,
['custom.' + process.env.CF_SIZE]: l.company.employee_size_estimate,
}),
});
}
}
app.listen(process.env.PORT ?? 3000);What to do with each result
| pingutil result | Action in Close |
|---|---|
| `status: "invalid"` | Exclude the contact from sequences through a Smart View filter. |
| `status: "risky"`, `reason: "accept_all"` | Email at low volume and prefer calling; the server accepts every address. |
| `status: "unknown"` | Keep in the sequence but re-check later; greylisting is common on first contact. |
| `category: "disposable"` or `verdict.is_spam` | Set the lead status to your bad-fit status and skip outreach. |
| `company.industry`, `company.employee_size_estimate` | Write to lead custom fields for Smart Views and reporting. |
Limits to plan for
- Close requires a 2xx response within 15 seconds and retries failed deliveries for up to 72 hours, so the service answers first and works afterwards.
- Close PUT requests behave as partial updates, so the service only sends the custom fields it changes.
- pingutil verifies up to 300 addresses a day (3,000 a month) per account; a lead with five contacts uses five. Those are Free plan limits; Enterprise has custom limits.
Close documentation
- developer.close.com/topics/webhooks/
- developer.close.com/api/resources/webhooks/create
- developer.close.com/api/resources/contacts/update
Close is a trademark of its owner. This integration uses Close's documented extension points; it is not an official Close app.
Common questions
- Why subscribe to lead created rather than contact created?
- Close's documented example subscribes to lead created, and a new lead brings its first contacts with it. If your team adds contacts to existing leads often, add a second subscription for contact events from Close's event list.
- Does this stop Close from sending to bad addresses?
- Not by itself. It writes the status to the contact; your Smart Views and sequence enrollment rules decide who gets emailed.
Stop bad addresses in Close 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 Close setup will receive.