curl --request GET \
--url https://api.lemlist.com/api/v2/contacts \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/v2/contacts"
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/v2/contacts', 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/contacts")
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/v2/contacts",
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;
}Search Contacts
Searches your team’s contacts with the filters of the Contacts page, and returns them sorted and paginated.
curl --request GET \
--url https://api.lemlist.com/api/v2/contacts \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/v2/contacts"
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/v2/contacts', 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/contacts")
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/v2/contacts",
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;
}- Flat query parameters for the common cases —
listId=clt_...,notInAnyCampaign=true. advancedFilters, a JSON tree, for everything else, including your team’s custom fields. List the available fields to discover them.
Filtering
The flat parameters are the v1 ones:search, email, listId, notInAnyCampaign, the
company* filters, withPrimaryCompany, fieldRejectionReason and crmSyncStatus.
crmIds looks contacts up by their record id in the connected CRM, and it cannot be
combined with the other filters.
Advanced filters
advancedFilters takes a filter tree encoded as JSON. A node is either a group
(connector and / or, plus children) or a condition (property, operator,
value). The tree is bounded: depth 5, 50 conditions.
{
"type": "group",
"id": "root",
"connector": "and",
"children": [
{
"type": "condition",
"id": "c1",
"property": "jobTitle",
"operator": "contains",
"value": "engineer"
},
{
"type": "group",
"id": "g1",
"connector": "or",
"children": [
{
"type": "condition",
"id": "c2",
"property": "company.domain",
"operator": "ends_with",
"value": "acme.com"
},
{
"type": "condition",
"id": "c3",
"property": "cf_contact_tier",
"operator": "is",
"value": "A"
}
]
}
]
}
property must be a field returned by
List Contact Filters, and every
operator must be one that field’s type allows. An unknown field or a wrong operator is a
400 INVALID_FILTER — never a silently ignored condition.
CRM sync state
crmSyncStatus follows the same values as v1: synced, not_synced, error,
searching, not_found, or one error reason in its lowercase form
(invalid_email, contact_blocked_by_company, …). It requires a CRM to be connected —
otherwise the request answers 400 NO_CRM_CONNECTED.
Sorting and pagination
sortBy accepts createdAt (default), fullName, lastContactedDate and
company.name; sortOrder is asc or desc (default desc). Ties are broken by the
contact id, so a page is stable across calls.
Pagination is offset-based: limit (default 100, max 500) and offset (default 0).
limit + offset must not exceed 10 000 — past that the request answers
400 PAGE_WINDOW_TOO_LARGE rather than silently serving another page.
Coming from v1
- No
idsOrEmails. v2 searches the index; it is not a lookup by id. Fetch a known contact with Get Contact. crmIdsis not a lookup either. It narrows the search, so the response keeps the paginated envelope and an id that matches nothing is simply left out.- The response is
{ data, total, limit, offset }, as v1’s list, with the same row keys. Dates are ISO-8601 instants. - No deep pages. v1 still serves pages past 10 000 rows, which some integrations rely on; v2 refuses them, so narrow with a filter instead of walking deeper.
Examples
curl --request GET \
--url 'https://api.lemlist.com/api/v2/contacts?listId=clt_abc123def456ghi78&limit=50' \
--header 'Authorization: Basic <encoded-value>'
curl --request GET \
--url 'https://api.lemlist.com/api/v2/contacts?companyDomain=acme.com&sortBy=fullName&sortOrder=asc' \
--header 'Authorization: Basic <encoded-value>'
curl --request GET \
--url 'https://api.lemlist.com/api/v2/contacts?limit=100' \
--data-urlencode 'advancedFilters={"type":"group","id":"root","connector":"and","children":[{"type":"condition","id":"c1","property":"cf_contact_tier","operator":"is_any_of","value":["A","B"]}]}' \
--get \
--header 'Authorization: Basic <encoded-value>'
curl --request GET \
--url 'https://api.lemlist.com/api/v2/contacts?crmSyncStatus=error' \
--header 'Authorization: Basic <encoded-value>'
Authorizations
Query Parameters
Filter contacts to those carrying a field rejection with this reason — a value lemlist refused to write, prefixed by its origin (enrichment_* while enriching, crm_sync_* during CRM sync). Returns an empty page (total: 0) when no contact matches. Each row exposes the full detail under fieldRejections[].
enrichment_duplicate_linkedin_url, enrichment_duplicate_linkedin_url_sales_nav, enrichment_duplicate_email, crm_sync_duplicate_linkedin_url, crm_sync_duplicate_linkedin_url_sales_nav, crm_sync_invalid_linkedin_url, crm_sync_invalid_url, crm_sync_invalid_email, crm_sync_invalid_phone, crm_sync_linkedin_url_not_contact, crm_sync_duplicate_contact_blocked, crm_sync_duplicate_company_blocked, crm_sync_company_data_rejected, crm_sync_unsub_state_protected, crm_sync_unsub_channel_empty, crm_sync_value_oscillating, crm_sync_owner_sync_loop, crm_sync_unmapped_user, crm_sync_value_incompatible, crm_sync_unknown_error Filter contacts by their CRM sync state against the team's active CRM provider. Requires a CRM (Hubspot, Salesforce, Pipedrive or Attio) to be connected — otherwise the request answers 400 NO_CRM_CONNECTED. Values:
synced— the contact has a CRM record on the active CRM and no sync error.not_synced— the contact has no CRM record on the active CRM.searching— a CRM search (Search & connect, Create in CRM) is queued or running for the contact.not_found— the last CRM search found no record for the contact.error— at least one sync error is currently raised, whatever its reason.- A specific error reason (lowercase form), to filter by root cause, e.g.
invalid_emailorcontact_blocked_by_company. Theerror,searching,not_foundand reason states read every CRM the contact was synced with, so an error left by a previous CRM counts aserrorand keeps the contact out ofsynced.
synced, not_synced, error, searching, not_found, invalid_email, property_doesnt_exist, required_field_missing, unique_index_error_contact, contact_already_exists_with_name, contact_already_exists_with_linkedin_url, contact_already_exists_with_email, contact_blocked_by_company, contact_blocked_by_company_search, contact_blocked_by_company_without_name, contact_blocked_by_company_without_key, contact_blocked_by_company_already_synced Record ids of contacts in the team's active CRM (HubSpot, Salesforce, Pipedrive or Attio), 1 to 100 values; for Salesforce, the 18-character Contact or Lead id; for Attio, the record UUID. Each contact found carries the matched id under crmSync.crmRecordId; an id that matches no contact is left out. Cannot be combined with the other filters, search and the company filters included.
A filter tree encoded as JSON, addressing any field returned by GET /v2/contacts/filters. A node is either a group (connector and / or, plus children) or a condition (property, operator, value). Max depth 5, max 50 conditions. An unknown property or an operator the field does not allow answers 400 INVALID_FILTER.
Was this page helpful?