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>"
}
'{
"data": {
"created": 123,
"contacts": [
{
"id": "<string>",
"full_name": "<string>",
"email": "<string>"
}
]
}
}Save prospects from search results to your CRM as contacts
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>"
}
'{
"data": {
"created": 123,
"contacts": [
{
"id": "<string>",
"full_name": "<string>",
"email": "<string>"
}
]
}
}Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
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"
}'
{
"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"
}
]
}
}
# 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}")
created).| 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 |