Skip to content

Automation

Validate phone numbers and emails in Activepieces

Check emails and phone numbers in an Activepieces flow with the HTTP piece, keep the key in a project variable and route the answer with a Router.

Updated 2026-11-26

This recipe validates an email or a phone number inside an Activepieces flow. The HTTP piece calls the API, a small Code step turns the answer into one clear verdict, and a Router sends each record down the right branch. There is no native Qelka piece: the HTTP piece is all you need, on Activepieces Cloud and on a self-hosted instance alike.

What you need

  • An Activepieces account on Cloud, or a self-hosted instance that can reach https://api.qelka.com over HTTPS. If your admin restricts outbound traffic with AP_NETWORK_MODE=STRICT, public hosts stay reachable; only private ranges are blocked.
  • A Qelka API key. A sk_test_ key returns simulated results and never spends credits: see Test mode.
  • A trigger that provides an email or phone number: the Catch Webhook trigger of the Webhook piece, the Web Form trigger, or any app trigger.

Create a key for Activepieces only and restrict it to /email and /phone in the dashboard, so a leaked key cannot start bulk jobs on your balance. See Restricted keys.

Steps

1. Store the key in a project variable

Open Variables in the left sidebar and click New variable. Name it QELKA_API_KEY (letters, numbers and underscores only; it cannot be renamed later), paste your key as the value and click Create. Any step of any flow in the project can now use it as {{variables['QELKA_API_KEY']}}. To rotate the key later, use Rotate value on the variable: every flow picks up the new key on its next run.

Project Variables are a recent feature. If your plan or self-hosted version does not show them, check with your admin before falling back to a value typed in the step.

2. Add the trigger

Create a flow. For data posted by a form or another system, use the Webhook piece's Catch Webhook trigger and send it a test request:

bash
curl -X POST "YOUR_CATCH_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"email": "jane@example.com", "phone": "(415) 555-0123", "country": "US"}'

Or use the Forms piece's Web Form trigger, which gives you a hosted form. Test the trigger so its data shows up in the Data Selector of the next steps.

3. Call the API with the HTTP piece

Add the HTTP piece and its Send HTTP request action, and name the step verify_email. Fill it like this:

Field Value
Method POST
URL https://api.qelka.com/v1/email
Headers Authorization = Bearer {{variables['QELKA_API_KEY']}}, and Content-Type = application/json
Authentication None (the key travels in the header above)
Body Type JSON
JSON Body {"email": "[email from the trigger]", "mode": "fast"}
Timeout 10
On Failure Continue flow on all errors

Insert the email from the Data Selector where the placeholder is, keeping the quotes. Timeout and On Failure are among the piece's advanced options.

mode: "fast" runs the syntax, DNS, disposable and role checks and skips the mailbox check, so the request never waits on the recipient's mail server. When those checks pass, it answers unknown with the reason smtp_not_checked. For flows where waiting is fine, "mode": "full" can answer deliverable; raise the timeout to 15 then. See the email reference.

Continue flow on all errors is what keeps the flow alive when the API refuses a call or cannot be reached. The step then succeeds with the error response as its output instead of stopping the run. With the other choices, some errors stop the run: Do not continue stops on any error, and the options that retry server errors stop the flow once their retries run out.

Test the step. On success, its output holds the HTTP status, the response headers and the answer in body, with body.status, body.reason and body.did_you_mean.

4. Turn the output into a verdict

Successful and failed calls produce outputs of different shapes. Add a Code step, named verdict, with one input answer mapped to the whole output of verify_email from the Data Selector, and this code:

javascript
export const code = async (inputs) => {
  const answer = inputs.answer ?? {}
  const body = answer.body ?? {}

  if (typeof body.status === 'string') {
    return {
      status: body.status,
      reason: body.reason ?? null,
      did_you_mean: body.did_you_mean ?? null,
      request_id: answer.headers?.['x-request-id'] ?? null,
    }
  }

  const failure = answer.response?.body
  const type = typeof failure === 'object' && failure?.error?.type ? failure.error.type : 'no_answer'
  return { status: 'unchecked', reason: type, did_you_mean: null, request_id: null }
}

The code makes no network call, so it runs in any sandbox. A record whose call failed gets unchecked, with the documented error type, such as insufficient_credits, in reason. The failure output carries no response headers, so the request id is only kept for successful calls.

5. Route with a Router

Add a Router after verdict and give each branch a text condition on verdict's status:

Branch Condition What to do
Bad email status equals undeliverable Tag the record, and tell the person when did_you_mean is set
Review status equals risky Add to a review table or a CRM list
Not checked status equals unchecked Store it, alert yourself if reason is invalid_api_key or insufficient_credits, re-check later
Otherwise anything else Continue the normal flow

The Otherwise branch is always present and always last: it receives deliverable and unknown. An unknown email is not a bad email; the checks could not conclude, so confirm it by sending a message. The email reference lists every reason.

Phone numbers

Duplicate verify_email as verify_phone, with the URL https://api.qelka.com/v1/phone and the JSON body {"phone": "[phone from the trigger]", "country": "US"}. The country value is a two-letter code that tells the API how to read a number written without a +; map it from a form field if you collect one. Change the Code step to read body.e164 and body.line_type, and route on status: valid means store e164, invalid means ask for a correction, unknown means the number had no + and no country. Read line_type before you send SMS, since a landline usually cannot receive them. See the phone reference.

Self-hosted instances

The flow above runs unchanged on a self-hosted instance. Two differences are worth knowing:

  • The sandbox mode is the admin's choice, through AP_EXECUTION_MODE. In SANDBOX_CODE_ONLY, Code steps run without network access, as on Cloud. In UNSANDBOXED or SANDBOX_PROCESS, a Code step can call the API with fetch itself, but the HTTP piece stays the simpler way to do it.
  • The instance makes the request, so its outbound firewall must allow HTTPS to https://api.qelka.com.

Handle errors and rate limits

No error is billed. With On Failure set to continue, every error ends as unchecked: 401 invalid_api_key and 403 forbidden mean a wrong or restricted key, 402 insufficient_credits an empty balance, and the Not checked branch is where you alert yourself. A 429 rate_limited also ends as unchecked here, since the piece does not wait for Retry-After; check those records again later. See Errors.

A key allows 200 requests per 10 seconds. A flow that loops over a large table can pass it: add a Delay step inside the loop, or send up to 100 values in one call to https://api.qelka.com/v1/batch, which counts as one request. See Rate limits and the batch reference.

Each email check costs 1 credit and each basic phone check 1. Store the verdict with the record and skip records that already have one. For a whole export, a bulk file check is simpler.

Frequently asked questions

Is there a native Activepieces piece?
No. There is no Qelka piece. The built-in HTTP piece and its Send HTTP request action reach every endpoint, because the API is plain HTTPS and JSON with one Authorization header. The same flow works on Activepieces Cloud and on a self-hosted instance.
Where should the API key go in Activepieces?
In a project variable. Open Variables in the left sidebar, create one, and reference it in any step as variables['NAME'] between double braces. Activepieces encrypts the value at rest, never shows it in the variables list, and writes REDACTED in place of it in run details. Do not paste the key in the HTTP piece's Token field: its own description warns that it is stored in the flow and visible in exports.
Can a Code step call the API?
Not on Activepieces Cloud, as far as we can tell. Its documentation says Cloud runs Code steps in a V8 isolate sandbox, and the open source engine gives code in that sandbox no network access. Call the API with the HTTP piece, and use a Code step only to shape the answer, as below. On a self-hosted instance in UNSANDBOXED or SANDBOX_PROCESS mode, Code steps can use fetch.

More in Automation

All integrations

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