---
title: "Validate contact data in Agile CRM"
url: "https://lookvalid.com/integrations/agile-crm.md"
canonical_url: "https://lookvalid.com/integrations/agile-crm"
last_updated: "2026-10-30"
type: "how-to"
summary: "Validate phone numbers on Agile CRM contacts and write the clean number and its type back as contact properties."
related: ["https://lookvalid.com/integrations.md", "https://lookvalid.com/docs/api/phone.md", "https://lookvalid.com/docs/quickstart.md"]
---

# Validate contact data in Agile CRM

> **For AI agents:** the complete index of LookValid pages is [llms.txt](https://lookvalid.com/llms.txt). Every page is also served as markdown at its URL plus .md.

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

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

- [Phone Numbering-Plan Validation](https://lookvalid.com/products/phone.md): Returns 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 Codes](https://lookvalid.com/products/country-code.md): Explains 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)](https://lookvalid.com/products/carrier-lookup.md): 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 Intelligence](https://lookvalid.com/products/ip.md): Gives 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`.

```python
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"),
    }
```

| Response field | Goes into |
| --- | --- |
| `data.e164` | phone_e164 |
| `data.number_type` | phone_type |
| `data.country` | phone_country |

## 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.

## 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

- [Agile CRM REST API documentation (agilecrm/rest-api README, dev/api/contacts/edit-properties)](https://github.com/agilecrm/rest-api/blob/master/README.md), read 2026-10-30

## Related

- [Tool integrations for phone, email and IP checks](https://lookvalid.com/integrations.md)
- [Phone Numbering-Plan Validation reference](https://lookvalid.com/docs/api/phone.md)
- [Quickstart](https://lookvalid.com/docs/quickstart.md)
