Skip to main content
GET
/
unsubs
/
export
Export Unsubscribes
curl --request GET \
  --url https://api.lemlist.com/api/unsubs/export \
  --header 'Authorization: Basic <encoded-value>'
import requests

url = "https://api.lemlist.com/api/unsubs/export"

headers = {"Authorization": "Basic <encoded-value>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};

fetch('https://api.lemlist.com/api/unsubs/export', 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/unsubs/export")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'

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

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.lemlist.com/api/unsubs/export",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Basic <encoded-value>"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
"value,source,createdAt\nwilliam.davis@fake.org,lead,2019-12-19T21:56:34.672Z\nemma.johnson@sample.com,abuse,2020-09-30T08:34:17.298Z\nmichael.brown@domain.net,api,2021-03-12T14:12:56.534Z\njane.smith@example.org,bounce,2022-11-23T18:23:45.890Z\njohn.doe@example.com,user,2023-06-15T10:45:21.367Z\nalice.brown@domainexample.com,lead,2023-07-21T09:14:25.521Z\nbob.smith@example.net,user,2023-08-01T17:34:43.679Z\ncharlie.doe@mockmail.com,api,2023-09-12T11:05:37.874Z\ndavid.jones@sampledomain.org,abuse,2023-10-05T15:23:54.129Z\neve.wilson@fakemail.com,bounce,2024-01-07T08:19:45.213Z"
"Bad team"
This endpoint is legacy. Use Export Unsubscribed Variables or Export Unsubscribed Contacts instead.

Authorizations

Authorization
string
header
required

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

Response

Success