@robinpath/lemlist
0.1.2Node.jsPublicLemlist module for RobinPath.
Lemlist
Lemlist module for RobinPath.
Package: @robinpath/lemlist | Category: Email Marketing | Type: Integration
Authentication
lemlist.setCredentials "your-credentials"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the lemlist module when you need to:
- listCampaigns -- Use
lemlist.listCampaignsto perform this operation - getCampaign -- Use
lemlist.getCampaignto perform this operation - listCampaignLeads -- Use
lemlist.listCampaignLeadsto perform this operation - addLeadToCampaign -- Use
lemlist.addLeadToCampaignto perform this operation - deleteLeadFromCampaign -- Use
lemlist.deleteLeadFromCampaignto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setCredentials | Configure lemlist credentials. | object |
listCampaigns | listCampaigns | object |
getCampaign | getCampaign | object |
listCampaignLeads | listCampaignLeads | object |
addLeadToCampaign | addLeadToCampaign | object |
deleteLeadFromCampaign | deleteLeadFromCampaign | object |
pauseLeadInCampaign | pauseLeadInCampaign | object |
resumeLeadInCampaign | resumeLeadInCampaign | object |
markLeadAsInterested | markLeadAsInterested | object |
unsubscribeLead | unsubscribeLead | object |
listActivities | listActivities | object |
getLeadByEmail | getLeadByEmail | object |
listUnsubscribes | listUnsubscribes | object |
exportCampaignStats | exportCampaignStats | object |
getCampaignStats | getCampaignStats | object |
Functions
setCredentials
Configure lemlist credentials.
Module: lemlist | Returns: object -- API response.
lemlist.setCredentials
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | apiKey |
listCampaigns
listCampaigns
Module: lemlist | Returns: object -- API response.
lemlist.listCampaigns
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getCampaign
getCampaign
Module: lemlist | Returns: object -- API response.
lemlist.getCampaign
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listCampaignLeads
listCampaignLeads
Module: lemlist | Returns: object -- API response.
lemlist.listCampaignLeads
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
addLeadToCampaign
addLeadToCampaign
Module: lemlist | Returns: object -- API response.
lemlist.addLeadToCampaign
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
deleteLeadFromCampaign
deleteLeadFromCampaign
Module: lemlist | Returns: object -- API response.
lemlist.deleteLeadFromCampaign
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
pauseLeadInCampaign
pauseLeadInCampaign
Module: lemlist | Returns: object -- API response.
lemlist.pauseLeadInCampaign
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
resumeLeadInCampaign
resumeLeadInCampaign
Module: lemlist | Returns: object -- API response.
lemlist.resumeLeadInCampaign
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
markLeadAsInterested
markLeadAsInterested
Module: lemlist | Returns: object -- API response.
lemlist.markLeadAsInterested
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
unsubscribeLead
unsubscribeLead
Module: lemlist | Returns: object -- API response.
lemlist.unsubscribeLead
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listActivities
listActivities
Module: lemlist | Returns: object -- API response.
lemlist.listActivities
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getLeadByEmail
getLeadByEmail
Module: lemlist | Returns: object -- API response.
lemlist.getLeadByEmail
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listUnsubscribes
listUnsubscribes
Module: lemlist | Returns: object -- API response.
lemlist.listUnsubscribes
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
exportCampaignStats
exportCampaignStats
Module: lemlist | Returns: object -- API response.
lemlist.exportCampaignStats
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getCampaignStats
getCampaignStats
Module: lemlist | Returns: object -- API response.
lemlist.getCampaignStats
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Lemlist API error (${res.status}): ${t} | Check the error message for details |
lemlist.setCredentials requires apiKey. | Check the error message for details |
lemlist.deleteLeadFromCampaign requires an ID. | Check the error message for details |
lemlist.pauseLeadInCampaign requires an ID. | Check the error message for details |
lemlist.resumeLeadInCampaign requires an ID. | Check the error message for details |
lemlist.unsubscribeLead requires an ID. | Check the error message for details |
Lemlist: "..." not configured. Call lemlist.setCredentials first. | Check the error message for details |
@desc "List campaigns and validate result"
do
set $result as lemlist.listCampaigns
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Campaigns
Retrieve all items and loop through them.
@desc "Setup authentication"
do
lemlist.setCredentials $token
enddo
@desc "List campaigns and iterate results"
do
set $result as lemlist.listCampaigns
each $item in $result
print $item
end
enddo
2. Create a new item with addLeadToCampaign
Create a new resource and capture the result.
@desc "Setup authentication"
do
lemlist.setCredentials $token
enddo
@desc "Add lead to campaign"
do
set $result as lemlist.addLeadToCampaign
print "Created: " + $result
enddo
3. Check before creating
List existing items and only create if needed.
@desc "Setup authentication"
do
lemlist.setCredentials $token
enddo
@desc "List campaigns and add lead to campaign"
do
set $existing as lemlist.listCampaigns
if $existing == null
lemlist.addLeadToCampaign
print "Item created"
else
print "Item already exists"
end
enddo
4. Multi-step Lemlist workflow
Chain multiple lemlist operations together.
@desc "Setup authentication"
do
lemlist.setCredentials $token
enddo
@desc "List campaigns, get campaign, and more"
do
set $r_listCampaigns as lemlist.listCampaigns
set $r_getCampaign as lemlist.getCampaign
set $r_listCampaignLeads as lemlist.listCampaignLeads
print "All operations complete"
enddo
5. Safe listCampaigns with validation
Check results before proceeding.
@desc "Setup authentication"
do
lemlist.setCredentials $token
enddo
@desc "List campaigns and validate result"
do
set $result as lemlist.listCampaigns
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- activecampaign -- ActiveCampaign module for complementary functionality
- brevo -- Brevo module for complementary functionality
- convertkit -- Convertkit module for complementary functionality
- mailchimp -- Mailchimp module for complementary functionality
- sendgrid -- SendGrid module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.2 | latest | 1 months ago |
Related Modules
activecampaign
JS@robinpathv0.1.2
ActiveCampaign -- contacts, automations, campaigns, deals, lists, and tags via the ActiveCampaign REST API v3.
brevo
JS@robinpathv0.1.2
Brevo module for RobinPath.
convertkit
JS@robinpathv0.1.1
Convertkit module for RobinPath.
@robinpathv0.1.1
Facebook module for RobinPath.
$ robinpath add @robinpath/lemlist
