Skip to main content
POST
/
api
/
v1
/
operations
/
export
curl -X POST "https://app.lance.so/api/v1/operations/export" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -o "leads-export.csv" \
  -d '{
    "selection": {
      "mode": "manual",
      "includedIds": [
        "550e8400-e29b-41d4-a716-446655440000",
        "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
      ]
    },
    "exportFields": ["name", "emails", "phones", "jobTitle", "companyName"]
  }'
Name,Email(s),Phone(s),Job Title,Company Name
John Smith,john@example.com,+1-555-0100,Software Engineer,Acme Corp
Jane Doe,"jane@example.com, jane.doe@personal.com",+1-555-0101,Product Manager,Tech Inc
This endpoint exports selected leads to a CSV file. It supports both manual selection (specific IDs) and bulk selection (range-based with filters).

How It Works

  1. Resolve Selection: The selection payload is resolved to actual lead IDs based on the mode
  2. Field Selection: Determines which fields to include based on exportFields or uses defaults
  3. Generate CSV: Builds CSV content with headers and data rows
  4. File Download: Returns the CSV as a file attachment
The response is a binary CSV file download, not JSON. The X-Export-Count header contains the number of exported records.

Request

Body Parameters

selection
object
required
Selection criteria for which leads to export. Supports two modes: manual (explicit IDs) and bulk (range-based).
exportFields
string[]
Array of field IDs to include in the export. If not specified, uses default fields. Default fields: name, emails, phones, linkedinUrl, city, country, jobTitle, companyName See Available Export Fields for all options.

Response

The response is a CSV file download with the following headers:
Content-Type
header
text/csv; charset=utf-8
Content-Disposition
header
attachment; filename="lance-prospects-{YYYY - MM - DD}.csv" The filename includes the current date.
X-Export-Count
header
The number of records exported (as a string).

CSV Format

The CSV file contains:
  • Header row: Column labels based on selected fields
  • Data rows: One row per lead with values for each selected field
  • Values containing commas, quotes, or newlines are properly escaped
  • UTF-8 encoding

Available Export Fields

Fields are organized by category. Use the id value in the exportFields array.

Contact Information

Field IDLabelDescription
nameNameFull name (first + last)
emailsEmail(s)All email addresses, comma-separated
phonesPhone(s)All phone numbers, comma-separated
linkedinUrlLinkedIn URLPerson’s LinkedIn profile URL

Location Information

Field IDLabelDescription
cityCityPerson’s city
postalCodePostal CodePerson’s postal code
countryCountryPerson’s country

Professional Information

Field IDLabelDescription
jobTitleJob TitleCurrent job title
senioritySenioritySeniority level
departmentsDepartmentsDepartments, comma-separated
functionsFunctionsJob functions, comma-separated
industryIndustry (Person)Person’s industry
skillsSkillsSkills, comma-separated
languagesLanguagesLanguages spoken, comma-separated

Company Information

Field IDLabelDescription
companyNameCompany NameCurrent company name
companyLegalNameCompany Legal NameCompany’s legal registered name
companyWebsiteCompany WebsiteCompany website URL
companyLinkedinCompany LinkedInCompany LinkedIn page URL
companyPhoneCompany Phone(s)Company phone numbers
companyCityCompany City (HQ)Company headquarters city
companyPostalCodeCompany Postal Code (HQ)Company headquarters postal code
companyCountryCompany Country (HQ)Company headquarters country
companyIndustryCompany IndustryCompany’s industry
companyHeadcountCompany HeadcountEmployee count range
companyRevenueCompany RevenueRevenue range
companyFoundedYearCompany Founded YearYear company was founded
companySummaryCompany SummaryAI-generated company summary
curl -X POST "https://app.lance.so/api/v1/operations/export" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -o "leads-export.csv" \
  -d '{
    "selection": {
      "mode": "manual",
      "includedIds": [
        "550e8400-e29b-41d4-a716-446655440000",
        "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
      ]
    },
    "exportFields": ["name", "emails", "phones", "jobTitle", "companyName"]
  }'
Name,Email(s),Phone(s),Job Title,Company Name
John Smith,john@example.com,+1-555-0100,Software Engineer,Acme Corp
Jane Doe,"jane@example.com, jane.doe@personal.com",+1-555-0101,Product Manager,Tech Inc

Error Codes

Status CodeError CodeDescription
400-No data to export (selection resolved to 0 leads)
400VALIDATION_ERRORInvalid request body or missing required fields
500INTERNAL_ERRORServer error during export generation

Filters Reference

For bulk mode, the filters object uses the People Search schema. Key filter sections include:

Contact Filters

  • fullName - Filter by person name
  • location - Filter by location (city, country)
  • seniority - Filter by seniority level (entry, mid-level, senior, director, c_suite, etc.)
  • departmentAndFunction - Filter by department or function
  • skill - Filter by skills
  • education - Filter by school, degree, or field of study
  • experience - Filter by current or previous job titles

Account (Company) Filters

  • nameOrDomain - Filter by company name or domain
  • industry - Filter by company industry
  • location - Filter by company location
  • employeeSize - Filter by company size range
  • revenue - Filter by company revenue range
  • type - Filter by company type (public, private, etc.)

Notes

  • Maximum bulk selection: 1000 leads per export
  • Default fields: If no exportFields specified, exports: name, emails, phones, linkedinUrl, city, country, jobTitle, companyName
  • CSV escaping: Values with commas, quotes, or newlines are automatically quoted and escaped
  • Filename: Automatically generated with current date: lance-prospects-YYYY-MM-DD.csv
  • Authentication: Requires authentication; exports are scoped to the authenticated organization