CRM
Validate phone numbers and emails in monday.com
Check the email and phone column of each new monday.com item with a create_item webhook and a handler that sets status and text columns over GraphQL.
Updated 2026-11-26
This recipe checks the email and phone columns of every item created on a monday.com board, such as a leads or applicants board, and fills a status column and a text column with the result. There is no native Qelka app for monday.com: a board webhook calls a small handler of yours, which reads the item through monday.com's GraphQL API, calls our API and sets the columns with one mutation.
What you need
- A monday.com board with an Email column and a Phone column, and a personal API token. monday.com shows it in the Developer Center, opened from your profile picture, under API token; the token is sent as is in the
Authorizationheader. - Two more columns on the board: a Status column named
Email statusand a Text column namedPhone E.164. The handler creates the status labels it needs, which requires permission to change the board's structure. - A Qelka API key. A
sk_test_key returns simulated results and never spends credits: see Test mode. A restricted key limited toemailandphoneis enough. - A place to run the handler that receives a web
Request: Cloudflare Workers or Vercel below, or any server through a framework such as Hono.
Steps
1. Read the board and column ids
The board id is the number in the board's URL. Read the column ids with a query in the API playground of the Developer Center:
query {
boards(ids: [1234567890]) {
columns {
id
title
type
}
}
}
Note the ids of the Email, Phone, Email status and Phone E.164 columns.
2. The handler
Save as monday-webhook.js:
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
function safeEqual(a, b) {
if (a.length !== b.length) return false
let difference = 0
for (let index = 0; index < a.length; index += 1) difference |= a.charCodeAt(index) ^ b.charCodeAt(index)
return difference === 0
}
async function check(env, path, body, timeoutMs) {
for (let attempt = 1; attempt <= 2; attempt += 1) {
let response
try {
response = await fetch(`https://api.qelka.com/v1${path}`, {
method: 'POST',
headers: { Authorization: `Bearer ${env.QELKA_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify(body),
signal: AbortSignal.timeout(timeoutMs),
})
} catch (error) {
console.warn(`check skipped: ${path} unreachable (${error.name})`)
return null
}
if (response.ok) return response.json()
if (attempt === 1 && [429, 500, 502, 503].includes(response.status)) {
const retryAfter = Number(response.headers.get('Retry-After'))
await sleep((retryAfter > 0 ? Math.min(retryAfter, 5) : 1) * 1000)
continue
}
const failure = await response.json().catch(() => ({}))
console.warn(`check skipped: ${failure.error?.type ?? response.status} request ${response.headers.get('X-Request-Id')}`)
return null
}
return null
}
async function monday(env, query, variables) {
const response = await fetch('https://api.monday.com/v2', {
method: 'POST',
headers: { Authorization: env.MONDAY_TOKEN, 'Content-Type': 'application/json' },
body: JSON.stringify({ query, variables }),
signal: AbortSignal.timeout(8000),
})
const result = await response.json()
if (!response.ok || result.errors) throw new Error(`monday.com ${response.status} ${JSON.stringify(result.errors ?? result)}`)
return result.data
}
const readItem = `query ($itemId: ID!, $columns: [String!]) {
items(ids: [$itemId]) {
column_values(ids: $columns) {
id
text
... on EmailValue { email }
... on PhoneValue { phone country_short_name }
}
}
}`
const setColumns = `mutation ($itemId: ID!, $boardId: ID!, $values: JSON!) {
change_multiple_column_values(item_id: $itemId, board_id: $boardId, column_values: $values, create_labels_if_missing: true) { id }
}`
async function checkItem(env, itemId, boardId) {
const columns = [env.EMAIL_COLUMN, env.PHONE_COLUMN, env.STATUS_COLUMN, env.E164_COLUMN]
const data = await monday(env, readItem, { itemId: String(itemId), columns })
const byId = Object.fromEntries((data.items[0]?.column_values ?? []).map((value) => [value.id, value]))
if (byId[env.STATUS_COLUMN]?.text || byId[env.E164_COLUMN]?.text) return
const email = byId[env.EMAIL_COLUMN]?.email
const phone = byId[env.PHONE_COLUMN]?.phone
const country = byId[env.PHONE_COLUMN]?.country_short_name || env.DEFAULT_COUNTRY || undefined
const [emailResult, phoneResult] = await Promise.all([
email ? check(env, '/email', { email, mode: 'full' }, 15000) : null,
phone ? check(env, '/phone', { phone, country }, 8000) : null,
])
const values = {}
if (email) values[env.STATUS_COLUMN] = { label: emailResult ? emailResult.status : 'unchecked' }
if (phone) values[env.E164_COLUMN] = !phoneResult ? 'unchecked' : phoneResult.status === 'valid' ? phoneResult.e164 : phoneResult.status
if (Object.keys(values).length === 0) return
await monday(env, setColumns, { itemId: String(itemId), boardId: String(boardId), values: JSON.stringify(values) })
}
export async function handle(request, env, waitUntil) {
if (request.method !== 'POST') return new Response(null, { status: 405 })
const token = new URL(request.url).searchParams.get('token') ?? ''
if (!safeEqual(token, env.WEBHOOK_TOKEN)) return new Response(null, { status: 401 })
const payload = await request.json().catch(() => ({}))
if (payload.challenge) return Response.json({ challenge: payload.challenge })
const event = payload.event
if (!event?.pulseId || !event.boardId) return new Response(null, { status: 204 })
waitUntil(checkItem(env, event.pulseId, event.boardId).catch((error) => console.error(`item check failed: ${error.message}`)))
return new Response(null, { status: 204 })
}
The challenge comes first: monday.com posts {"challenge": "..."} when the webhook is created and expects the same JSON back. Every other request is an event wrapped in an event object, where pulseId is the item id and boardId the board. The handler answers at once and works in the background, because monday.com retries a failed delivery once a minute for 30 minutes, according to its docs.
The phone column stores a country next to the number, and the handler sends it as country, so numbers typed without + are read correctly. mode: 'full' runs the mailbox check, the only way to get deliverable; if your host stops background work early, use mode: 'fast', which answers unknown with smtp_not_checked when the other checks pass. See the email reference and the phone reference.
A GraphQL API can answer 200 and still list failures in errors, which is why the helper checks both. A failed write is logged with monday.com's message.
3. Deploy it with its secrets
import { handle } from './monday-webhook.js'
export default {
fetch: (request, env, ctx) => handle(request, env, (task) => ctx.waitUntil(task)),
}
import { waitUntil } from '@vercel/functions'
import { handle } from '../monday-webhook.js'
export default {
fetch: (request) => handle(request, process.env, waitUntil),
}
On Vercel the entry file is api/monday.js, with "type": "module" in package.json. Store as secrets (wrangler secret put or vercel env add): QELKA_API_KEY, MONDAY_TOKEN, WEBHOOK_TOKEN (a long random string), EMAIL_COLUMN, PHONE_COLUMN, STATUS_COLUMN, E164_COLUMN and, optionally, DEFAULT_COUNTRY.
4. Create the webhook
Run this mutation in the API playground, with your board id and the handler URL followed by ?token= and your WEBHOOK_TOKEN:
mutation {
create_webhook(board_id: 1234567890, url: "https://your-handler.example.com/?token=YOUR_WEBHOOK_TOKEN", event: create_item) {
id
board_id
}
}
monday.com limits the URL to 255 characters, so keep the token reasonable, 32 to 64 random characters. The challenge runs right away: if the mutation fails, check that the handler is deployed and that the token matches. You can also add a webhook from the board's Integrations panel; the API route makes the event and URL explicit.
5. Test it
With a sk_test_ key, add an item whose email is disposable@example.com. A few seconds later, Email status shows the label risky. undeliverable@example.com gives undeliverable, any other well-formed address deliverable; phone numbers are parsed for real. Then swap in a live key, and give the labels the colors you want.
6. Use the result
Email status |
Meaning | Suggested action |
|---|---|---|
undeliverable |
Bad syntax, no domain, or the mailbox was refused | Ask for another address, or move the item to a "Fix contact" group |
risky |
Disposable inbox, catch-all domain or full mailbox | Review before emailing |
deliverable |
The mail server accepted the mailbox | Nothing to do |
unknown or unchecked |
Not conclusive, or the API was unreachable | Keep the item, check again later |
A board automation on the status column can move items, notify the owner or create a follow-up. An unknown email is not a bad email, so never delete an item on it. Phone E.164 holds the number in E.164 when it is valid, or invalid, unknown or unchecked: see Format phone numbers in E.164.
Handle errors and rate limits
Every API problem ends as unchecked, logged with the error type and the X-Request-Id; the item is never blocked. No error is billed. 401 and 403 mean a wrong or restricted key and 402 an empty balance: alert on those. A 429 is retried once after Retry-After. A key allows 200 requests per 10 seconds, which an import of a large spreadsheet into the board can exceed: check such files with a bulk file check first. Each email check costs 1 credit and each basic phone check 1. See Errors and Rate limits.
monday.com's API has complexity and rate limits of its own, so the handler keeps to one query and one mutation per item.
Related
Frequently asked questions
What is the challenge request monday.com sends?
How does the handler know a request comes from monday.com?
Will setting the columns trigger the webhook again?
More in CRM
All integrationsPut 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