Skip to main content
GET
/
campaigns
/
{campaignId}
/
export
/
leads
Export Campaign Leads
curl --request GET \
  --url https://api.lemlist.com/api/campaigns/{campaignId}/export/leads \
  --header 'Authorization: Basic <encoded-value>'
"emailStatus,email,firstName,lastName,picture,phone,linkedinUrl,timezone,companyName,companyDomain,icebreaker,Original event page,url extension,event_link_to_send,testFieldToDelete,naissance,lastState,status,_id\n,jeremy@example.com,Jeremy,Smith,,,https://www.linkedin.com/in/jeremysmith,,example.com,,,https://www.example.com/event-registration,?name=Jeremy&email=jeremy@example.com,https://www.example.com/event-registration?name=Jeremy&email=jeremy@example.com,,,linkedinReplied,done,lea_s3jmQcQt7Mb4QBtgb\n,frankie@example.org,Frankie,Johnson,,,https://www.linkedin.com/in/frankiejohnson,,example.org,,,https://www.example.com/event-registration,?name=Frankie&email=frankie@example.org,https://www.example.com/event-registration?name=Frankie&email=frankie@example.org,,,linkedinReplied,done,lea_2vDeEy8BAsB4qfkMT\n,louiza@example.io,Louiza,Brown,,,https://www.linkedin.com/in/louizabrown,,example.io,,,https://www.example.com/event-registration,?name=Louiza&email=louiza@example.io,https://www.example.com/event-registration?name=Louiza&email=louiza@example.io,,,emailsInterested,interested,lea_7aKJvPZKHL6LeQKug\n,benjamin@example.co,Benjamin,Williams,,,https://www.linkedin.com/in/benjaminwilliams,,example.co,,,https://www.example.com/event-registration,?name=Benjamin&email=benjamin@example.co,https://www.example.com/event-registration?name=Benjamin&email=benjamin@example.co,,,emailsUnsubscribed,unsubscribed,lea_JyRM9Tx9qh7bzA4n4\n,roxanne@example.net,Roxanne,Davis,,,https://www.linkedin.com/in/roxannedavis,,example.net,,,https://www.example.com/event-registration,?name=Roxanne&email=roxanne@example.net,https://www.example.com/event-registration?name=Roxanne&email=roxanne@example.net,,,emailsClicked,done,lea_WbYhcco3kpfFPYWNu\n,thomas@example.fr,Thomas,Miller,,,https://www.linkedin.com/in/thomasmiller,,example.fr,,,https://www.example.com/event-registration,?name=Thomas&email=thomas@example.fr,https://www.example.com/event-registration?name=Thomas&email=thomas@example.fr,,,emailsSent,done,lea_WyFSfFYJoYwbzQFPu"
This endpoint exports leads from a campaign with filtering options. The export returns leads in CSV or JSON format based on their state.

Filtering by state

Use the state parameter to filter leads by their current status. You can:
  • Export all leads: state=all
  • Filter by specific states: state=emailsOpened,emailsReplied
  • Use multiple states: state=interested,warmed

Global states

These group multiple lead states into a single category:
StateDescription
importedLeads imported without processing (not scanned, no steps sent, not reviewed)
scannedLeads scanned by LinkedIn or email verification
skippedLeads skipped during review
reviewedLeads that were reviewed
contactedLeads that were contacted (at least one step executed, no response yet)
hookedLeads that opened an email or LinkedIn message
attractedLeads that clicked in an email or accepted a LinkedIn invite
warmedLeads that replied to an email or LinkedIn message
interestedLeads marked as interested
notInterestedLeads marked as not interested
emailsBouncedLeads where at least one step bounced or failed
emailsUnsubscribedLeads that unsubscribed
meetingBookedLeads that booked a meeting
pausedLeads that were paused

Detailed states

For more granular filtering:
StateDescription
emailsSentEmail was sent
emailsOpenedLead opened an email
emailsClickedLead clicked on an email
emailsRepliedLead replied to an email
emailsInterestedLead marked as success via email
emailsNotInterestedLead marked as not a success via email
emailsFailedError sending email
linkedinVisitDoneLinkedIn profile was visited
linkedinInviteDoneLinkedIn invitation was sent
linkedinInviteAcceptedLinkedIn invitation was accepted
linkedinSentLinkedIn message was sent
linkedinOpenedLinkedIn message was opened
linkedinRepliedLead replied on LinkedIn
linkedinInterestedLead marked as success via LinkedIn
linkedinNotInterestedLead marked as not a success via LinkedIn

Output format

Use the format parameter to choose between:
  • csv (default): Returns a CSV file suitable for Excel, Google Sheets, etc.
  • json: Returns structured JSON data for programmatic processing

Examples

curl --request GET \
  --url 'https://api.lemlist.com/api/campaigns/cam_123/export/leads?state=all' \
 --header 'Authorization: Basic <encoded-value>'
Use global states like hooked or warmed to quickly segment leads by engagement level, or use detailed states for precise filtering based on specific actions.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

campaignId
string
required

The unique identifier of the campaign

Query Parameters

state
enum<string>
default:all

Filter to export only the specified lead's last states. Use 'all' to export all states. Can be a comma-separated list of states. Global states: imported, scanned, skipped, reviewed, contacted, hooked, attracted, warmed, interested, notInterested, emailsBounced, emailsUnsubscribed, failed, meetingBooked, paused. Detailed states: emailsSent, emailsOpened, emailsClicked, emailsReplied, emailsInterested, emailsNotInterested, emailsFailed, opportunitiesDone, aircallDone, aircallInterested, aircallNotInterested, apiDone, apiInterested, apiNotInterested, linkedinVisitDone, linkedinVisitFailed, linkedinInviteDone, linkedinInviteAccepted, linkedinInviteFailed, linkedinSent, linkedinOpened, linkedinReplied, linkedinInterested, linkedinNotInterested, linkedinSendFailed, manualInterested, manualNotInterested

Available options:
all,
imported,
scanned,
skipped,
reviewed,
contacted,
hooked,
attracted,
warmed,
interested,
notInterested,
emailsBounced,
emailsUnsubscribed,
failed,
meetingBooked,
paused,
emailsSent,
emailsOpened,
emailsClicked,
emailsReplied,
emailsInterested,
emailsNotInterested,
emailsFailed,
opportunitiesDone,
aircallDone,
aircallInterested,
aircallNotInterested,
apiDone,
apiInterested,
apiNotInterested,
linkedinVisitDone,
linkedinVisitFailed,
linkedinInviteDone,
linkedinInviteAccepted,
linkedinInviteFailed,
linkedinSent,
linkedinOpened,
linkedinReplied,
linkedinInterested,
linkedinNotInterested,
linkedinSendFailed,
manualInterested,
manualNotInterested
format
enum<string>

Output format: 'json' or 'csv'. Default is CSV.

Available options:
json,
csv

Response

Leads exported successfully

The response is of type file.