Export Deals
curl --request GET \
--url https://api.example.com/v1/deals/exportimport requests
url = "https://api.example.com/v1/deals/export"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/deals/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/deals/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/deals/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/deals/export")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/deals/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 Deals
Download deals as CSV for pipeline reporting and backups
GET
/
v1
/
deals
/
export
Export Deals
curl --request GET \
--url https://api.example.com/v1/deals/exportimport requests
url = "https://api.example.com/v1/deals/export"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/deals/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/deals/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/deals/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/deals/export")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/deals/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 deals matching the query. Response is streamed withContent-Type: text/csv; charset=utf-8.
Query Parameters
integer
default:"10000"
Maximum rows to return. Maximum 50,000 per request.
string
Scope the export to a single pipeline.
string
Scope the export to a single pipeline stage.
string
Filter by status:
open, won, or lost.string
ISO 8601 lower bound on
created_at.string
ISO 8601 upper bound on
created_at.string
Comma-separated field whitelist. Defaults to
id,name,pipeline_id,stage_id,status,value,currency,company_name,owner_email,created_at,closed_at.Headers
Authorization: Bearer wbk_your_api_key_here
Accept: text/csv
Response
CSV stream withContent-Disposition: attachment; filename="deals-export.csv". First row is headers. Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/deals/export?status=open&limit=2000" \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Accept: text/csv" \
-o deals-open.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/deals/export",
headers={"Authorization": f"Bearer {API_KEY}", "Accept": "text/csv"},
params={"status": "open", "limit": 2000},
stream=True,
) as r:
r.raise_for_status()
with open("deals-open.csv", "wb") as f:
for chunk in r.iter_content(chunk_size=65536):
f.write(chunk)
import fs from 'node:fs';
const url = new URL('https://data.leadlex.com/functions/v1/api-gateway/v1/deals/export');
url.searchParams.set('status', 'open');
url.searchParams.set('limit', '2000');
const res = await fetch(url, {
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Accept': 'text/csv',
},
});
if (!res.ok) throw new Error(`Export failed: ${res.status}`);
await fs.promises.writeFile('deals-open.csv', Buffer.from(await res.arrayBuffer()));
Example Response
id,name,pipeline_id,stage_id,status,value,currency,company_name,owner_email,created_at,closed_at
deal_01HY1,Acme Series B counsel,pipe_default,stage_proposal,open,45000,EUR,Acme Corp,team@emasex.de,2026-04-10T09:00:00Z,
deal_02HY2,Beta compliance audit,pipe_default,stage_qualified,open,22000,EUR,Beta LLP,team@emasex.de,2026-04-12T11: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:deals permission |
| 429 | rate_limited | Export rate limit exceeded (10 per hour per workspace) |