Request
Returns a CSV file of deals matching the query. Response is streamed with Content-Type: text/csv; charset=utf-8.
Query Parameters
Maximum rows to return. Maximum 50,000 per request.
Scope the export to a single pipeline.
Scope the export to a single pipeline stage.
Filter by status: open, won, or lost.
ISO 8601 lower bound on created_at.
ISO 8601 upper bound on created_at.
Comma-separated field whitelist. Defaults to id,name,pipeline_id,stage_id,status,value,currency,company_name,owner_email,created_at,closed_at.
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
| 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) |