Integrations · Zapier

Validate Phone Numbers via Zapier

Build a Zap that checks the phone number on every new HubSpot contact. Carrier, line type and ported status land on the contact.

Your first $5 of validations are on us, valid for 30 days. No card required.

score.phone.validation.mnpWebhooks by ZapierHubSpot

What you'll build

TriggerHubSpot New Contact
ActionWebhooks by Zapier Custom Requestscore.phone.validation.mnp
FilterFilter by Zapier Only continue if a result came back
ActionHubSpot Update Contact

One run per new contact. Five results and the time of the check land on the contact.

Before You Start

01

A ScoreMachine account. Create your workspace with Start free. Your first $5 of validations are on us, valid for 30 days. No card required.

02

A long-lived API key. Ask your account manager for one. The key goes in the Token header of every request, where a login token would go. No key yet? The If You Have No API Key section logs in with your email and password.

03

Zapier Professional or higher. Webhooks by Zapier runs on the Professional, Team and Enterprise plans. The Free plan does not include it.

04

Permission to create HubSpot properties. Step 01 adds six properties to the contact record.

Build It Step by Step

Six steps. The Zap runs every time HubSpot creates a contact.

01

Create the properties in HubSpot

In HubSpot's property settings, create a contact property group named ScoreMachine. Add these six properties to the group.

Property labelField type
Phone validSingle checkbox
Line typeSingle-line text
CarrierSingle-line text
PortedSingle checkbox
Phone E.164Single-line text
Phone checked atDate picker
02

Start the Zap with a new HubSpot contact

Create a Zap and pick HubSpot as the trigger. Connect your HubSpot account, then test the trigger.

AppHubSpot
Trigger eventNew Contact

The test pulls a recent contact. Its Phone Number field holds the number to check.

03

Send the number to ScoreMachine

Add an action step with Webhooks by Zapier and pick Custom Request. Custom Request sends the Data field exactly as you enter it.

Action eventCustom Request
MethodPOST
URLhttps://api.scoremachine.ai
Datathe request body below
HeadersContent-Type → application/json
Accept → application/json
Token → <your API key>
DATA · score.phone.validation.mnp
{
  "jsonrpc": "2.0",
  "method": "score.phone.validation.mnp",
  "params": {
    "phones": ["PHONE"]
  },
  "id": 1
}

Replace PHONE with the Phone Number field from step 1. Keep the quotes on both sides of the field.

phones takes numbers in E.164 format, such as +447911123456. geo_iso_code is optional and takes a two-letter ISO country code.

The test output holds result, with phone_validation_mnp inside it.

04

Stop the Zap when no result came back

Add Filter by Zapier. A failed call returns error in place of result. The filter stops the Zap before it writes to HubSpot.

Only continue if…result[0].phone · step 3
ConditionExists
05

Write the results back to the contact

Add a HubSpot action with the Update Contact event. Pick the contact from step 1, then map each property.

Action eventUpdate Contact
ContactContact ID · step 1
Phone validresult[0].valid · step 3
Line typeresult[0].phone_validation_mnp.line_type · step 3
Carrierresult[0].phone_validation_mnp.carrier · step 3
Portedresult[0].phone_validation_mnp.ported · step 3
Phone E.164result[0].phone_validation_mnp.e164_format · step 3
Phone checked at{{zap_meta_human_now}}

Zapier names each field after its path in the response. Pick the field whose path is shown above.

{{zap_meta_human_now}} is Zapier's built-in value for the time the Zap runs.

06

Test the Zap and publish it

Test the HubSpot step, then open the contact in HubSpot. When the six properties hold values, publish the Zap.

Line type mobile · Carrier Vodafone · Ported true · Phone E.164 +447911123456

Map the Results

Six fields land on the record. Five come from the response, and one is the time of the check.

HubSpot fieldScoreMachine fieldWhat it holds
Phone validresult[0].validtrue when the number fits a numbering range
Line typeresult[0].phone_validation_mnp.line_typemobile, landline or voip
Carrierresult[0].phone_validation_mnp.carrierThe network serving the number today, after porting
Portedresult[0].phone_validation_mnp.portedtrue when the number moved from the network that issued the range
Phone E.164result[0].phone_validation_mnp.e164_formatThe number in E.164, ready for a dialer or an SMS route
Phone checked atthe platform's run timeWhen the check ran

valid says whether the number fits a numbering range. It does not say whether the number is in use. score.phone.ehlr answers that.

mcc and mnc identify the serving network by its mobile country and network codes. Add two text fields to store them.

Errors and Limits

01

Errors arrive as HTTP 200

A failed call returns an error object in place of result. The object carries code, message and optional data. An account with no funds left returns code -32004 and the message Low balance. The filter in step 04 stops the run. Zap history lists the run as filtered, and HubSpot is left unchanged.

02

Retry network failures

A timed-out request shows as an error in Zap history. Replay the run from Zap history once the request can go through.

03

Limits

Up to 20 requests per second. 2 seconds average response. Up to 10,000 numbers per request. A flow that runs once per new record sends one request per record.

For records already in your CRM, export a CSV and upload the file in your workspace. Uploads take up to 5 MB and 200,000 rows.

If You Have No API Key

auth.login takes your email and password. The token arrives in the Token response header, and it lasts 24 hours.

Webhooks by Zapier does not pass response headers to later steps. The token arrives in a header. A Code by Zapier step replaces step 03. The code logs in, then runs the check.

A

Replace step 03 with a code step

Delete step 03 and add Code by Zapier in its place, with the Run JavaScript event.

AppCode by Zapier
Action eventRun JavaScript
Input Dataphone → Phone Number · step 1
email → you@company.com
password → ********
Codethe code below
CODE · auth.login + score.phone.validation.mnp
const url = "https://api.scoremachine.ai";
const headers = {
  "Content-Type": "application/json",
  Accept: "application/json",
};

const login = await fetch(url, {
  method: "POST",
  headers,
  body: JSON.stringify({
    jsonrpc: "2.0",
    method: "auth.login",
    params: {
      email: inputData.email,
      password: inputData.password,
    },
    id: 1,
  }),
});
const token = login.headers.get("Token");

const check = await fetch(url, {
  method: "POST",
  headers: { ...headers, Token: token },
  body: JSON.stringify({
    jsonrpc: "2.0",
    method: "score.phone.validation.mnp",
    params: { phones: [inputData.phone] },
    id: 2,
  }),
});
const body = await check.json();

if (body.error) {
  return { error: body.error.message };
}

const item = body.result[0];
const mnp = item.phone_validation_mnp;

return {
  phone: item.phone,
  valid: item.valid,
  line_type: mnp.line_type,
  carrier: mnp.carrier,
  ported: mnp.ported,
  e164_format: mnp.e164_format,
};

Code by Zapier runs for up to 30 seconds on Professional and Team plans. The Free plan allows 1 second, too short for two requests.

B

Point steps 04 and 05 at the code step

The code step returns flat fields named phone, valid, line_type, carrier, ported and e164_format. In step 04, filter on Phone. In step 05, map each property to the field of the same name.

The password sits in the Zap. Anyone who can edit it can read the password. Ask your account manager for an API key when you can.

Frequently asked questions

Check Every New HubSpot Contact

Create your workspace, or walk through your stack with our team.

Make guiden8n guideCRM integrationsAPI reference at doc.scoremachine.ai