Integrations
Validate phone numbers and emails in Typeform
Check the email and phone answers of each Typeform response with a signed webhook receiver and the SDK, then flag or clean the contact in your own system.
Updated 2026-11-23
This recipe receives the Typeform response webhook, checks the email and phone answers and hands the verdict to your own code to flag or clean the contact. Typeform has no native Qelka integration, so a small receiver sits in between.
What you need
- A Typeform account with webhooks for your form: check your plan.
- A Qelka API key in the
API_KEYenvironment variable. Ask_test_key returns simulated results and never spends credits: see Test mode. - A small server that Typeform can reach over HTTPS, such as the one below, with the webhook secret in
TYPEFORM_SECRET: see Authentication for keeping keys server-side.
Steps
1. The receiver
import crypto from 'node:crypto'
import express from 'express'
import { ApiConnectionError, ApiError, Client } from '@qelka/sdk'
const client = new Client({ apiKey: process.env.API_KEY, timeoutMs: 8000 })
const app = express()
function signatureIsValid(rawBody, header) {
if (!header) return false
const expected = 'sha256=' + crypto.createHmac('sha256', process.env.TYPEFORM_SECRET).update(rawBody).digest('base64')
const received = Buffer.from(header)
const wanted = Buffer.from(expected)
return received.length === wanted.length && crypto.timingSafeEqual(received, wanted)
}
app.post('/typeform', express.raw({ type: '*/*' }), async (req, res) => {
if (!signatureIsValid(req.body, req.get('Typeform-Signature'))) return res.sendStatus(401)
const response = JSON.parse(req.body.toString('utf8')).form_response
const answers = response?.answers ?? []
const email = answers.find((answer) => answer.type === 'email')?.email
const phone = answers.find((answer) => answer.type === 'phone_number')?.phone_number
const verdict = { token: response?.token, emailStatus: 'unchecked', suggestion: null, e164: null }
const settle = async (task) => {
try {
await task()
} catch (error) {
if (!(error instanceof ApiError) && !(error instanceof ApiConnectionError)) throw error
console.error('validation skipped', error instanceof ApiError ? `${error.type} ${error.requestId}` : 'unreachable')
}
}
await Promise.all([
email &&
settle(async () => {
const result = await client.email.verify({ email })
verdict.emailStatus = result.status
verdict.suggestion = result.did_you_mean
}),
phone &&
settle(async () => {
const result = await client.phone.validate({ phone })
if (result.status === 'valid') verdict.e164 = result.e164
}),
])
await saveVerdict(verdict)
res.sendStatus(200)
})
app.listen(3000)
saveVerdict is your own function: it updates your database or CRM, keyed on the response token. The route answers 200 even when the API was unreachable, so Typeform does not retry a response you already handled, and the verdict simply says unchecked. Typeform phone answers usually include the country code. If yours do not, pass a country to the phone check.
2. Add the webhook
In the form, open Connect, then Webhooks, and add the public HTTPS URL of the receiver, for example https://example.com/typeform. Set a secret, put the same value in TYPEFORM_SECRET, and turn the webhook on. Submit a test response and check that your function is called.
3. Use the verdict
| Verdict | Suggested action |
|---|---|
Email undeliverable |
Flag the contact, do not send confirmation emails, show suggestion to the team |
Email risky |
Send nothing automatic, review by hand |
Email deliverable |
Send the confirmation as usual |
Email unknown or unchecked |
Continue, and re-check later |
Phone e164 present |
Store it and use it for calling and messaging |
See the email reference and the phone reference for every field.
Handle errors and rate limits
No error is billed. The SDK retries 429, 502 and 503 responses, waiting Retry-After when present. After 200 requests per 10 seconds on one key you get 429 rate_limited. 401 invalid_api_key and 403 forbidden mean a wrong or restricted key. 402 insufficient_credits means an empty balance: alert yourself and keep failing open. Each email check costs 1 credit. See Errors and Rate limits.
Related
Frequently asked questions
Can I block a Typeform submission with a bad email?
How do I trust the webhook request?
Does the person get an error message?
Put this check in your product
Get an API key in under a minute. 100 free credits every month, no card required.
- 100 free credits a month
- No card
- Test keys spend nothing
- Cancel any time