Skip to main content
GET
/
v1
/
deals
/
export
Export Deals
curl --request GET \
  --url https://api.example.com/v1/deals/export

Request

Returns a CSV file of deals matching the query. Response is streamed with Content-Type: text/csv; charset=utf-8.

Query Parameters

limit
integer
default:"10000"
Maximum rows to return. Maximum 50,000 per request.
pipeline_id
string
Scope the export to a single pipeline.
stage_id
string
Scope the export to a single pipeline stage.
status
string
Filter by status: open, won, or lost.
created_after
string
ISO 8601 lower bound on created_at.
created_before
string
ISO 8601 upper bound on created_at.
fields
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 with Content-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

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

StatusCodeDescription
400validation_errorlimit exceeds 50,000 or invalid filter value
401invalid_keyInvalid or expired API key
403insufficient_permissionsMissing read:deals permission
429rate_limitedExport rate limit exceeded (10 per hour per workspace)