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/RejectFailed validations result in immediate rejection with a clear error message.
Built-in Validations
Email Validation
| Check | Description | Example Failure |
|---|---|---|
| Format | Valid email syntax | not-an-email |
| Domain | Has MX records | [email protected] |
| Disposable | Not a temporary email | [email protected] |
| Typo Detection | Common 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
| Check | Description |
|---|---|
| Format | Valid phone number format |
| Length | Minimum 10 digits |
| Country Code | Valid international prefix |
Required Fields
Configure which fields must be present:
| Field | Default |
|---|---|
| Required | |
| first_name | Optional |
| last_name | Optional |
| phone | Optional |
| program | Optional |
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.
| Speed | Action |
|---|---|
| < 1 second | Reject |
| 1-3 seconds | Flag for review |
| > 3 seconds | Accept |
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
- Go to Settings → Validation → Email Domains
- View the default blocked list
- Add custom domains to block
- Add exceptions (allow specific domains)
Custom Validation Rules
Create custom rules for your specific requirements.
Navigate to Validation Rules
Go to Settings → Validation 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
| Type | Description | Example |
|---|---|---|
| Required | Field must be present | phone is required |
| Format | Regex pattern match | zip matches /^\d{5}$/ |
| Length | Min/max length | first_name min 2 chars |
| Range | Numeric range | age between 18 and 100 |
| Whitelist | Must be in list | state in ["CA", "NY", "TX"] |
| Blacklist | Must not be in list | email not contains "test" |
| Comparison | Compare to another field | confirm_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.eduEmail Domain Blacklist
Block leads from specific domains:
Blocked domains:
- @mailinator.com
- @competitor.com
- @test.comMX Record Checking
Verify the email domain has valid mail servers:
| MX Status | Default Action |
|---|---|
| Valid MX records | Accept |
| No MX records | Reject |
| DNS timeout | Accept (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:
| Source | Email Required | Phone Required | Duplicate Check |
|---|---|---|---|
| Web Form | Yes | No | 24 hours |
| Vendor A | Yes | Yes | 7 days |
| Vendor B | Yes | No | 30 days |
| API Direct | Yes | No | 1 hour |
Setting Source-Specific Rules
- Go to Vendors → Select vendor
- Click Validation Settings
- Configure source-specific rules
- Save
Rejected Leads
Viewing Rejections
- Go to Leads → Rejected Leads
- Filter by date, reason, or source
- Click any rejection for details
Rejection Reasons
| Reason | Description |
|---|---|
invalid_email | Email format or domain invalid |
disposable_email | Temporary email service detected |
missing_required | Required field not provided |
failed_custom_rule | Custom validation rule failed |
duplicate | Duplicate lead detected |
bot_detected | Bot submission suspected |
rate_limited | Source exceeded rate limit |
Exporting Rejections
- Go to Leads → Rejected Leads
- Apply filters as needed
- Click Export
- Download CSV with rejection details
Testing Validation
Test a Lead
- Go to Settings → Validation Rules
- Click Test Validation
- Enter test lead data
- Click Run Test
- 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 formatAPI 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/validationCreate 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
-
Start with built-in validations - They catch most common issues
-
Monitor rejection rates - High rates indicate data quality issues upstream
-
Use flagging over rejection - When unsure, flag for review
-
Test rules thoroughly - Use the test feature before enabling
-
Document custom rules - Help your team understand why rules exist
-
Review regularly - Remove rules that no longer apply
-
Balance strictness - Too strict = lost leads; too loose = bad data