Export Contacts
curl --request GET \
--url https://api.example.com/v1/contacts/exportimport requests
url = "https://api.example.com/v1/contacts/export"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/contacts/export', 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/contacts/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/contacts/export"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/contacts/export")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/contacts/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyImport & Export
Export Contacts
Download contacts as CSV for analytics and backup purposes
GET
/
v1
/
contacts
/
export
Export Contacts
curl --request GET \
--url https://api.example.com/v1/contacts/exportimport requests
url = "https://api.example.com/v1/contacts/export"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/contacts/export', 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/contacts/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/contacts/export"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/contacts/export")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/contacts/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyRequest
Returns a CSV file of contacts matching the query. Use for analytics exports, backups, or migrating data out of LeadLex. The response is streamed withContent-Type: text/csv; charset=utf-8.
Query Parameters
integer
default:"10000"
Maximum rows to return. Maximum 50,000 per request. For larger exports, paginate by
created_after / created_before.string
ISO 8601 lower bound on
created_at.string
ISO 8601 upper bound on
created_at.string
Filter by list membership.
string
Filter to contacts carrying the given tag. Repeat to require multiple tags.
string
Comma-separated list of fields to include. Defaults to the standard export set (
id, full_name, email, phone, job_title, company_name, linkedin_url, tags, created_at).Headers
Authorization: Bearer wbk_your_api_key_here
Accept: text/csv
Response
The body is a CSV document. Responses includeX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID, and Content-Disposition: attachment; filename="contacts-export.csv". The first row is always the header.
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/contacts/export?limit=5000" \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Accept: text/csv" \
-o contacts.csv
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
with requests.get(
f"{BASE_URL}/v1/contacts/export",
headers={"Authorization": f"Bearer {API_KEY}", "Accept": "text/csv"},
params={"limit": 5000},
stream=True,
) as r:
r.raise_for_status()
with open("contacts.csv", "wb") as f:
for chunk in r.iter_content(chunk_size=65536):
f.write(chunk)
import fs from 'node:fs';
const res = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/contacts/export?limit=5000',
{
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Accept': 'text/csv',
},
}
);
if (!res.ok || !res.body) throw new Error(`Export failed: ${res.status}`);
await fs.promises.writeFile('contacts.csv', Buffer.from(await res.arrayBuffer()));
Example Response
id,full_name,email,phone,job_title,company_name,linkedin_url,tags,created_at
123e4567-e89b-12d3-a456-426614174000,Jane Doe,jane@acme.com,+1-555-0100,General Counsel,Acme Corp,https://linkedin.com/in/janedoe,"lead,priority",2026-04-15T09:00:00Z
456e7890-a1b2-34c5-d678-901234567890,Bob Smith,bob@beta.com,+1-555-0200,CEO,Beta LLP,,"prospect",2026-04-16T14:30:00Z
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | limit exceeds 50,000 or invalid filter value |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing read:contacts permission |
| 429 | rate_limited | Export is rate-limited to 10 calls per hour per workspace |