Skip to main content
POST
/
v2
/
campaigns
/
stats
/
batch
Get Batch Campaign Stats
curl --request POST \
  --url https://api.lemlist.com/api/v2/campaigns/stats/batch \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "campaignIds": [
    "cam_123",
    "cam_456"
  ],
  "startDate": "2024-01-07T22:00:00.000Z",
  "endDate": "2025-07-10T21:59:59.999Z"
}
'
import requests

url = "https://api.lemlist.com/api/v2/campaigns/stats/batch"

payload = {
    "campaignIds": ["cam_123", "cam_456"],
    "startDate": "2024-01-07T22:00:00.000Z",
    "endDate": "2025-07-10T21:59:59.999Z"
}
headers = {
    "Authorization": "Basic <encoded-value>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    campaignIds: ['cam_123', 'cam_456'],
    startDate: '2024-01-07T22:00:00.000Z',
    endDate: '2025-07-10T21:59:59.999Z'
  })
};

fetch('https://api.lemlist.com/api/v2/campaigns/stats/batch', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://api.lemlist.com/api/v2/campaigns/stats/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"campaignIds\": [\n    \"cam_123\",\n    \"cam_456\"\n  ],\n  \"startDate\": \"2024-01-07T22:00:00.000Z\",\n  \"endDate\": \"2025-07-10T21:59:59.999Z\"\n}"

response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.lemlist.com/api/v2/campaigns/stats/batch",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'campaignIds' => [
        'cam_123',
        'cam_456'
    ],
    'startDate' => '2024-01-07T22:00:00.000Z',
    'endDate' => '2025-07-10T21:59:59.999Z'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Basic <encoded-value>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
{ "results": [ { "campaignId": "cam_123", "nbLeads": 32, "nbLeadsLaunched": 32, "nbLeadsReached": 32, "nbLeadsOpened": 31, "nbLeadsInteracted": 4, "nbLeadsAnswered": 16, "nbLeadsInterested": 1, "nbLeadsNotInterested": 0, "nbLeadsUnsubscribed": 1, "nbLeadsInterrupted": 1, "messagesSent": 72, "messagesNotSent": 0, "messagesBounced": 0, "delivered": 72, "opened": 47, "clicked": 4, "replied": 16, "invitationAccepted": 0, "meetingBooked": 0, "steps": [ { "index": 1, "sequenceId": "seq_rH5RD3fMkkt2gM3YC", "sequenceStep": 0, "taskType": "linkedinSend", "invited": 0, "sent": 32, "delivered": 32, "opened": 15, "clicked": 0, "replied": 15, "notDelivered": 0, "bounced": 0, "unsubscribed": 1 } ] } ], "errors": [] }
Careful, the route starts with /v2/. Make sure to include the version in the path.

Authorizations

Authorization
string
header
required

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

Body

application/json
campaignIds
string[]
required

Array of campaign IDs to retrieve stats for

Required array length: 1 - 100 elements
Example:
["cam_123", "cam_456"]
startDate
string
required

Start date in ISO 8601 format

Example:

"2024-01-07T22:00:00.000Z"

endDate
string
required

End date in ISO 8601 format

Example:

"2025-07-10T21:59:59.999Z"

sendUser
string

Filter stats by send user. Format: sendUserId|sendUserEmail. The sendUserId should begin with 'usr_' and the sendUserEmail should be a valid sender email. If the param is specified, both sendUserId and sendUserEmail are mandatory.

Example:

"usr_OcIHizJyIeaDxicQP|email@example.com"

ABSelected
enum<string>

A/B version filter

Available options:
A,
B
channels
enum<string>[]

Filter by communication channels

Available options:
email,
linkedin,
others

Response

Success

results
object[]

Array of campaign stats results

errors
object[]

Array of errors for campaigns that failed to retrieve stats