Skip to main content

lemlist@1.0.0

listActivities([options])
request(method, path, body, options)

This adaptor exports the following from common:

as()
combine()
cursor()
dataPath()
dataValue()
dateFns
each()
field()
fields()
fn()
fnIf()
group()
lastReferenceValue()
map()
merge()
scrubEmojis()
sourceValue()
util

Functions​

listActivities​

listActivities([options]) ⇒ Operation

List lemlist activities (emails sent, opened, replied, bounced, etc). Returns an array of activities to state.data. Fetches every page until no records remain or limit is reached. Filters which resolve to undefined, null or '' are ignored.

ParamTypeDescription
[options]ListActivitiesOptionsFilters and pagination options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

Example: List all replies since a given date

listActivities({ type: 'emailsReplied', minDate: '2026-10-01T00:00:00Z' });

Example: List activities for a campaign

listActivities({ campaignId: 'cam_abc123' });

Example: Fetch at most 500 activities

listActivities({ type: 'emailsSent', limit: 500 });

Example: Fetch every activity, 50 at a time

listActivities({ type: 'emailsOpened', pageSize: 50 });

request​

request(method, path, body, options) ⇒ Operation

Make a general HTTP request to the lemlist API

ParamTypeDescription
methodstringHTTP method to use
pathstringPath to resource, relative to https://api.lemlist.com/api
bodyobjectObject which will be attached to the request body
optionsRequestOptionsOptional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

Example

request('GET', 'campaigns');

Interfaces​

HttpState​

State object

Properties

NameDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

ListActivitiesOptions​

Options for listing activities

Properties

NameTypeDescription
typestringActivity type to filter by, ie emailsReplied, emailsBounced, emailsUnsubscribed
campaignIdstringOnly return activities for this campaign
leadIdstringOnly return activities for this lead
isFirstbooleanOnly return the first activity of each type
minDatestringOnly return activities created at or after this date (ISO 8601 or unix seconds)
maxDatestringOnly return activities created at or before this date (ISO 8601 or unix seconds)
offsetnumberNumber of records to skip before fetching. Default: 0.
limitnumberMaximum total number of records to return, across all pages. Default: Infinity.
pageSizenumberNumber of records to request per page (max 100). Default: 100.
versionstringlemlist API version. Default: v2.

RequestOptions​

Options provided to the HTTP request

Properties

NameTypeDescription
errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
queryobjectAn object of query parameters to be encoded into the URL.
headersobjectAn object of headers to append to the request.
parseAsstringParse the response body as json, text or stream. By default will use the response headers.
timeoutnumberRequest timeout in ms. Default: 300 seconds.