Integrations · CRM

Check contact emails on new HappyFox tickets

Check the contact's email address on each new HappyFox Help Desk ticket, and tag the ticket when the address cannot receive mail, so your Smart Rules and views can route it before an agent replies. A small receiver you host answers a HappyFox webhook on ticket creation: it reads the ticket through HappyFox's API, checks its contact's address with our API and adds the tag invalid email when the answer is a status you flag (by default only invalid).

It is TypeScript with no dependencies, under the MIT licence. Download email-validation-happyfox.zip: it holds email-validation-happyfox.ts (the receiver), worker.ts (the same receiver as a Cloudflare Worker) and LICENSE. It is not in a HappyFox marketplace.

What you need

  • A HappyFox Help Desk account and an administrator who can open Apps. HappyFox lists webhooks and its API on every plan, and offers a 14-day free trial. HappyFox notes that a recently created account may not have access to the API settings yet: its help article on API keys says to email HappyFox support to get it.
  • A place to run the receiver on a public HTTPS address: a Cloudflare account and Cloudflare's wrangler command (npx wrangler, on a computer with Node), or your own server with Node 22 or later, Bun or Deno.
  • An API key of ours from the API keys page with the permission Validate addresses, and a daily credit cap that limits what a busy day can spend.

Set it up

  1. HappyFox API key and auth code. In HappyFox, open Apps → Goodies → API and click Enable. Click +, give the key a name (for example email-validation.org) and click Add new API key. Hover over the new key's row and click see auth code: the panel shows the API key and the Auth code. Together they open your help desk's data: keep them only in the receiver's secrets.

  2. Your help desk's host. acme for acme.happyfox.com; acme.happyfox.net for an account hosted in the EU; or your own domain, such as help.example.com, when your help desk runs on one (HappyFox's API then answers only there).

  3. The agent the tag changes are recorded under. HappyFox asks for an agent's id with every tag change, to show the agent's name on the ticket. List your agents and their ids with the key and code from step 1:

    curl -u "$HAPPYFOX_API_KEY:$HAPPYFOX_AUTH_CODE" https://acme.happyfox.com/api/1.1/json/staff/

    Pick one, for example an admin, and note its id.

  4. A relay token. HappyFox lets you set only the webhook's URL, so the URL carries a token you make up, and the receiver refuses every request without it. Make one of at least 24 characters, for example with openssl rand -hex 24 (on Windows, your password manager's generator; keep it to letters and digits).

  5. Deploy the receiver from the unzipped folder:

    cd email-validation-happyfox
    npx wrangler deploy worker.ts --name ev-happyfox --compatibility-date 2026-10-01
    npx wrangler secret put EV_API_KEY --name ev-happyfox             # our API key
    npx wrangler secret put HAPPYFOX_HOST --name ev-happyfox          # acme, acme.happyfox.net or your domain
    npx wrangler secret put HAPPYFOX_API_KEY --name ev-happyfox       # the API key from step 1
    npx wrangler secret put HAPPYFOX_AUTH_CODE --name ev-happyfox     # the auth code from step 1
    npx wrangler secret put HAPPYFOX_STAFF_ID --name ev-happyfox      # the agent id from step 3
    npx wrangler secret put HAPPYFOX_RELAY_TOKEN --name ev-happyfox   # the relay token

    wrangler deploy prints the Worker's address, such as https://ev-happyfox.<your subdomain>.workers.dev. On your own server, put email-validation-happyfox.ts next to your code and create the receiver once, at module level, with our key and the HappyFox credentials as separate settings:

    export const POST = createHappyFoxHook({
      apiKey: process.env.EV_API_KEY, // our API key
      happyfox: {
        host: process.env.HAPPYFOX_HOST,
        apiKey: process.env.HAPPYFOX_API_KEY, // the HappyFox API key, never ours
        authCode: process.env.HAPPYFOX_AUTH_CODE,
        staffId: Number(process.env.HAPPYFOX_STAFF_ID),
      },
      relayToken: process.env.HAPPYFOX_RELAY_TOKEN,
    });

    That is a Next.js route handler: add waitUntil: after (after from next/server), so a check still running at the answer finishes. In Express, create createHappyFoxWebhookHandler(options) with the same options and call it with the raw body, the headers and url: req.originalUrl. Node 22.18 or later imports the .ts file as it is; with an older Node or a build step, compile it with your app.

  6. The webhook. In HappyFox, open Apps → Goodies → Webhooks and click Install. Make sure Webhook Status is Enabled. Add a webhook with the URL https://<your receiver>/?token=<your relay token> that fires when a ticket is created. To check only some tickets instead, open Automate → Smart Rules, create a Smart Rule with your conditions and choose the action Trigger Webhook with the same URL.

  7. The signature (optional). The Webhooks page also shows a webhook key, with which HappyFox signs each request (X-Happyfox-Webhook-Signature). Put it in the Worker's secrets too: npx wrangler secret put HAPPYFOX_WEBHOOK_KEY --name ev-happyfox. The receiver then also refuses a request whose signature does not match. HappyFox does not say how it encodes the signature; the receiver takes hex and base64. If every request is then refused with Missing or wrong signature., delete that secret: the token alone guards the URL.

The webhook URL, token included, shows in HappyFox's webhook log and can show in access logs along the way. Use it only for your own receiver, and make a new token if it leaks.

Settings

