lemlist
Run cold-email campaigns and manage leads and sequences in lemlist directly from InTouch. This tool wraps the lemlist REST API so jobs and the AI assistant can read team and campaign data and add or remove leads from a campaign.
It is a self-contained Python tool (Python standard library only — no
third-party packages) that talks to https://api.lemlist.com/api.
What it does
Branch on the operation input. Every call returns a JSON envelope:
status— the HTTP status code as a string (e.g."200")result— the raw lemlist response body as a JSON string
On bad input or a transport failure it instead returns {"error": "..."} and
exits non-zero so the surrounding job step fails.
Operations
| operation | HTTP call | required inputs | notes |
|---|---|---|---|
get_team |
GET /team |
— | Your team / account info. |
list_campaigns |
GET /campaigns |
— | Optional limit (default 100), page (default 1). |
list_campaign_leads |
GET /campaigns/{campaignId}/export/leads |
campaignId |
Exports the leads in a campaign. |
get_lead |
GET /leads/email/{email} |
email |
Look up a single lead by email. |
add_lead_to_campaign |
POST /campaigns/{campaignId}/leads/{email} |
campaignId, email |
Optional firstName, lastName, companyName. |
remove_lead_from_campaign |
DELETE /campaigns/{campaignId}/leads/{email} |
campaignId, email |
Unsubscribes / removes the lead. |
Inputs
| input | required | description |
|---|---|---|
apiKey |
yes | Your lemlist API key. |
operation |
yes | One of the operations above. |
campaignId |
for campaign ops | Campaign id, e.g. cam_xxxxxxxx. |
email |
for lead ops | Lead email address. |
limit |
no | Max results for list_campaigns (default 100). |
page |
no | Page number for list_campaigns (default 1). |
firstName |
no | Lead first name for add_lead_to_campaign. |
lastName |
no | Lead last name for add_lead_to_campaign. |
companyName |
no | Lead company name for add_lead_to_campaign. |
API key setup
- Log in to lemlist.
- Go to Settings → Integrations → API (or open
https://app.lemlist.com/settings/integrations). - Generate / copy your API key.
- Pass it to the tool as
apiKey.
Authentication detail
lemlist uses HTTP Basic authentication with a twist: the username is
always empty and the password is your API key. This tool builds the
credential string ":<apiKey>", base64-encodes it, and sends it as
Authorization: Basic <encoded>. A single API key is all that is needed — no
OAuth or token exchange.
Examples
List the first page of campaigns:
{
"apiKey": "YOUR_LEMLIST_API_KEY",
"operation": "list_campaigns",
"limit": "50",
"page": "1"
}
Add a lead to a campaign:
{
"apiKey": "YOUR_LEMLIST_API_KEY",
"operation": "add_lead_to_campaign",
"campaignId": "cam_aBcDeFg",
"email": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"companyName": "Example Inc"
}
Look up a lead by email:
{
"apiKey": "YOUR_LEMLIST_API_KEY",
"operation": "get_lead",
"email": "[email protected]"
}
Remove a lead from a campaign:
{
"apiKey": "YOUR_LEMLIST_API_KEY",
"operation": "remove_lead_from_campaign",
"campaignId": "cam_aBcDeFg",
"email": "[email protected]"
}
Notes
- Response bodies are capped at ~5 MB.
resultis the raw lemlist JSON as a string; parse it downstream as needed.- HTTP 4xx/5xx responses are returned with their
statusandresultbody intact (not raised) so you can inspect lemlist's error message.