{
"selection": {
"mode": "manual",
"includedIds": [
"lead_abc123",
"lead_def456",
"lead_ghi789"
]
},
"options": {
"provider": "bullhorn",
"checkForDuplicates": true,
"duplicateHandling": "skip",
"createNewHandling": "create"
}
}
{
"selection": {
"mode": "bulk",
"startIndex": 0,
"targetCount": 100,
"excludedIds": ["lead_xyz999"],
"filters": {
"job_titles": ["Software Engineer", "Developer"],
"locations": ["San Francisco, CA"]
}
},
"options": {
"provider": "close",
"checkForDuplicates": true,
"duplicateHandling": "update",
"createNewHandling": "create"
}
}
{
"success": true,
"totalProcessed": 3,
"created": 2,
"updated": 0,
"skipped": 1,
"failed": 0,
"results": [
{
"leadId": "lead_abc123",
"personName": "Jane Smith",
"companyName": "Acme Corp",
"status": "created",
"crmLeadId": "crm_lead_001",
"crmContactId": "crm_contact_001"
},
{
"leadId": "lead_def456",
"personName": "John Doe",
"companyName": "Tech Inc",
"status": "created",
"crmLeadId": "crm_lead_002",
"crmContactId": "crm_contact_002"
},
{
"leadId": "lead_ghi789",
"personName": "Bob Wilson",
"companyName": "StartupXYZ",
"status": "skipped"
}
]
}
{
"success": true,
"totalProcessed": 0,
"created": 0,
"updated": 0,
"skipped": 0,
"failed": 0,
"results": []
}
{
"error": "CRM is not connected"
}
CRM Integration
Export to CRM
Export selected leads to a connected CRM system (Bullhorn or Close)
POST
/
api
/
v1
/
operations
/
crm
/
export
{
"selection": {
"mode": "manual",
"includedIds": [
"lead_abc123",
"lead_def456",
"lead_ghi789"
]
},
"options": {
"provider": "bullhorn",
"checkForDuplicates": true,
"duplicateHandling": "skip",
"createNewHandling": "create"
}
}
{
"selection": {
"mode": "bulk",
"startIndex": 0,
"targetCount": 100,
"excludedIds": ["lead_xyz999"],
"filters": {
"job_titles": ["Software Engineer", "Developer"],
"locations": ["San Francisco, CA"]
}
},
"options": {
"provider": "close",
"checkForDuplicates": true,
"duplicateHandling": "update",
"createNewHandling": "create"
}
}
{
"success": true,
"totalProcessed": 3,
"created": 2,
"updated": 0,
"skipped": 1,
"failed": 0,
"results": [
{
"leadId": "lead_abc123",
"personName": "Jane Smith",
"companyName": "Acme Corp",
"status": "created",
"crmLeadId": "crm_lead_001",
"crmContactId": "crm_contact_001"
},
{
"leadId": "lead_def456",
"personName": "John Doe",
"companyName": "Tech Inc",
"status": "created",
"crmLeadId": "crm_lead_002",
"crmContactId": "crm_contact_002"
},
{
"leadId": "lead_ghi789",
"personName": "Bob Wilson",
"companyName": "StartupXYZ",
"status": "skipped"
}
]
}
{
"success": true,
"totalProcessed": 0,
"created": 0,
"updated": 0,
"skipped": 0,
"failed": 0,
"results": []
}
{
"error": "CRM is not connected"
}
Overview
This endpoint exports leads from Lance to your connected CRM. It supports bulk selection of leads and configurable duplicate handling strategies.Authentication
This endpoint requires authentication. The organization ID is automatically
extracted from the authenticated session.
Request Body
object
required
Defines which leads to export using bulk selection.
Show selection properties
Show selection properties
string
required
Selection mode. Either
manual for explicit row selection or bulk for intent-based selection.Allowed values: manual, bulkinteger
Starting index for bulk selection (0-based). Required when
mode is bulk.integer
Number of items to select in bulk mode. Maximum: 1000. Required when
mode is bulk.string[]
Array of lead IDs to exclude from the bulk selection range.
string[]
Array of lead IDs to explicitly include. Used for manual mode or additions outside the bulk range.
object
Search filters to reproduce the exact query. Required when
mode is bulk.object
required
Export configuration options.
Show options properties
Show options properties
string
required
Target CRM provider. Must match your connected CRM.Allowed values:
close, bullhornboolean
default:true
Whether to check for existing contacts/leads in the CRM before creating.
string
default:"skip"
Strategy for handling duplicates when a matching contact exists.Allowed values:
skip- Skip if lead/contact already existsupdate- Update existing lead/contact with new datacreate_duplicate- Create a new entry even if duplicate exists
string
default:"create"
Strategy when a contact doesn’t exist in the CRM.Allowed values:
create- Create a new Lead with Contactskip- Skip this lead entirely
Response
boolean
required
Whether the overall export operation completed successfully.
integer
required
Total number of leads processed in this export.
integer
required
Number of new contacts/leads created in the CRM.
integer
required
Number of existing contacts/leads updated in the CRM.
integer
required
Number of leads skipped (due to duplicate handling or other rules).
integer
required
Number of leads that failed to export.
array
required
Detailed results for each lead processed.
Show results item properties
Show results item properties
string
required
Lance lead ID.
string
required
Name of the person/lead.
string | null
required
Company name associated with the lead.
string
required
Export status for this lead.Possible values:
created, updated, skipped, failedstring
CRM lead/company ID if created or updated.
string
CRM contact ID if created or updated.
string
Error message if the export failed for this lead.
string[]
Array of general error messages encountered during export.
Error Responses
| Status Code | Error | Description |
|---|---|---|
| 400 | Organization ID required | No authenticated organization found |
| 400 | CRM is not connected | Organization has no CRM integration configured |
| 400 | CRM provider mismatch | Requested provider doesn’t match connected CRM |
| 400 | Invalid request | Request body validation failed |
{
"selection": {
"mode": "manual",
"includedIds": [
"lead_abc123",
"lead_def456",
"lead_ghi789"
]
},
"options": {
"provider": "bullhorn",
"checkForDuplicates": true,
"duplicateHandling": "skip",
"createNewHandling": "create"
}
}
{
"selection": {
"mode": "bulk",
"startIndex": 0,
"targetCount": 100,
"excludedIds": ["lead_xyz999"],
"filters": {
"job_titles": ["Software Engineer", "Developer"],
"locations": ["San Francisco, CA"]
}
},
"options": {
"provider": "close",
"checkForDuplicates": true,
"duplicateHandling": "update",
"createNewHandling": "create"
}
}
{
"success": true,
"totalProcessed": 3,
"created": 2,
"updated": 0,
"skipped": 1,
"failed": 0,
"results": [
{
"leadId": "lead_abc123",
"personName": "Jane Smith",
"companyName": "Acme Corp",
"status": "created",
"crmLeadId": "crm_lead_001",
"crmContactId": "crm_contact_001"
},
{
"leadId": "lead_def456",
"personName": "John Doe",
"companyName": "Tech Inc",
"status": "created",
"crmLeadId": "crm_lead_002",
"crmContactId": "crm_contact_002"
},
{
"leadId": "lead_ghi789",
"personName": "Bob Wilson",
"companyName": "StartupXYZ",
"status": "skipped"
}
]
}
{
"success": true,
"totalProcessed": 0,
"created": 0,
"updated": 0,
"skipped": 0,
"failed": 0,
"results": []
}
{
"error": "CRM is not connected"
}