// crm
Via APIKeap email verification with pingutil
Keap campaigns start the moment a contact is added, so a typo or a throwaway address goes straight into automated sequences and drags down deliverability. A REST hook on contact.add sends new contact ids to a small service that verifies the email with pingutil and writes the status to a custom field that campaign goals and tags can act on.
Where it connects: Keap REST Hook subscription (eventKey contact.add) to a service that updates contact custom fields through the Keap REST API
What goes wrong without it
- New contacts from our landing pages drop into a Keap campaign and the first email bounces.
- Free-offer opt-ins are full of throwaway inboxes that never open anything.
- Our sender reputation suffers because Keap keeps mailing addresses nobody owns.
What you can do with Keap and pingutil
Verify before the campaign sequence
Add a short delay at the start of the campaign, and write `status` to a custom field. A decision diamond or tag keeps `invalid` contacts out of the email sequence.
Tag throwaway opt-ins
When `category` is `disposable`, the service writes it to a custom field you can filter on; apply a tag and stop the free-offer sequence.
Flag typos
When `did_you_mean` is set, write it to a "Suggested email" field and send a task to the owner.
Set it up
- 1
Create contact custom fields Email Status, Email Category and Suggested Email, and note their numeric ids from the custom field model endpoint.
- 2
Create a Service Account Key in Keap's API settings; Keap expects it in the `X-Keap-API-Key` header.
- 3
Deploy the service below with `KEAP_KEY`, `PINGUTIL_KEY`, `HOOK_PATH_TOKEN` and the field ids.
- 4
Create the hook with `POST https://api.infusionsoft.com/crm/rest/v1/hooks`, body `{"eventKey": "contact.add", "hookUrl": "https://your-host/keap/<token>"}`. Keap sends an `X-Hook-Secret` header that the service echoes back to verify the subscription.
- 5
In your campaign, add a delay before the first email and branch on Email Status.
// node >= 18, npm install express
import express from 'express';
const KEAP = 'https://api.infusionsoft.com/crm/rest/v1';
const kp = { 'X-Keap-API-Key': process.env.KEAP_KEY, 'content-type': 'application/json' };
const pu = { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' };
const app = express();
app.use(express.json());
// Keap does not sign deliveries, so the URL carries a secret token.
app.post('/keap/:token', (req, res) => {
if (req.params.token !== process.env.HOOK_PATH_TOKEN) return res.sendStatus(401);
const secret = req.get('X-Hook-Secret');
if (secret) return res.set('X-Hook-Secret', secret).sendStatus(200); // verification handshake
res.sendStatus(200);
for (const obj of req.body?.object_keys ?? []) handleContact(obj.id).catch((e) => console.error(obj.id, 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
}
async function handleContact(id) {
const contact = await fetch(KEAP + '/contacts/' + id, { headers: kp }).then((r) => r.json());
const email = contact.email_addresses?.[0]?.email;
if (!email) return;
const [v, l] = await Promise.all([pingutil('/v1/verify', { email }), pingutil('/v1/lookup', { input: email, skip_enrichment: true })]);
const custom_fields = [];
if (v) custom_fields.push({ id: Number(process.env.CF_STATUS), content: v.status });
if (v?.did_you_mean && v.did_you_mean !== v.email) custom_fields.push({ id: Number(process.env.CF_SUGGESTED), content: v.did_you_mean });
if (l) custom_fields.push({ id: Number(process.env.CF_CATEGORY), content: l.category });
if (!custom_fields.length) return;
await fetch(KEAP + '/contacts/' + id, { method: 'PATCH', headers: kp, body: JSON.stringify({ custom_fields }) });
}
app.listen(process.env.PORT ?? 3000);What to do with each result
| pingutil result | Action in Keap |
|---|---|
| `status: "invalid"` | Branch out of the email sequence and apply a "Bad email" tag. |
| `status: "risky"`, `reason: "accept_all"` | Keep in the campaign but watch bounces for that domain. |
| `status: "unknown"` | Continue the sequence; re-check later. |
| `category: "disposable"` | Stop the free-offer sequence and tag the contact. |
| `did_you_mean` set | Send the owner a task to confirm the corrected address. |
Limits to plan for
- Keap makes up to four delivery attempts for a hook and then marks the subscription inactive until it is re-verified through the hook's verify endpoint.
- Keap documents low throttle limits for personal access tokens and service account keys, so this setup suits steady inbound traffic, not bulk imports.
- Verification can take up to about 25 seconds, so put a short delay at the start of the campaign before the first email goes out.
Keap documentation
Keap is a trademark of its owner. This integration uses Keap's documented extension points; it is not an official Keap app.
Common questions
- Can Keap campaigns call pingutil directly?
- pingutil needs a Bearer key in the Authorization header, and its answer has to be written back to the contact. The REST hook plus a small service covers both, which is why we use it here.
- Will this slow down my campaign?
- Only by the delay you add. Most checks return in a few seconds; slow mail servers can take up to about 25 seconds.
Stop bad addresses in Keap 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 Keap setup will receive.