Salesforce object type that triggered the event
Lantern API docs (1.4.1)
The Lantern API provides two major processing modes to enhance your contact and business data:
🔄 Sync API - Real-time Processing (/v1/enrich/) Process individual records and get immediate responses. Perfect for:
- Real-time user interfaces
- Single record processing
- Immediate validation workflows
Available Services:
- Phone Enrichment: Find phone numbers for contacts
- Email Enrichment: Discover professional email addresses
- Company Enrichment: Get comprehensive firmographics and website-verified data
- Person Enrichment: Enrich person records with contact and professional data
- AI Enrichment: Generate insights, analysis, and structured data using advanced language models
- Deep Research: Comprehensive research using advanced language models with real-time search capabilities
🎯 Match API - Object Matching (/v1/match/) Match Account/Contact/Lead objects with sophisticated matching logic. Perfect for:
- CRM data deduplication
- Lead-to-account matching
- Contact matching and merging
Available Services:
- Account Matching: Match company records with exact, fuzzy, and AI-assisted logic
- Contact Matching: Match contact records with grouped boolean logic
- Lead Matching: Match lead records with confidence scoring and explanations
🔗 Salesforce API - Lead Conversion (/v1/salesforce/) Convert Salesforce Leads to Contacts and Accounts with intelligent matching. Perfect for:
- Automated lead conversion workflows
- CRM data management
- Lead-to-contact merging
Available Services:
- Lead Conversion: Convert leads to contacts and accounts with duplicate prevention
- Auto-Merge: Intelligent merging with configurable policies
- Round-Robin Assignment: Automatic owner assignment from pools
🎯 Routing API - Round Robin Assignment (/v1/routing/) Assign Salesforce objects to users using intelligent round-robin logic. Perfect for:
- Fair distribution of leads and opportunities
- Automated user assignment
- Pool-based routing management
Available Services:
- Round Robin Assignment: Assign objects to users with sequence tracking
- Pool Management: Organize users into assignment pools
- Reset Rules: Support for resetting rotation with specific reasons
⚡ Triggers API - Instant Enrichment (/v1/triggers/) Trigger instant enrichment on Salesforce record creation/updates. Perfect for:
- Real-time data enrichment
- Automated workflow triggers
- Near real-time processing
Available Services:
- Salesforce Webhooks: Real-time trigger processing via Platform Events
- Polling Fallback: SOQL-based polling every 2 minutes for comprehensive coverage
- Instant Enrichment: Automatic enrichment workflows on record changes
📊 Logs API - Audit & Reporting (/v1/logs/) Comprehensive audit trails and reporting for all routing actions. Perfect for:
- Compliance and audit requirements
- Performance analysis and monitoring
- User activity tracking
Available Services:
- Route Log Export: Export logs with filtering and multiple formats (JSON/CSV)
- Log Statistics: Statistical analysis of log data for reporting
- Retention Management: Configurable retention policies and cleanup schedules
🚀 Async API - Batch Processing (/v1/agents/) Process multiple records (1-1000) asynchronously with results stored in S3. Perfect for:
- Large-scale bulk processing
- Background processing workflows
- Cost breakdown results on s3 too
Available Services:
- Phone Enrichment Batch: Bulk phone number enrichment
- Email Enrichment Batch: Bulk email address enrichment
- Deep Research Batch: Bulk AI-powered research with specialized agents
💳 Credits API - Credit Management (/v1/credits/) Monitor and manage your credit usage and availability. Perfect for:
- Tracking credit consumption across time periods
- Checking remaining credit balance
Available Services:
- Credit Usage: Get detailed usage statistics for specific date ranges
- Remaining Credits: Check current credit balance
🔄 Workflow Trigger API - External System Integration (/v1/workflows/) Trigger enrichment and routing workflows from external systems. Perfect for:
- Eloqua, CDP, and Data Lake integrations
- Marketing automation platform triggers
- High-volume bursty event processing
Available Services:
- Workflow Trigger: Generic interface for initiating workflows from any external system
- Audit Logging: Complete request/response logging for compliance
- Retry Logic: Automatic retries with exponential backoff
📝 Form Submit API - Direct Form Processing (/v1/forms/) Accept form submissions and immediately enrich and disposition data. Perfect for:
- Marketing automation platform integrations
- Website form processing
- Real-time lead enrichment
Available Services:
- Form Submission: Accept form data with validation
- Immediate Enrichment: Sub-5 second processing with GDPR compliance
- Flexible Output: Return enriched data or push to external systems
| Feature | Sync API | Match API | Salesforce API | Routing API | Triggers API | Logs API | Async API | Credits API | Workflow API | Form API |
|---|---|---|---|---|---|---|---|---|---|---|
| Records per request | 1 | 1-100 | 1 | 1 | 1-100 | 1-10000 | 1-1000 | N/A | 1 | 1 |
| Response time | Immediate | Immediate | Immediate | Immediate | Immediate | Immediate | Asynchronous | Immediate | Immediate | Immediate |
| Result delivery | Direct response | Direct response | Direct response | Direct response | Direct response | Direct response | S3 storage | Direct response | Direct response | Direct response |
| Use case | Real-time processing | Object matching | Lead conversion | User assignment | Instant enrichment | Audit reporting | Bulk operations | Credit monitoring | External system triggers | Form processing |
| Rate limits | Per-minute limits | Per-minute limits | Per-minute limits | Per-minute limits | Per-minute limits | Per-minute limits | Lower frequency limits | Per-minute limits | High burst support | High burst support |
All requests must include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY- Sync API Rate Limit: 50 requests per minute per API key. Can be lifted on request.
- Async API Rate Limit: 1 batch request per minute per API key. Can be lifted on request.
- Credits API Rate Limit: 10 requests per minute per API key. Can be lifted on request.
- Headers: Rate limit and credit information is returned in response headers:
X-RateLimit-Limit: The rate limit ceiling for your API keyX-Credits-Remaining: Credits remaining in your account
Error Codes:
429 Too Many Requests: Rate limit exceeded402 Payment Required: Credit limit exceeded
- API Key Security: Keep your API key secure and never expose it in client-side code
- Rate Limit Handling: Implement exponential backoff when receiving 429 responses
- Error Handling: Always check the
successfield before processing results - Credit Management: Monitor your credit usage and remaining balance through response headers
- Use Unique Record IDs: Always provide unique record IDs to enable caching and prevent duplicate processing
- Set Credit Limits: Use
max_creditsparameter to control spending per request - Cache Awareness: Check the
cachedfield to understand if fresh data was retrieved - Monitor Confidence Levels: Use confidence scores to determine data quality for your use case
- Batch Sizing: Submit 100-1000 records per batch for optimal performance
- Result Monitoring: Get submission details from API call when batch is accepted, then poll results from S3 until completion
- Credit Planning: Set appropriate
max_creditslimits for large batches - Error Handling: Handle batch-level errors and individual record failures within results
- Proactive Monitoring: Check remaining credits before large operations
- Usage Tracking: Use date range filtering to analyze spending patterns
- Budget Planning: Monitor usage trends to forecast credit needs
https://api-gateway.agenthq.withlantern.com/
http://localhost:8000/
Request
Handles instant enrichment on Salesforce record creation/updates via webhook.
The Salesforce Trigger API provides instant enrichment capabilities for Salesforce records through webhook-based triggers. It supports both real-time webhook processing and polling-based enrichment for comprehensive coverage of record changes.
object: Salesforce object type that triggered the event (Lead, Contact, Account, Opportunity)ids: List of Salesforce record IDs that changedevent: Salesforce trigger event type (after_insert, after_update, after_undelete)org_id: Salesforce organization ID
after_insert: Triggered when new records are createdafter_update: Triggered when existing records are updatedafter_undelete: Triggered when records are undeleted
success: Boolean indicating request successprocessed_count: Number of records processedenrichment_jobs: List of enrichment job IDs createdworkflow_status: Status of the enrichment workflow (started, queued, failed)credits_consumed: Number of credits usedcredits_remaining: Credits remaining in accountprocessing_time_ms: Processing time in millisecondscached: Whether result was from cache
- Immediate Processing: Records are processed immediately upon webhook receipt
- Platform Events: Uses Salesforce Platform Events for reliable delivery
- Apex Callouts: Triggered via Apex callouts from Salesforce triggers
- Low Latency: Near real-time enrichment with minimal delay
- SOQL Queries: Polls Salesforce every 2 minutes for new/changed records
- Watermark Tracking: Uses SystemModstamp and Id for efficient filtering
- Batch Processing: Processes records in batches for optimal performance
- Reliable Coverage: Ensures no records are missed even if webhooks fail
- Dual Processing: Both webhook and polling support for comprehensive coverage
- Automatic Enrichment: Triggers enrichment workflows based on object type
- Job Tracking: Creates enrichment jobs for monitoring and debugging
- Credit Management: Tracks credit consumption per enrichment job
- Error Handling: Robust error handling with retry mechanisms
- Audit Trail: Comprehensive logging for compliance and debugging
Trigger processing consumes credits based on enrichment type:
- Lead Enrichment: 2 credits per lead
- Contact Enrichment: 1 credit per contact
- Account Enrichment: 3 credits per account
- Opportunity Enrichment: 1 credit per opportunity
Salesforce trigger event type
- Lantern API server
https://api-gateway.agenthq.withlantern.com/v1/triggers/salesforce
- Local API server
http://localhost:8000/v1/triggers/salesforce
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api-gateway.agenthq.withlantern.com/v1/triggers/salesforce \
-H 'Authorization: Bearer <YOUR_ApiToken_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"object": "lead",
"ids": [
"string"
],
"event": "after_insert",
"org_id": "string"
}'{ "success": true, "processed_count": 2, "enrichment_jobs": [ "job_001", "job_002" ], "workflow_status": "started", "credits_consumed": 4, "credits_remaining": 46, "processing_time_ms": 850, "cached": false }
Request
Get the current status of polling-based enrichment.
This endpoint provides information about the current polling status, including last poll time, records processed, watermark value, and next scheduled poll.
last_poll_time: ISO timestamp of last pollrecords_processed: Number of records processed in last pollwatermark_value: Current watermark valuenext_poll_time: ISO timestamp of next scheduled poll
- Monitor polling performance
- Debug enrichment issues
- Verify watermark progression
- Check polling schedule
- Lantern API server
https://api-gateway.agenthq.withlantern.com/v1/triggers/polling/status
- Local API server
http://localhost:8000/v1/triggers/polling/status
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://api-gateway.agenthq.withlantern.com/v1/triggers/polling/status \
-H 'Authorization: Bearer <YOUR_ApiToken_HERE>'{ "last_poll_time": "string", "records_processed": 0, "watermark_value": "string", "next_poll_time": "string" }