VariableValue
EV_API_KEYRequired. Our API key with Validate addresses.
HAPPYFOX_HOSTRequired. Your help desk: acme for acme.happyfox.com, acme.happyfox.net in the EU, or your own domain.
HAPPYFOX_API_KEYRequired. The HappyFox API key.
HAPPYFOX_AUTH_CODERequired. That key's auth code.
HAPPYFOX_STAFF_IDRequired. The id of the agent the tag changes are recorded under (digits only).
HAPPYFOX_RELAY_TOKENRequired. The relay token, at least 24 characters, in the webhook URL as ?token=<token>.
HAPPYFOX_WEBHOOK_KEYThe webhook key from HappyFox's Webhooks page: the request's signature must match too.
EV_REGIONeu to check addresses in the EU (EU data residency), with the same key.
EV_FLAGThe statuses that tag a ticket, separated by commas: invalid, disposable, catch_all, unknown. Default invalid.
HAPPYFOX_TAGThe tag added to a flagged ticket, instead of invalid email (no commas).

A missing HappyFox setting or relay token, or a wrong HAPPYFOX_HOST, HAPPYFOX_STAFF_ID, relay token, EV_REGION, EV_FLAG or HAPPYFOX_TAG, fails every request (HTTP 500; the Worker's logs name the setting, never a key or a token), so set the secrets before you add the webhook. HappyFox credentials that are set but wrong fail on each ticket instead: the ticket stays unchecked, and the receiver's answer to the request shows happyfox_call_refused (HappyFox refused the key or the auth code) or happyfox_call_failed (no answer from that help desk, or HappyFox was rate limited or down). A missing or wrong EV_API_KEY leaves every ticket unchecked.

What it does on a ticket

  • A flagged status adds the tag invalid email (or your HAPPYFOX_TAG). A Smart Rule or a view on that tag can then route or hold the ticket. A valid answer marked disposable counts as disposable.
  • A definite answer that is not flagged (the contact's address was corrected) removes that tag. An unknown answer, our timeout or no answer never removes it. No other tag is touched, and nothing is ever sent to the contact.
  • The same contact on a new ticket is not checked again while the receiver remembers the address (up to 1,000 addresses, kept in memory as a fingerprint, never the address): the tag is still written on each ticket. Cloudflare runs and restarts Workers on its own, so an address can now and then be checked again.
  • The receiver answers the webhook with the result (status, reason, flagged), never the address, within 4 seconds. A check still running then is answered as pending and finishes after the answer: the tag still lands.

unknown answers that mean our check ran out of time or failed (timeout, internal_error) never tag a ticket, even with unknown in EV_FLAG. What each status means.

When something fails

  • Our API is slow, down, rate limited or out of credits, or our key is missing or wrong: the ticket is left as it is. Every failure fails open. Our refused key, no credits or the key's daily cap pause checks for 5 minutes.
  • A ticket left unchecked can be checked again: select its failed request in HappyFox's webhook log and resend it.
  • HappyFox limits API requests per minute by plan, and each ticket takes one or two. A burst of new tickets can go over it, and those tickets stay unchecked.
  • A request without the right token (or, with HAPPYFOX_WEBHOOK_KEY, without a matching signature) is answered 401, and nothing is read or checked.

Try it free

Use a test address: it costs nothing and returns a fixed result. A test address receives no mail, so the test ticket must never be answered.

  1. In HappyFox, create a test ticket whose contact is no_mailbox@sandbox.email-validation.org. If your help desk emails the contact when a ticket is created, test with an address of yours that receives mail instead: it costs 1 credit and should get no tag when the address is valid.
  2. Within a few seconds the ticket should have the tag invalid email. We have not yet tried this on a real HappyFox account.
  3. If no tag comes, open the webhook log under Apps → Goodies → Webhooks and look for the request. A failed one can be resent from there once the cause is fixed. The receiver's answer names the cause (see Settings), and a request answered 401 had a wrong token or signature.
  4. Delete the test ticket and the test contact, without replying to them.

What it costs

Each check costs at most 1 credit, like any validation request. unknown results, errors, malformed addresses and test addresses are free, and an address the receiver remembers is not checked again. Credits come in one-time packs, from $0.15 per 1,000 with the 50,000,000-credit pack (smaller packs cost more per credit), and new accounts get 500 free credits (100 when you sign up with a free email provider such as Gmail, Outlook or Yahoo, another personal mailbox such as a paid one like Fastmail or one from your internet provider, or an address from a relay or alias service).

Privacy

The receiver takes only the ticket id from HappyFox's request, never the address in it, and reads the ticket from your help desk. It sends only the contact's address, in the body of a POST to https://api.email-validation.org (or https://api-eu.email-validation.org), never in a URL, and nothing else from the ticket. Its answer to HappyFox holds the status, the reason and the request id, never the address. Our key goes only to our API and the HappyFox credentials only to your help desk; redirects are never followed, and nothing is logged with an address, a key or a token.

End access

The receiver holds your HappyFox API key and auth code, which open your help desk's data. To end its access:

  1. Delete the webhook (and any Smart Rule that triggers it) under Apps → Goodies → Webhooks, Manage. No more tickets are sent.

  2. Delete the Worker and its secrets. On the computer you deployed from, run:

    npx wrangler delete --name ev-happyfox

    On your own server, remove the receiver and its settings.

  3. If the HappyFox key may have leaked, or nothing else uses it, remove it from the list of keys under Apps → Goodies → API.

  4. Revoke our key on the API keys page.

More on HappyFox

Updated · Maintained by: Email Validation LLC

Need help? Contact support, or ask the help chat. Something wrong or missing on this page? Tell us