Skip to main content
POST
/
api
/
v1
/
operations
/
enrichment
/
bulk
curl -X POST "https://app.lance.so/api/v1/operations/enrichment/bulk" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "selection": {
      "mode": "manual",
      "includedIds": [
        "550e8400-e29b-41d4-a716-446655440001",
        "550e8400-e29b-41d4-a716-446655440002"
      ]
    },
    "field": "emails"
  }'
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-01-13T10:30:00.000Z",
    "updatedAt": "2025-01-13T10:30:00.000Z",
    "entityId": "550e8400-e29b-41d4-a716-446655440001",
    "entityType": "person",
    "field": "emails",
    "status": "pending",
    "error": null,
    "createdBy": "user_2abc123",
    "orgId": "org_xyz789",
    "globalEnrichmentId": null,
    "creditTransactionId": "txn_456def",
    "dataFound": null
  },
  {
    "id": "123e4567-e89b-12d3-a456-426614174001",
    "createdAt": "2025-01-13T10:30:00.000Z",
    "updatedAt": "2025-01-13T10:30:00.000Z",
    "entityId": "550e8400-e29b-41d4-a716-446655440002",
    "entityType": "person",
    "field": "emails",
    "status": "finished",
    "error": null,
    "createdBy": "user_2abc123",
    "orgId": "org_xyz789",
    "globalEnrichmentId": "global_789",
    "creditTransactionId": null,
    "dataFound": true
  }
]
This endpoint triggers bulk contact enrichment for multiple leads at once. It supports both manual selection (explicit IDs) and bulk selection (intent-based selection with filters). The endpoint validates credit availability before processing and handles enrichment in batches.

Credit Consumption

This endpoint consumes credits based on the number of leads being enriched. The system validates that sufficient credits are available before starting any enrichment operations. If credits are insufficient, the entire operation fails without consuming any credits.
  • Email enrichment: Consumes credits per lead
  • Phone enrichment: Consumes credits per lead

Request

Body Parameters

selection
object
required
The selection payload specifying which leads to enrich.
field
string
required
The type of contact information to enrich. Allowed values: phones, emails

Response

Returns an array of enrichment objects representing both newly created and existing enrichment tasks.
response
array
required
Array of enrichment objects.

Selection Modes

Manual Mode

Use manual mode when you have specific lead IDs to enrich:
{
  "selection": {
    "mode": "manual",
    "includedIds": [
      "550e8400-e29b-41d4-a716-446655440001",
      "550e8400-e29b-41d4-a716-446655440002"
    ]
  },
  "field": "emails"
}

Bulk Mode

Use bulk mode to enrich a range of leads from search results. This requires filters to reproduce the search:
{
  "selection": {
    "mode": "bulk",
    "startIndex": 0,
    "targetCount": 100,
    "excludedIds": ["550e8400-e29b-41d4-a716-446655440003"],
    "filters": {
      "job_title": ["Software Engineer", "Developer"]
    }
  },
  "field": "phones"
}
curl -X POST "https://app.lance.so/api/v1/operations/enrichment/bulk" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "selection": {
      "mode": "manual",
      "includedIds": [
        "550e8400-e29b-41d4-a716-446655440001",
        "550e8400-e29b-41d4-a716-446655440002"
      ]
    },
    "field": "emails"
  }'
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-01-13T10:30:00.000Z",
    "updatedAt": "2025-01-13T10:30:00.000Z",
    "entityId": "550e8400-e29b-41d4-a716-446655440001",
    "entityType": "person",
    "field": "emails",
    "status": "pending",
    "error": null,
    "createdBy": "user_2abc123",
    "orgId": "org_xyz789",
    "globalEnrichmentId": null,
    "creditTransactionId": "txn_456def",
    "dataFound": null
  },
  {
    "id": "123e4567-e89b-12d3-a456-426614174001",
    "createdAt": "2025-01-13T10:30:00.000Z",
    "updatedAt": "2025-01-13T10:30:00.000Z",
    "entityId": "550e8400-e29b-41d4-a716-446655440002",
    "entityType": "person",
    "field": "emails",
    "status": "finished",
    "error": null,
    "createdBy": "user_2abc123",
    "orgId": "org_xyz789",
    "globalEnrichmentId": "global_789",
    "creditTransactionId": null,
    "dataFound": true
  }
]

Error Codes

Status CodeError CodeDescription
400VALIDATION_ERRORInvalid request body, missing required fields, or invalid field values
401UNAUTHORIZEDMissing or invalid authentication
402INSUFFICIENT_CREDITSNot enough credits to complete the bulk enrichment
500INTERNAL_ERRORServer error during enrichment processing

Notes

  • Batching: The system processes enrichments in batches to avoid overwhelming enrichment providers
  • Deduplication: If an enrichment already exists for a lead/field combination, the existing enrichment is returned instead of creating a duplicate
  • Credit Pre-validation: Credits are validated before any processing begins; if insufficient, the operation fails atomically
  • Maximum Selection: Bulk mode is limited to 1000 leads per request
  • Filters Required: When using bulk mode, the filters field is required to resolve the selection