Converts Salesforce Leads to Contacts and Accounts with sophisticated matching and merging logic.
The Salesforce Conversion API provides automated Lead-to-Contact conversion with intelligent matching, duplicate prevention, and merge policies. It uses Salesforce Lead.Convert under the hood with batch API and includes duplicate protection via pre-check matching.
lead_sf_id: Salesforce Lead ID to convert (required)match_policy: Match policy configuration for contact and account matchingmerge_policy: Merge policy configuration for handling matchesset_owner_round_robin_pool: Optional round-robin pool for owner assignmentlogs: Logging configuration for conversion process
contact: Contact matching rules and creation policyaccount: Account matching rules and creation policyby: List of field rules for matching (e.g., ["email:eq", "name_company:fuzzy0.8"])create_if_no_match: Whether to create new record if no match found
on_contact_match: Action when contact match is foundmerge_lead_into_contact: Moves notes/activities, preserves owner historycreate_separate_contact: Creates separate contact record
on_account_match: Action when account match is foundattach_to_account: Attaches lead to existing accountcreate_separate_account: Creates separate account record
success: Boolean indicating request successstatus: Conversion status (converted, failed, duplicate)account_id: Created or matched Account IDcontact_id: Created or matched Contact IDowner_id: Assigned Owner IDactions: List of actions performed during conversioncredits_consumed: Number of credits usedprocessing_time_ms: Processing time in millisecondscached: Whether result was from cache
- Duplicate Protection: Pre-check via /v1/match to avoid duplicate contacts/accounts
- Idempotent: Same Idempotency-Key repeats return prior result
- Batch Processing: Uses Salesforce Lead.Convert with batch API
- Round-Robin Assignment: Optional owner assignment from specified pools
- Comprehensive Logging: Route logs and enrichment differences
Salesforce conversion consumes credits based on complexity:
- Basic Conversion: 3 credits per lead
- With Matching: +2 credits for duplicate checking
- With Round-Robin: +1 credit for owner assignment
Security
BearerAuth
Any of:
Round-robin pool for owner assignment
string
- Lantern API serverhttps://api-gateway.agenthq.withlantern.com/v1/salesforce/convert
- Local API serverhttp://localhost:8000/v1/salesforce/convert
- string
- null
curl -i -X POST \
https://api-gateway.agenthq.withlantern.com/v1/salesforce/convert \
-H 'Authorization: Bearer <YOUR_ApiToken_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"lead_sf_id": "string",
"match_policy": {
"contact": {
"by": [
"string"
],
"create_if_no_match": true
},
"account": {
"by": [
"string"
],
"create_if_no_match": true
}
},
"merge_policy": {
"on_contact_match": "string",
"on_account_match": "string"
},
"set_owner_round_robin_pool": "string",
"logs": {
"route_log": true,
"enrichment_diff": true
}
}'Success Response
Response
{ "success": true, "status": "converted", "account_id": "001xx0001ABCDEF", "contact_id": "003xx0002HIJKLM", "owner_id": "005xx0003NOPQRS", "actions": [ "lead_merged", "contact_created", "assigned_round_robin" ], "credits_consumed": 6, "processing_time_ms": 2500, "cached": false }