Lemlist Skill
Fetch and manage data from the lemlist API.
Quick Start
All scripts follow a file-first pattern:
- Accept an optional
--outputdirectory (defaults to./output) - Save raw JSON and processed CSV into that directory
- Return JSON with
{"output_files": [...], "summary": "..."}
Authentication
Set the LEMLIST_API_KEY environment variable:
export LEMLIST_API_KEY="your-api-key"
Get your API key from lemlist Settings > Integrations > API.
Core Operations
Campaign Management
List all campaigns:
python scripts/get_campaigns.py
Filter by status:
python scripts/get_campaigns.py --status running
Get specific campaign:
python scripts/get_campaigns.py \
--campaign-id "camp_abc123" \
--include-stats
Lead Management
Get leads from campaign:
python scripts/get_leads.py \
--campaign-id "camp_abc123"
Fetch all leads (with pagination):
python scripts/get_leads.py \
--campaign-id "camp_abc123" \
--fetch-all
Filter by status:
python scripts/get_leads.py \
--campaign-id "camp_abc123" \
--status replied
Get specific lead:
python scripts/get_leads.py \
--campaign-id "camp_abc123" \
--email "john@example.com"
Adding Leads
Add single lead:
python scripts/add_leads.py \
--campaign-id "camp_abc123" \
--lead-json '{"email": "john@example.com", "firstName": "John", "lastName": "Doe", "companyName": "Acme Inc"}'
Bulk import from CSV:
python scripts/add_leads.py \
--campaign-id "camp_abc123" \
--leads-csv "/path/to/leads.csv" \
--email-column "email" \
--batch-size 50 \
--deduplicate
CSV Format:
email,firstName,lastName,companyName,customField1
john@example.com,John,Doe,Acme Inc,value1
jane@example.com,Jane,Smith,Beta Corp,value2
Updating Leads
Update lead fields:
python scripts/update_lead.py \
--campaign-id "camp_abc123" \
--email "john@example.com" \
--data '{"firstName": "Johnny", "companyName": "New Company"}'
Mark as interested:
python scripts/update_lead.py \
--campaign-id "camp_abc123" \
--email "john@example.com" \
--set-interested true
Pause a lead:
python scripts/update_lead.py \
--campaign-id "camp_abc123" \
--email "john@example.com" \
--pause
Resume a lead:
python scripts/update_lead.py \
--campaign-id "camp_abc123" \
--email "john@example.com" \
--resume
Deleting Leads
Delete from campaign:
python scripts/delete_lead.py \
--campaign-id "camp_abc123" \
--email "john@example.com"
Delete from all campaigns:
python scripts/delete_lead.py \
--email "john@example.com" \
--all-campaigns
Campaign Activities
Get all activities:
python scripts/get_activities.py \
--campaign-id "camp_abc123"
Filter by type:
python scripts/get_activities.py \
--campaign-id "camp_abc123" \
--activity-type emailsReplied
Activity types: emailsSent, emailsOpened, emailsClicked, emailsReplied, emailsBounced, emailsFailed, emailsUnsubscribed, emailsInterested, emailsNotInterested
Team Information
Get team details:
python scripts/get_team.py
Include email accounts:
python scripts/get_team.py \
--include-accounts
Unsubscribe Management
List all unsubscribes:
python scripts/get_unsubscribes.py \
--list
Check if email is unsubscribed:
python scripts/get_unsubscribes.py \
--check "john@example.com"
Add to unsubscribe list:
python scripts/get_unsubscribes.py \
--add "john@example.com"
Remove from unsubscribe list:
python scripts/get_unsubscribes.py \
--remove "john@example.com"
Output Format
All scripts return JSON:
{
"output_files": [
"output/20250111_101500_lemlist_campaigns_raw_20250111_101500.json",
"output/20250111_101500_lemlist_campaigns_20250111_101500.csv"
],
"summary": "Fetched 5 campaigns (running: 3, paused: 2)",
"stats": {
"campaign_count": 5,
"mode": "list"
}
}
Lead Status Values
| Status | Description |
|---|---|
sent |
Email sent |
opened |
Email opened |
clicked |
Link clicked |
replied |
Reply received |
bounced |
Email bounced |
interested |
Marked interested |
notInterested |
Marked not interested |
paused |
Lead paused |
contacted |
Contact initiated |
Rate Limits
- Lemlist has rate limits based on your plan
- Scripts implement automatic retry with exponential backoff on 429 errors
- Use
--delayparameter for bulk operations to control request pacing
Error Handling
The scripts handle these automatically:
429: Rate limit - exponential backoff401: Authentication error404: Resource not found400: Bad request - returns validation error
Related lemlist skills
This skill covers campaigns, leads, activities, team, and unsubscribes (auth via
the X-API-KEY header). Two sibling skills cover the enrich/database endpoints,
which use HTTP Basic auth instead:
lemlist-enrich— find/verify an email, find a phone number, enrich from a LinkedIn URL or name + company (POST /api/enrich, async).lemlist-search-db— search the lemlist People database to build prospect lists by job title, company, country, etc. (POST /api/database/people).
A typical chain: lemlist-search-db (find prospects) → lemlist-enrich
(verify/find emails) → this skill's add_leads (push into a campaign).
See Also
- API Reference - Endpoint documentation
- Lemlist API Docs