Save Prospects
curl --request POST \
--url https://api.example.com/v1/prospects/save \
--header 'Content-Type: application/json' \
--data '
{
"prospects": [
{
"name": "<string>",
"email": "<string>",
"title": "<string>",
"company_name": "<string>",
"linkedin_url": "<string>"
}
],
"list_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/prospects/save"
payload = {
"prospects": [
{
"name": "<string>",
"email": "<string>",
"title": "<string>",
"company_name": "<string>",
"linkedin_url": "<string>"
}
],
"list_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
prospects: [
{
name: '<string>',
email: '<string>',
title: '<string>',
company_name: '<string>',
linkedin_url: '<string>'
}
],
list_id: '<string>'
})
};
fetch('https://api.example.com/v1/prospects/save', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/prospects/save",
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([
'prospects' => [
[
'name' => '<string>',
'email' => '<string>',
'title' => '<string>',
'company_name' => '<string>',
'linkedin_url' => '<string>'
]
],
'list_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/prospects/save"
payload := strings.NewReader("{\n \"prospects\": [\n {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"title\": \"<string>\",\n \"company_name\": \"<string>\",\n \"linkedin_url\": \"<string>\"\n }\n ],\n \"list_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/prospects/save")
.header("Content-Type", "application/json")
.body("{\n \"prospects\": [\n {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"title\": \"<string>\",\n \"company_name\": \"<string>\",\n \"linkedin_url\": \"<string>\"\n }\n ],\n \"list_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/prospects/save")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"prospects\": [\n {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"title\": \"<string>\",\n \"company_name\": \"<string>\",\n \"linkedin_url\": \"<string>\"\n }\n ],\n \"list_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": 123,
"contacts": [
{
"id": "<string>",
"full_name": "<string>",
"email": "<string>"
}
]
}
}Prospects
Save Prospects
Save prospects from search results to your CRM as contacts
POST
/
v1
/
prospects
/
save
Save Prospects
curl --request POST \
--url https://api.example.com/v1/prospects/save \
--header 'Content-Type: application/json' \
--data '
{
"prospects": [
{
"name": "<string>",
"email": "<string>",
"title": "<string>",
"company_name": "<string>",
"linkedin_url": "<string>"
}
],
"list_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/prospects/save"
payload = {
"prospects": [
{
"name": "<string>",
"email": "<string>",
"title": "<string>",
"company_name": "<string>",
"linkedin_url": "<string>"
}
],
"list_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
prospects: [
{
name: '<string>',
email: '<string>',
title: '<string>',
company_name: '<string>',
linkedin_url: '<string>'
}
],
list_id: '<string>'
})
};
fetch('https://api.example.com/v1/prospects/save', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/prospects/save",
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([
'prospects' => [
[
'name' => '<string>',
'email' => '<string>',
'title' => '<string>',
'company_name' => '<string>',
'linkedin_url' => '<string>'
]
],
'list_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/prospects/save"
payload := strings.NewReader("{\n \"prospects\": [\n {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"title\": \"<string>\",\n \"company_name\": \"<string>\",\n \"linkedin_url\": \"<string>\"\n }\n ],\n \"list_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/prospects/save")
.header("Content-Type", "application/json")
.body("{\n \"prospects\": [\n {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"title\": \"<string>\",\n \"company_name\": \"<string>\",\n \"linkedin_url\": \"<string>\"\n }\n ],\n \"list_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/prospects/save")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"prospects\": [\n {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"title\": \"<string>\",\n \"company_name\": \"<string>\",\n \"linkedin_url\": \"<string>\"\n }\n ],\n \"list_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": 123,
"contacts": [
{
"id": "<string>",
"full_name": "<string>",
"email": "<string>"
}
]
}
}Request
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Body Parameters
array
required
string
Optional: UUID of list to add contacts to
Response
object
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/prospects/save \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prospects": [
{
"name": "John Smith",
"email": "john@example.com",
"title": "CEO",
"company_name": "Acme Legal Corp",
"linkedin_url": "https://linkedin.com/in/johnsmith"
}
],
"list_id": "abc-123"
}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# Save prospects from search results
prospects_to_save = [
{
"name": "John Smith",
"email": "john@example.com",
"title": "CEO",
"company_name": "Acme Legal Corp",
"linkedin_url": "https://linkedin.com/in/johnsmith"
}
]
data = {
"prospects": prospects_to_save,
"list_id": "abc-123" # Optional
}
response = requests.post(f"{BASE_URL}/v1/prospects/save", headers=headers, json=data)
result = response.json()["data"]
print(f"Created {result['created']} contacts")
const response = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/prospects/save',
{
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prospects: [
{
name: 'John Smith',
email: 'john@example.com',
title: 'CEO',
company_name: 'Acme Legal Corp',
linkedin_url: 'https://linkedin.com/in/johnsmith'
}
],
list_id: 'abc-123'
})
}
);
const { data } = await response.json();
console.log(`Created ${data.created} contacts`);
Example Response
{
"data": {
"created": 1,
"contacts": [
{
"id": "789e0123-e45b-67c8-a901-234567890abc",
"full_name": "John Smith",
"email": "john@example.com",
"job_title": "CEO",
"company_name": "Acme Legal Corp"
}
]
}
}
Complete Workflow Example
Search for prospects, then save them:# Step 1: Search for prospects
search_response = requests.post(
f"{BASE_URL}/v1/prospects/search",
headers=headers,
json={
"query": {
"person_titles": ["CEO"],
"organization_industries": ["Legal"]
},
"per_page": 50
}
)
prospects = search_response.json()["data"]["prospects"]
# Step 2: Create a list
list_response = requests.post(
f"{BASE_URL}/v1/lists",
headers=headers,
json={"name": "Law Firm CEOs", "description": "Q1 Campaign"}
)
list_id = list_response.json()["data"]["id"]
# Step 3: Save prospects to CRM and list
save_response = requests.post(
f"{BASE_URL}/v1/prospects/save",
headers=headers,
json={
"prospects": prospects,
"list_id": list_id
}
)
result = save_response.json()["data"]
print(f"Saved {result['created']} contacts to list {list_id}")
// Step 1: Search for prospects
const searchResponse = await fetch(`${BASE_URL}/v1/prospects/search`, {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify({
query: {
person_titles: ['CEO'],
organization_industries: ['Legal']
},
per_page: 50
})
});
const { data: { prospects } } = await searchResponse.json();
// Step 2: Create a list
const listResponse = await fetch(`${BASE_URL}/v1/lists`, {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Law Firm CEOs',
description: 'Q1 Campaign'
})
});
const { data: { id: listId } } = await listResponse.json();
// Step 3: Save prospects
const saveResponse = await fetch(`${BASE_URL}/v1/prospects/save`, {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify({
prospects,
list_id: listId
})
});
const { data: result } = await saveResponse.json();
console.log(`Saved ${result.created} contacts to list ${listId}`);
Duplicate Handling
The API automatically detects duplicate contacts based on email address. If a contact already exists, it will be skipped (not counted in
created).Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid prospect data |
| 401 | invalid_key | Invalid API key |
| 403 | insufficient_permissions | Missing write permission |
| 404 | not_found | List ID not found (if provided) |
| 429 | rate_limited | Rate limit exceeded |