CRMs

Check phone numbers, country codes and carriers in Agile CRM

Validate phone numbers on Agile CRM contacts and write the clean number and its type back as contact properties.

Why the data matters in Agile CRM

Agile CRM contacts carry phone properties that drive calling, campaigns and lead scoring. A number stored with the wrong country code or in a free-text format breaks the click-to-call step and makes it hard to dedupe two records for the same person.

What LookValid checks

LookValid checks for Agile CRM
ProductWhat it does hereCredits
Phone Numbering-Plan ValidationReturns the number in E.164, national and international formats plus the type the numbering plan gives it. It does not know whether the line is active.1 credit per valid number
Country Calling CodesExplains a calling code or country name, with national number lengths and dialing prefixes, to fix numbers typed without a country.1 credit per lookup (an unknown code, country or name is free)
Carrier Lookup (original carrier)Returns the carrier first assigned a US number block and its state, not necessarily the carrier today.1 credit per lookup (numbers outside the covered numbering plan areas are free)
IP IntelligenceGives the country, network owner and hosting flags of an IP address from a web form, to compare against the phone country.1 credit per lookup

Connect it in four steps

  1. Make a LookValid account and create an API key from your dashboard.
  2. Put the key in LOOKVALID_API_KEY, and keep your Agile CRM REST key, found under Admin Settings, API & Analytics, in a second variable, since Agile uses it as the Basic auth password with your user email as the username.
  3. Call validate_agile_phone for each contact phone, skipping the contact when the answer is found:false and stopping the run on an error so the code and fix are visible.
  4. Send phone_e164, phone_type and phone_country to the contact with PUT dev/api/contacts/edit-properties, which changes only the properties you send.

A Python script on your own machine or scheduler that reads contacts through the Agile CRM REST API and updates their properties. The call is POST https://YOUR_API_HOST/v1/phone and costs 1 credit per valid number.

validate_agile_phone.py
import json
import os
import urllib.error
import urllib.request
​
API_URL = "https://YOUR_API_HOST/v1/phone"
​
​
def validate_agile_phone(value):
    request = urllib.request.Request(
        API_URL,
        data=json.dumps({
            "phone": value,
        }).encode(),
        headers={
            "Authorization": "Bearer " + os.environ["LOOKVALID_API_KEY"],
            "Content-Type": "application/json",
        },
        method="POST",
    )
    try:
        with urllib.request.urlopen(request, timeout=30) as response:
            result = json.load(response)
    except urllib.error.HTTPError as error:
        failure = json.load(error)["error"]
        raise RuntimeError(failure["code"] + ": " + failure["fix"])
    if not result["found"]:
        return None
    return {
        "phone_e164": result.get("data", {}).get("e164"),
        "phone_type": result.get("data", {}).get("number_type"),
        "phone_country": result.get("data", {}).get("country"),
    }
Where each response field goes in Agile CRM
Response fieldGoes into
data.e164phone_e164
data.number_typephone_type
data.countryphone_country

The recipe returns nothing when the lookup finds nothing, which costs no credits for this product, and stops with the error code and fix on a failed request.

Without code

To avoid a script, use an automation platform with a generic HTTP request step and no dedicated app. Trigger on a new contact in Agile CRM, send the phone to the LookValid phone endpoint in an HTTP step, and use a second HTTP step to call the edit-properties endpoint with the returned type.

REST and MCPOne shared credit balance

Questions

What does it cost per contact?

One phone lookup per number, at the credit rate on the pricing page.

Can it change tags or lead score?

The edit-properties call changes properties only. Agile documents separate endpoints for tags and lead score, so use those if you want the result to tag a contact.

Where do the keys go?

Each in its own environment variable of the script host: your LookValid key as a Bearer header, and the Agile CRM key with your email as Basic auth.

Sources

LookValid is run by Meralume Labs. It is not connected to, endorsed by or a partner of any company or product named on this page, and every product name belongs to its owner.

LookValid bills every lookup in credits from one shared balance, so the same key works for each check above.

See Phone Numbering-Plan Validation