Get Contact Sourcing Run
curl --request GET \
--url https://api.lemlist.com/api/contact-sourcing \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/contact-sourcing"
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/contact-sourcing', 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/contact-sourcing")
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/contact-sourcing",
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;
}{
"runId": "<string>",
"companyId": "<string>",
"status": "pending",
"ranAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"reasoning": "<string>",
"error": "<string>",
"contacts": [
{
"leadId": "<string>",
"role": "decision_maker",
"fitScore": 123,
"reasoning": "<string>",
"fullName": "<string>",
"jobTitle": "<string>",
"linkedinUrl": "<string>",
"country": "<string>",
"companyName": "<string>"
}
]
}Contact sourcing
Get Contact Sourcing Run
Reads a contact-sourcing run by ID, or the latest run of an account.
GET
/
contact-sourcing
Get Contact Sourcing Run
curl --request GET \
--url https://api.lemlist.com/api/contact-sourcing \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/contact-sourcing"
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/contact-sourcing', 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/contact-sourcing")
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/contact-sourcing",
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;
}{
"runId": "<string>",
"companyId": "<string>",
"status": "pending",
"ranAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"reasoning": "<string>",
"error": "<string>",
"contacts": [
{
"leadId": "<string>",
"role": "decision_maker",
"fitScore": 123,
"reasoning": "<string>",
"fullName": "<string>",
"jobTitle": "<string>",
"linkedinUrl": "<string>",
"country": "<string>",
"companyName": "<string>"
}
]
}Pass either
runId (the ID returned when you started the run) or
companyId (to read that account’s most recent run) — not both.
The status is in the HTTP code
You can drive a polling loop from the status code alone, without parsing the body:| Code | Meaning |
|---|---|
200 | The run finished. contacts holds the buying committee. |
202 | The run is queued or still going. contacts is empty — poll again. |
400 | The run failed. error says why. |
404 | No such run, or this account has never been sourced. |
Reading the result
Each entry incontacts is one person of the buying committee:
{
"runId": "air_H2nQv7Bs4Jm1Ty8Wk",
"companyId": "cpn_K4tRm2Qw9Yb7Xz1Ns",
"status": "completed",
"reasoning": "Sales-led org; the VP Sales owns tooling decisions.",
"contacts": [
{
"leadId": "123456789",
"role": "decision_maker",
"fitScore": 92,
"reasoning": "Owns the outbound budget and the tooling decision.",
"fullName": "Jane Smith",
"jobTitle": "VP Sales",
"linkedinUrl": "https://www.linkedin.com/in/jane-smith",
"country": "France",
"companyName": "Acme"
}
]
}
leadId is a People Database ID, not a lemlist contact ID. Nobody has been
added to your workspace yet — pass it to
Add a Sourced Contact
to create the contact.companyName is the person’s current employer, which is not always the
account that was classified: someone can match an account through a past role.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query Parameters
The run to read, as returned by POST /contact-sourcing.
Read the LATEST run of this account instead (cpn_xxx format).
Response
The run completed.
Available options:
pending, running, completed, failed The AI's read-out of the account — why it picked these people, or found nobody.
Only on a failed run.
Show child attributes
Show child attributes
Was this page helpful?