Add Contacts to List
curl --request POST \
--url https://api.lemlist.com/api/contacts/lists/{listId}/entities \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"contactIds": [
"ctc_abc123def456ghi78",
"ctc_xyz789uvw012rst34"
]
}
'import requests
url = "https://api.lemlist.com/api/contacts/lists/{listId}/entities"
payload = { "contactIds": ["ctc_abc123def456ghi78", "ctc_xyz789uvw012rst34"] }
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({contactIds: ['ctc_abc123def456ghi78', 'ctc_xyz789uvw012rst34']})
};
fetch('https://api.lemlist.com/api/contacts/lists/{listId}/entities', 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/contacts/lists/{listId}/entities")
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 \"contactIds\": [\n \"ctc_abc123def456ghi78\",\n \"ctc_xyz789uvw012rst34\"\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/contacts/lists/{listId}/entities",
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([
'contactIds' => [
'ctc_abc123def456ghi78',
'ctc_xyz789uvw012rst34'
]
]),
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;
}{
"message": "Contacts added to list successfully",
"addedCount": 2
}"contactIds is required and must be a non-empty array""The authentication you supplied is incorrect""Contact list not found"Contacts
Add Contacts to List
Adds existing CRM contacts to a static contact list.
POST
/
contacts
/
lists
/
{listId}
/
entities
Add Contacts to List
curl --request POST \
--url https://api.lemlist.com/api/contacts/lists/{listId}/entities \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"contactIds": [
"ctc_abc123def456ghi78",
"ctc_xyz789uvw012rst34"
]
}
'import requests
url = "https://api.lemlist.com/api/contacts/lists/{listId}/entities"
payload = { "contactIds": ["ctc_abc123def456ghi78", "ctc_xyz789uvw012rst34"] }
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({contactIds: ['ctc_abc123def456ghi78', 'ctc_xyz789uvw012rst34']})
};
fetch('https://api.lemlist.com/api/contacts/lists/{listId}/entities', 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/contacts/lists/{listId}/entities")
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 \"contactIds\": [\n \"ctc_abc123def456ghi78\",\n \"ctc_xyz789uvw012rst34\"\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/contacts/lists/{listId}/entities",
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([
'contactIds' => [
'ctc_abc123def456ghi78',
'ctc_xyz789uvw012rst34'
]
]),
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;
}{
"message": "Contacts added to list successfully",
"addedCount": 2
}"contactIds is required and must be a non-empty array""The authentication you supplied is incorrect""Contact list not found"Adds existing contacts to a static contact list. Contacts already in the list are silently skipped — no duplicates are created.
You cannot add contacts to a dynamic list. Dynamic lists are auto-populated based on filter rules configured in the lemlist UI.
Typical workflow
- Find contacts — use
GET /contactswithsearch,email, orlistIdto get contact IDs (ctc_xxx) - Find or create a list — use
GET /contacts/liststo find an existing list, orPOST /contacts/liststo create a new one - Add contacts to the list — call this endpoint with the contact IDs and list ID
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The unique identifier of the contact list (clt_xxx format)
Pattern:
^clt_[a-zA-Z0-9]+$Body
application/json
Array of contact IDs to add to the list (ctc_xxx format). Maximum 1,000 per request.
Maximum array length:
1000Pattern:
^ctc_[a-zA-Z0-9]+$Was this page helpful?