Integrations
Validate phone numbers and emails in Airtable
Verify a column of emails or phone numbers in Airtable with an automation script, write the status and E.164 number back to the record and skip rows already checked.
Updated 2026-11-23
This recipe checks the email and phone number of new Airtable records with an automation script, and writes the status, the suggested correction and the E.164 number back to the record.
What you need
- An Airtable base with automations and the Run script action: check your plan.
- A Qelka API key entered as an input variable of the script action. A
sk_test_key returns simulated results and never spends credits: see Test mode. - Fields in your table:
Email(email or text),Phone(phone or text),Country(optional, a two-letter code), and result fieldsEmail status,Email suggestion,Phone E164(all single line text).
Steps
1. Create the automation
In Automations, create an automation with the trigger When record matches conditions: pick your table and the condition Email status is empty and Email is not empty. Add the action Run script.
2. Add the input variables
In the script action, add these input variables: recordId (the trigger record ID), email, phone, country (mapped to the fields), and apiKey (the key, as a text value).
3. The script
const { recordId, email, phone, country, apiKey } = input.config()
const table = base.getTable('Contacts')
async function post(path, body) {
for (let attempt = 1; attempt <= 3; attempt += 1) {
let response
try {
response = await fetch('https://api.qelka.com/v1' + path, {
method: 'POST',
headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
body: JSON.stringify(body),
})
} catch (error) {
console.log('validation skipped: unreachable')
return null
}
if (response.ok) return await response.json()
const retryable = [429, 500, 502, 503].includes(response.status)
if (retryable && attempt < 3) {
const retryAfter = Number(response.headers.get('Retry-After'))
await new Promise((resolve) => setTimeout(resolve, (retryAfter > 0 ? Math.min(retryAfter, 5) : attempt) * 1000))
continue
}
const failure = (await response.json()).error
console.log(`validation skipped: ${failure.type} request ${response.headers.get('X-Request-Id')}`)
return null
}
return null
}
const fields = {}
if (email) {
const result = await post('/email', { email, mode: 'fast' })
if (result) {
fields['Email status'] = result.status
fields['Email suggestion'] = result.did_you_mean ?? ''
}
}
if (phone) {
const result = await post('/phone', country ? { phone, country } : { phone })
if (result && result.status === 'valid') fields['Phone E164'] = result.e164
}
if (Object.keys(fields).length > 0) await table.updateRecordAsync(recordId, fields)
Replace Contacts with the name of your table. mode: 'fast' skips the mailbox check, which keeps the script short: see the email reference. If the API is unreachable or the key is wrong, the script logs the documented error type and the request id in the run history, writes nothing, and the record keeps matching the trigger condition, so you can run it again later.
4. Use the status
Create views and conditional colors on Email status:
| Value | Meaning | Suggested action |
|---|---|---|
undeliverable |
Bad syntax, no domain or no mailbox | Exclude from sends, show Email suggestion to the owner |
risky |
Disposable inbox, catch-all domain or full mailbox | Review by hand |
deliverable |
The mail server accepted the mailbox | Use normally |
unknown |
Not conclusive | Use, and re-check later |
Use Phone E164 for calling and messaging: a number without a + and without a country returns unknown. See the phone reference.
Handle errors and rate limits
No error is billed. 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. A key allows 200 requests per 10 seconds, then you get 429 rate_limited, and Retry-After says how long to wait. Each email check costs 1 credit. See Errors and Rate limits.
Related
Frequently asked questions
Can I keep the API key secret in Airtable?
Does the script run for existing rows?
Are there limits on automation scripts?
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