# Check LiveChat Customer Emails: Setup Guide

URL: https://email-validation.org/docs/guides/livechat/
Updated: 2026-12-05

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

Check the customer's email address on each new LiveChat chat, and tag the chat when the address cannot receive mail,
so agents see it and your reports and archives can filter on it. A small receiver you host answers a LiveChat
**webhook** on `incoming_chat`: it reads the chat's customer through LiveChat's Agent Chat API, checks the customer's
address with our API and adds the tag `invalid email` to the chat's thread 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-livechat.zip](https://email-validation.org/downloads/livechat/email-validation-livechat.zip): it holds
`email-validation-livechat.ts` (the receiver), `worker.ts` (the same receiver as a Cloudflare Worker) and `LICENSE`.
It is not in the LiveChat Marketplace.

## What you need

- A LiveChat account (the API comes with every plan, and LiveChat's free trial is the full Growth plan), and its
  owner or an admin: only they can create tags. You build the webhook in LiveChat's **Developer Console**, with the same login.
- 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](https://email-validation.org/app/api-keys/) with the permission **Validate addresses**, and a
  [daily credit cap](https://email-validation.org/docs/authentication/#limits) that limits what a busy day can spend.

## Set it up

1. **A LiveChat Personal Access Token.** In the Developer Console, open **Settings → Authorization → Personal Access
   Tokens**, choose the scopes `customers:ro` and `chats--all:rw`, and click **Create token**. Copy the token and
   your **Account ID**. The scopes cannot be changed later. The token acts as you on your LiveChat account: keep it
   only in the receiver's secrets.
2. **A secret key.** LiveChat puts the webhook's secret key in each delivery, and the receiver refuses every delivery
   without it. Make one of at least 24 characters, for example with `openssl rand -hex 24` (on Windows, your
   password manager's generator).
3. **The tag.** In LiveChat, open **Settings → Tags** and add the tag `invalid email`. LiveChat tags a chat only with
   a tag that exists.
4. **Deploy the receiver** from the unzipped folder:

   ```bash
   cd email-validation-livechat
   npx wrangler deploy worker.ts --name ev-livechat --compatibility-date 2026-10-01
   npx wrangler secret put EV_API_KEY --name ev-livechat             # our API key
   npx wrangler secret put LIVECHAT_ACCOUNT_ID --name ev-livechat    # the Account ID
   npx wrangler secret put LIVECHAT_TOKEN --name ev-livechat         # the Personal Access Token
   npx wrangler secret put LIVECHAT_SECRET_KEY --name ev-livechat    # the secret key
   ```

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

   ```ts
   export const POST = createLiveChatHook({
     apiKey: process.env.EV_API_KEY, // our API key
     livechat: {
       accountId: process.env.LIVECHAT_ACCOUNT_ID,
       token: process.env.LIVECHAT_TOKEN, // the LiveChat Personal Access Token, never ours
     },
     secretKey: process.env.LIVECHAT_SECRET_KEY,
   });
   ```

   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 `createLiveChatWebhookHandler(options)` with the same options and call it
   with the raw body. 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.
5. **The webhook.** In the Developer Console, open **Apps**, click **Create new app**, name it (for example
   `email-validation.org`) and choose LiveChat. Then, under **Building blocks**:
   - **App Authorization**: choose **Server-side app**.
   - **Chat webhooks**: add a webhook with the receiver's address as **Webhook URL**, your secret key as **Secret
     key**, the type `license` and the trigger `incoming_chat`. A webhook cannot be edited once added: to change it,
     add a new one.

   Then open the **Private installation** tab and click **Install app**. It installs only on your own LiveChat
   account, and each new chat now sends one delivery.

## Settings

| Variable | Value |
|---|---|
| `EV_API_KEY` | Required. Our API key with **Validate addresses**. |
| `LIVECHAT_ACCOUNT_ID` | Required. Your Account ID, shown with the Personal Access Token. |
| `LIVECHAT_TOKEN` | Required. The Personal Access Token, with `customers:ro` and `chats--all:rw`. |
| `LIVECHAT_SECRET_KEY` | Required. The webhook's secret key, at least 24 characters. |
| `EV_REGION` | `eu` to check addresses in the EU ([EU data residency](https://email-validation.org/docs/eu-data-residency/)), with the same key. |
| `EV_FLAG` | The statuses that tag a chat, separated by commas: `invalid`, `disposable`, `catch_all`, `unknown`. Default `invalid`. |
| `LIVECHAT_TAG` | The tag added to a flagged chat, instead of `invalid email`. It must exist in LiveChat. |

A missing LiveChat setting or secret key, or a wrong secret key, `EV_REGION`, `EV_FLAG` or `LIVECHAT_TAG`, fails every
delivery (HTTP 500; the Worker's logs name the setting, never a key or a token), so set the secrets before you install
the app. A token that is set but wrong, lacks a scope, or a tag that does not exist in LiveChat leaves every chat
untagged. A missing or wrong `EV_API_KEY` leaves every chat unchecked.

## What it does on a chat

- A flagged status adds the tag `invalid email` (or your `LIVECHAT_TAG`) to the chat's thread. Agents see it on the
  chat, and **Archives** can filter on it. A `valid` answer marked disposable counts as `disposable`.
- The address checked is the one saved on the customer, such as the email of your pre-chat form. A customer with no
  saved address is not checked.
- A tag is only ever added, never taken away: a later answer, an `unknown` or a timeout never clears it.
- No other tag, field or message of the chat is touched, and nothing is ever sent to the customer.
- The same customer on a new chat, or coming back to one, 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 new thread. Cloudflare runs and restarts Workers on its own, so an address can now and then be checked again.

`unknown` answers that mean our check ran out of time or failed (`timeout`, `internal_error`) never tag a chat, even
with `unknown` in `EV_FLAG`. [What each status means](https://email-validation.org/docs/statuses/).

## When something fails

- Our API is slow, down, rate limited or out of credits, or our key is missing or wrong: the chat is left as it is.
  Every failure fails open.
- LiveChat waits about 10 seconds for each delivery, so the receiver answers within 3 seconds. A check still running
  then finishes after the answer: the tag still lands.
- LiveChat sends a delivery again (up to 3 times within about a minute) when it gets no `200` answer. A delivery
  without the right secret key is answered 401 and nothing is read or checked; the same delivery again is not
  checked twice.

## Try it free

Use a [test address](https://email-validation.org/docs/test-addresses/): it costs nothing and returns a fixed result. A test address receives no
mail, so never send the chat's transcript or a ticket to it.

1. In a private window, open a page of your site with the LiveChat chat widget, enter `no_mailbox@sandbox.email-validation.org`
   as the email in the pre-chat form and start a chat. If your widget asks for no email, turn on an email field in
   LiveChat's pre-chat form settings for the test.
2. Within a few seconds the chat should have the tag `invalid email`. We have not yet tried this on a real LiveChat
   account.
3. If no tag comes, run `npx wrangler tail ev-livechat` and start another chat. No request means the webhook is not
   installed (check step 5); an answer of 500 means a setting is missing or wrong (the log names it); a 200 with no tag
   means the token, its scopes or the tag (see [Settings](#settings)), or a customer with no saved address.
4. End the test chat without replying to the test address.

## What it costs

Each check costs at most 1 credit, like any [validation request](https://email-validation.org/docs/api/validate/). `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](https://email-validation.org/pricing/), 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 chat, thread and customer ids from LiveChat's delivery, never an address, and reads the
customer from `https://api.livechatinc.com`. It sends only the customer'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 chat. Its answer to LiveChat holds the outcome, never the
address. Our key goes only to our API and the LiveChat token only to LiveChat's API; redirects are never followed, and
nothing is logged with an address, a key or a token.

## End access

The receiver holds your Personal Access Token, which acts as you on your LiveChat account. To end its access:

1. Uninstall the app from your LiveChat account, or delete it in the Developer Console under **Apps**. No more chats
   are sent.
2. Delete the Worker and its secrets. On the computer you deployed from, run:

   ```bash
   npx wrangler delete --name ev-livechat
   ```

   On your own server, remove the receiver and its settings.
3. Delete the Personal Access Token in the Developer Console: **Settings → Authorization → Personal Access Tokens**.
4. Revoke our key on the [API keys page](https://email-validation.org/app/api-keys/).

## Related

- [Statuses and reasons](https://email-validation.org/docs/statuses/)
- [Test addresses](https://email-validation.org/docs/test-addresses/)

## More on LiveChat

- [LiveChat email validation integration](https://email-validation.org/integrations/livechat/)
