export_leads_file
Export EVERY lead matching a filter to a downloadable file and return { url, filename, format, count, bytes, truncated }. url is a signed link (valid 7 days) to a private file. Unlike export_leads (which pages 100 at a time), this pulls the whole filtered set server-side into one file. format: csv (default; flat lead columns + account_name + memory_count/documents_count, for spreadsheets) | json | jsonl (both full-fidelity: all columns + ai_memory[] + documents[] + nested contact/account). Same filters as list_leads. max_rows caps the export (default 5000, max 20000); truncated=true means the cap was hit — narrow the filter or raise max_rows for the rest.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "export_leads_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| custom | No | Filter on lead custom fields (list_custom_fields entity 'leads'): { key: value } — value = equals (multiselect: contains), array = any of (multiselect: contains all), null = empty. E.g. { "stufe": "A", "marken": ["KTM"] }. | |
| format | No | csv (default) | json | jsonl | |
| search | No | Free-text search term | |
| status | No | Only entries with this status | |
| category | No | Exact category match (case-insensitive) | |
| max_rows | No | Cap total exported rows (default 5000, max 20000) | |
| owner_id | No | ID of the owner (user) | |
| min_score | No | Only export leads with at least this score (0-100) | |
| stale_days | No | Only leads whose last activity is older than N days | |
| campaign_id | No | ID of the campaign | |
| no_campaign | No | Only leads not assigned to any campaign | |
| include_account | No | Nest the lead's account in json/jsonl (default true) | |
| include_contact | No | Nest the lead's contact in json/jsonl (default true) |