FeaturesLead Validation

Lead Validation

Lead validation ensures only high-quality leads enter your system. Ledly provides built-in validations and allows you to create custom rules.

How Validation Works

When a lead is submitted, it passes through multiple validation stages:

Lead Received → Format Validation → Domain Validation → Custom Rules → Accept/Reject

Failed validations result in immediate rejection with a clear error message.


Built-in Validations

Email Validation

CheckDescriptionExample Failure
FormatValid email syntaxnot-an-email
DomainHas MX records[email protected]
DisposableNot a temporary email[email protected]
Typo DetectionCommon typos flagged[email protected]

Typo detection suggests corrections (e.g., “Did you mean gmail.com?”) but may still accept the lead based on your settings.

Phone Validation

CheckDescription
FormatValid phone number format
LengthMinimum 10 digits
Country CodeValid international prefix

Required Fields

Configure which fields must be present:

FieldDefault
emailRequired
first_nameOptional
last_nameOptional
phoneOptional
programOptional

Bot Detection

Ledly automatically detects bot submissions:

Honeypot Fields

Hidden fields that real users won’t fill out. If populated, the lead is rejected.

<!-- Add to your form (hidden via CSS) -->
<input type="text" name="website" style="display:none" />

If website has a value, the lead is flagged as a bot.

Submission Speed

Leads submitted too quickly (under 3 seconds after page load) are flagged.

SpeedAction
< 1 secondReject
1-3 secondsFlag for review
> 3 secondsAccept

IP Reputation

High-risk IP addresses (known VPNs, proxies, data centers) can be:

  • Rejected automatically
  • Flagged for manual review
  • Allowed (for legitimate use cases)

Disposable Email Detection

Ledly blocks 100+ known disposable email providers:

Blocked Domains (partial list):

  • mailinator.com
  • tempmail.com
  • guerrillamail.com
  • 10minutemail.com
  • throwaway.email
  • fakeinbox.com
  • sharklasers.com
  • …and more
⚠️

Some legitimate users use disposable emails. Consider flagging instead of rejecting if your audience warrants it.

Managing the Block List

  1. Go to SettingsValidationEmail Domains
  2. View the default blocked list
  3. Add custom domains to block
  4. Add exceptions (allow specific domains)

Custom Validation Rules

Create custom rules for your specific requirements.

Go to SettingsValidation Rules

Create New Rule

Click Add Rule

Configure the Rule

  • Name: Descriptive name
  • Field: Which field to validate
  • Condition: The validation logic
  • Action: Reject, flag, or transform

Set Priority

Lower numbers run first

Save and Enable

Save the rule and toggle it on

Rule Types

TypeDescriptionExample
RequiredField must be presentphone is required
FormatRegex pattern matchzip matches /^\d{5}$/
LengthMin/max lengthfirst_name min 2 chars
RangeNumeric rangeage between 18 and 100
WhitelistMust be in liststate in ["CA", "NY", "TX"]
BlacklistMust not be in listemail not contains "test"
ComparisonCompare to another fieldconfirm_email equals email

Example Rules

US Phone Numbers Only:

Field: phone
Condition: matches pattern "^\\+?1?\\d{10}$"
Action: Reject with "US phone numbers only"

Minimum Age 18:

Field: age
Condition: greater than or equal to 18
Action: Reject with "Must be 18 or older"

Valid Program Codes:

Field: program_code
Condition: in list ["MBA", "MSN", "MSW", "DBA"]
Action: Reject with "Invalid program code"

Block Competitor Domains:

Field: email
Condition: not ends with "@competitor.edu"
Action: Reject with "Email domain not allowed"

Domain Validation

Email Domain Whitelist

Only accept leads from specific domains:

Allowed domains:
- @company.edu
- @university.org
- @school.edu

Email Domain Blacklist

Block leads from specific domains:

Blocked domains:
- @mailinator.com
- @competitor.com
- @test.com

MX Record Checking

Verify the email domain has valid mail servers:

MX StatusDefault Action
Valid MX recordsAccept
No MX recordsReject
DNS timeoutAccept (with warning)

Validation Actions

When validation fails, you can:

Reject

Stop processing and return an error:

{
  "success": false,
  "error": "Validation failed",
  "details": [
    { "field": "email", "message": "Invalid email format" }
  ]
}

Flag for Review

Accept the lead but mark for manual review:

{
  "success": true,
  "lead_id": "lead_abc123",
  "flags": ["manual_review"],
  "message": "Lead accepted with warnings"
}

Transform

Automatically fix the issue:

  • Trim whitespace from names
  • Format phone numbers
  • Lowercase emails
  • Title case names

Warn

Accept the lead but include a warning:

{
  "success": true,
  "lead_id": "lead_abc123",
  "warnings": [
    { "field": "email", "message": "Possible typo detected" }
  ]
}

Validation by Source

Configure different validation rules per vendor or source:

SourceEmail RequiredPhone RequiredDuplicate Check
Web FormYesNo24 hours
Vendor AYesYes7 days
Vendor BYesNo30 days
API DirectYesNo1 hour

Setting Source-Specific Rules

  1. Go to Vendors → Select vendor
  2. Click Validation Settings
  3. Configure source-specific rules
  4. Save

Rejected Leads

Viewing Rejections

  1. Go to LeadsRejected Leads
  2. Filter by date, reason, or source
  3. Click any rejection for details

Rejection Reasons

ReasonDescription
invalid_emailEmail format or domain invalid
disposable_emailTemporary email service detected
missing_requiredRequired field not provided
failed_custom_ruleCustom validation rule failed
duplicateDuplicate lead detected
bot_detectedBot submission suspected
rate_limitedSource exceeded rate limit

Exporting Rejections

  1. Go to LeadsRejected Leads
  2. Apply filters as needed
  3. Click Export
  4. Download CSV with rejection details

Testing Validation

Test a Lead

  1. Go to SettingsValidation Rules
  2. Click Test Validation
  3. Enter test lead data
  4. Click Run Test
  5. See which validations pass/fail

Example Test

Input:

{
  "email": "[email protected]",
  "first_name": "J",
  "phone": "invalid"
}

Output:

❌ Email: Disposable email domain blocked
❌ First Name: Minimum 2 characters required
❌ Phone: Invalid phone format

API Reference

Validate a Lead (without submitting)

POST /api/validation/check
 
{
  "email": "[email protected]",
  "first_name": "John",
  "phone": "555-1234"
}

Response:

{
  "valid": true,
  "warnings": [],
  "errors": []
}

Get Validation Rules

GET /api/validation

Create Validation Rule

POST /api/validation
 
{
  "name": "US Phone Only",
  "field": "phone",
  "condition": "matches",
  "value": "^\\+?1?\\d{10}$",
  "action": "reject",
  "message": "US phone numbers only"
}

Best Practices

  1. Start with built-in validations - They catch most common issues

  2. Monitor rejection rates - High rates indicate data quality issues upstream

  3. Use flagging over rejection - When unsure, flag for review

  4. Test rules thoroughly - Use the test feature before enabling

  5. Document custom rules - Help your team understand why rules exist

  6. Review regularly - Remove rules that no longer apply

  7. Balance strictness - Too strict = lost leads; too loose = bad data