# Census Email Validation Relay

URL: https://email-validation.org/docs/guides/census/
Updated: 2026-11-26

> Documentation index: https://email-validation.org/llms.txt

A small relay that implements Census's **Custom Destination API**. Census is now part of Fivetran, whose
documentation calls it Activations. A Census sync sends batches of records (an email address and an id) to the relay;
the relay checks each address with our API and reports one result per record, so Census shows each record with a
bad address as **rejected** in the sync run, with our status and reason as its error message. You pick which
statuses are rejected: by default `invalid` and `disposable`.

The relay is a Cloudflare Worker that you deploy in your own Cloudflare account, with no dependencies. It is not a
listed Census destination: it uses the Custom Destination API that Census documents for services it does not list,
and it was built from that public documentation and has not run in a real Census workspace yet. Fivetran is
retiring Census workspaces: since October 15, 2026 the app no longer creates new ones, new accounts start without a
workspace, and workspaces and Census's API V1 retire on January 15, 2027, when settings such as custom destinations
move to the account level (Fivetran's Census migration FAQ, read on November 26, 2026). The steps below work in an
existing workspace; a new account may not have this path. Download
[email-validation-census.zip](https://email-validation.org/downloads/census/email-validation-census.zip): it unpacks into a folder
`email-validation-census` holding the relay's source (`src/`) and `LICENSE` (MIT).

## What the result is good for

A Census sync goes to one destination, so a record the validation sync rejects can still reach your email or ads
tool through that tool's own sync. You can:

- **See it in Census:** the run's Sync History counts the rejected records with the relay's message, such as
  `email-validation.org: invalid (no_mailbox), suggested action remove.`
- **Gate another sync with it:** where Census's Warehouse Writeback writes row-level sync logs to your warehouse, the
  model of your email tool's sync can leave out the records the validation sync rejected. Check that the log has rows
  for the validation sync before you rely on it.
- **Send the results to a URL of yours** (`RESULTS_URL`): each batch's results as signed JSON, with each record's
  full status.

Census reads only success, or failure with a message, from the relay, so the status cannot become a column in your
warehouse through Census. If your data is in Snowflake or BigQuery, check the addresses there instead with our
[Snowflake](https://email-validation.org/docs/guides/snowflake/) or [BigQuery](https://email-validation.org/docs/guides/bigquery/) functions: every Census model can then
filter on the status, and the relay is not needed.

## What you need

- **A computer with Node 22.18 or later** for Cloudflare's `wrangler` command, which deploys the relay from its
  source folder. There is no browser-only option for this relay yet.
- An API key from the [API keys page](https://email-validation.org/app/api-keys/) with the permission **Validate addresses** and a
  [daily credit cap](https://email-validation.org/docs/authentication/#limits).
- A Cloudflare account and its `wrangler` command, and a shared secret of at least 32 characters (for example from
  `openssl rand -hex 32`).
- The Workers Paid plan once rejected records outrun the Free plan's daily Workers KV limits (1,000 writes and
  100,000 reads a day): the relay's cache uses Workers KV, and Census sends every rejected record again on every run
  and retry.

## Deploy the relay

Unpack the download, create a KV namespace, and put a `wrangler.jsonc` next to `src/`:

```bash
cd email-validation-census
npx wrangler kv namespace create ev-census-cache      # prints the namespace id
```

```json
{
  "name": "ev-census-relay",
  "main": "src/relay.ts",
  "compatibility_date": "2026-10-01",
  "kv_namespaces": [{ "binding": "CACHE", "id": "<the id wrangler printed>" }]
}
```

```bash
npx wrangler deploy
npx wrangler secret put EV_API_KEY --name ev-census-relay      # your API key
npx wrangler secret put CENSUS_SECRET --name ev-census-relay   # the shared secret
```

Other settings go in `wrangler.jsonc` as `vars`:

| Setting | Default | What it does |
|---|---|---|
| `REJECT` | `invalid,disposable` | Statuses reported as rejected, separated by commas, or `none` |
| `ON_ERROR` | `open` | What a record that could not be checked gets: `open` accepts it, `closed` rejects it so Census tries again |
| `EV_REGION` | `us` | `eu` to have addresses checked on our [EU host](https://email-validation.org/docs/eu-data-residency/) |
| `CACHE_DAYS` | `30` | Days a result stays in the cache |
| `CONCURRENCY` | `5` | Checks in flight at once within one batch |
| `BATCH_SIZE`, `PARALLEL_BATCHES`, `RECORDS_PER_SECOND` | `10`, `2`, `20` | How fast Census may send, which the relay tells Census |
| `RESULTS_URL`, `RESULTS_SECRET` | | An https URL of yours that receives each batch's results, and the secret that signs them |

The speed defaults fit our API's limits before your account's first purchase (20 checks a second
and 100 in flight). After a purchase (500 a second) you can raise
`RECORDS_PER_SECOND`.

## Set up Census

1. In your workspace, on the **Connections** page: **New Destination** → **Custom Destination API**. URL:
   `https://ev-census-relay.<your-subdomain>.workers.dev/validate`. Auth Token: your shared secret. Saving runs the
   connection test, which checks your settings and one free test address with your key. Your API key is never typed
   into Census.
2. A model with only the primary key and the address, such as
   `SELECT customer_id, email FROM customers WHERE email IS NOT NULL`.
3. A sync from that model to the connection: object **Email validation**, behaviour **Update or Create**,
   `customer_id → id` as the identifier, and the address mapped to **email** (`email → email`).

Try it with a model row whose address is `no_mailbox@sandbox.email-validation.org` ([test addresses](https://email-validation.org/docs/test-addresses/)
are free): the run counts the record as rejected, with the message `email-validation.org: invalid (no_mailbox), …`.

## What it costs

Each record the relay checks is one check, and a definite result costs one credit; `unknown` results, malformed
addresses and test addresses are free. Census sends records that are new or changed since the last run, plus every
record it did not get accepted before, within the run and on every later run. The relay answers those from its
cache (`CACHE`, for `CACHE_DAYS`) with no check and no credit (a repeat seconds after the first answer can still be
checked: the cache can take up to a minute to reach other locations), which is why rejecting needs the cache. A rejected
record that stays in your model is still sent on every run, and checked once more each time its cache entry
expires. When the cache cannot be read, the relay does not check that record and reports it as not checked, so Census
tries it later, free.

The relay never retries a check itself. A check that got no answer in time may have been charged; with
`ON_ERROR=closed` Census's retry checks it again. A key our API refuses fails the whole batch before anything is
charged.

## Privacy

The relay sends each address only in the body of a `POST` to `https://api.email-validation.org` (or `https://api-eu.email-validation.org`), never to another host
(your `RESULTS_URL` gets addresses only with `INCLUDE_EMAIL=true`), and follows no redirect. It refuses requests without the Auth Token, and requests with a query string, so an address never
travels in a URL. It logs one line per batch with counts, error codes and request ids, never an address, and its
cache holds a keyed hash of each address, never the address. Census's sync logs and debugger keep the records they
handle, addresses included, under your account.

## Licence

The download is under the MIT licence (`LICENSE` in the zip): you may use, change and share it.

## Related

- [Hightouch](https://email-validation.org/docs/guides/hightouch/)
- [BigQuery](https://email-validation.org/docs/guides/bigquery/)
- [Statuses and reasons](https://email-validation.org/docs/statuses/)

## More on Census

- [Census integration](https://email-validation.org/integrations/census/)
