Integrations · Forms
Validate your Calendly invitees
Check the email address of each person who books a meeting with you on Calendly (the invitee). A small webhook receiver on your own server checks each new invitee's address and tells your code the result: send it to Slack, your CRM or a review queue. If you switch it on, it can also cancel a one-on-one meeting whose address is invalid. If the API is slow or down, the meeting stays as it is.
It is one TypeScript file with no dependencies, under the MIT licence (the text is at the top of the file). Download it: email-validation-calendly.ts. It runs on any server with fetch and Web Crypto: Next.js, Remix, Hono, Express, Bun, Deno, Cloudflare Workers, Node 20 or later.
How it works, and its limits
Calendly cannot block a booking: its booking page runs no code of yours, and its webhooks arrive after the invitee and the meeting exist. So the check runs right after the booking:
- Calendly sends the
invitee.createdwebhook to your server. The receiver verifies its signature (Calendly-Webhook-Signature, with the signing key you chose) and answers Calendly at once; a delivery without the right signature starts nothing. - With a Calendly token, it reads the invitee fresh, so an invitee already canceled, or no longer holding the address, is not checked.
- It checks the address with one call to our API and hands the result to your
onResultfunction. - Only if you set
onStop: 'cancel': when the result is a status you chose to stop (by defaultinvalidonly), it cancels the meeting through Calendly's API, and only while it is still active and one-on-one. A group event is never cancelled, and a guest's address never cancels a meeting.
It writes nothing back to Calendly: Calendly's API has no note, tag or field on an invitee or a meeting. A reschedule sends invitee.created again for the new booking: when the address is the same, the earlier answer is reused and not paid again, within seven days, on the same running server or with a shared store (below).
What you need
- An API key from the API keys page with the permission Validate addresses, and a daily credit cap. Put it in your server's environment as
EV_API_KEY. - A Calendly personal access token: in Calendly, open your profile menu → Developer → Personal access tokens → Create personal access token, name it, choose its scopes and create it (Calendly emails you a code to confirm). Calendly shows the token once. Give it
users:readandwebhooks:write(to create the subscription),scheduled_events:read(to read the invitee) and, foronStop: 'cancel',scheduled_events:write. If your account has no Developer menu yet, Calendly keeps the tokens under calendly.com/integrations. Put it in your server's environment asCALENDLY_TOKEN. - A signing key: a long random string you choose (for example
openssl rand -hex 32), asCALENDLY_WEBHOOK_SIGNING_KEY. Calendly signs each delivery with it.
Webhooks and the API are on every Calendly plan, Free included, since Calendly's release of November 3, 2026. Calendly allows 50 API requests per user a minute on Free and 500 on paid plans.
Set it up
Copy
email-validation-calendly.tsinto your server code, for example tolib/.Add a route. In the Next.js App Router,
app/api/webhooks/calendly/route.ts:import { after } from 'next/server'; import { createCalendlyWebhookHandler } from '@/lib/email-validation-calendly'; const handle = createCalendlyWebhookHandler({ apiKey: process.env.EV_API_KEY, signingKey: process.env.CALENDLY_WEBHOOK_SIGNING_KEY, calendlyToken: process.env.CALENDLY_TOKEN, onResult: async (r) => { if (r.outcome === 'stopped') await notifyTeam(r); // your code: Slack, email, CRM }, // opt-in: cancel a one-on-one meeting whose invitee's address is invalid // onStop: 'cancel', }); export async function POST(request: Request) { const body = new Uint8Array(await request.arrayBuffer()); const result = await handle({ body, headers: request.headers, waitUntil: after }); return Response.json(result.body, { status: result.status }); }On Cloudflare Workers,
createCalendlyBookingHook()takes the request and the context:fetch: (request, env, ctx) => hook(request, ctx). In Express, read the raw body (the signature covers the exact bytes):import express from 'express'; import { createCalendlyWebhookHandler } from './email-validation-calendly.ts'; const handle = createCalendlyWebhookHandler({ /* the same options */ }); app.post('/webhooks/calendly', express.raw({ type: '*/*' }), async (req, res) => { const result = await handle({ body: req.body, headers: req.headers }); res.status(result.status).json(result.body); });Create the webhook subscription. Calendly creates them through its API, not a settings page. With your token,
GET https://api.calendly.com/users/megives your user and organization links (resource.uriandresource.current_organization); thenPOST https://api.calendly.com/webhook_subscriptionswith:{ "url": "https://your-app.example/api/webhooks/calendly", "events": ["invitee.created"], "organization": "https://api.calendly.com/organizations/…", "user": "https://api.calendly.com/users/…", "scope": "user", "signing_key": "the value of CALENDLY_WEBHOOK_SIGNING_KEY" }For example with curl:
curl -H "Authorization: Bearer $CALENDLY_TOKEN" -H 'Content-Type: application/json' --data @subscription.json https://api.calendly.com/webhook_subscriptions.Test it. Book a test meeting with an address of yours that receives mail and watch
onResult(outcome: 'allowed'). Never book with a test address that cannot receive mail, a sandbox address included: nothing blocks the booking, so Calendly's confirmation email to it would bounce and hurt your sender. To see the stopped path, callcheckBookingEmail('no_mailbox@sandbox.email-validation.org', options)from your server: it is free and always answersinvalid. Or post a delivery you sign yourself withsignCalendlyWebhook.
Options
| Option | Default | What it does |
|---|---|---|
apiKey | required | Our API key. Missing: nothing is checked. |
signingKey | required | The subscription's signing key. Missing: every delivery is refused. |
calendlyToken | none | Reads the invitee before the check; needed for cancel. |
region | us | eu validates addresses in the EU and stores their results there, with the same key |
stop | ['invalid'] | Statuses that stop a meeting, from invalid, disposable, catch_all |
onStop | none | none or cancel |
reason | "The email address given for this booking could not be verified." | Sent with a cancellation |
toleranceS | 180 | How far the signature's time may be from now, in seconds |
timeoutMs | 6000 | How long to wait for our answer before the meeting stays unchecked |
waitUntil | none | Keeps the work after the answer running on serverless hosts |
onResult | none | Called once per invitee and address handled, never with the address |
When something fails
If our API is slow, out of reach or out of credits, the meeting stays as it is and onResult says it was not checked. Calendly gives up on an answer after 15 seconds, so the receiver answers at once and does the work after the answer; on a serverless host, pass waitUntil so that work is not cut off. If Calendly refuses the token, nothing is checked or paid. Calendly retries a delivery that got an error answer and turns the subscription off after 24 hours of failures: then create it again.
What it costs
Each checked address uses one credit. unknown results, malformed addresses and test addresses are free. Copies of a delivery reaching one running server are one check; to share answers across several instances, pass a store (Workers KV, Redis, a table).
Privacy
The file writes no log line and puts no key, token or address in an error or an answer. onResult gets the event and invitee ids, whether it is a reschedule, the outcome, the action and our answer, never the address. The address goes only in the body of a request to our API, never in a URL.