Download an export
Download a run's results as JSON, NDJSON, CSV or Excel, filtered or merged with its retries, or share a download link you can revoke.
GET /v1/runs/{id}/export downloads a run's results as one file:
curl "https://dataflow.piloterr.com/v1/runs/RUN_ID/export?format=xlsx" \
-H "x-api-key: YOUR_API_KEY" -o results.xlsxformat | File |
|---|---|
json (default) | An array of results, as Read results shows them. |
ndjson | One result per line. Best for big runs and streaming tools. |
csv | One line per row, UTF-8 with a byte order mark so Excel reads accents right. |
xlsx | The same table, in an Excel sheet named Results. |
Any format can be downloaded, whatever the project's output_formats. Those only set the files prepared when the run ends: the first one is linked in the run.completed webhook and in delivery emails that carry a download link, and cloud storage deliveries upload each of them. The file is named run-RUN_ID.<format>. An export taken while the run is going holds the rows received so far.
Add merged=true to download a run with its retries as one file: one line per row, the latest attempt winning. It works from any run of the family, and the file is named after the run first launched: run-RUN_ID-merged.<format>.
Add rows=ok to download only the rows that succeeded, or rows=ko for only the ones that failed or were invalid (all, the default, keeps every row). With merged=true, those are the rows whose latest attempt succeeded, or failed. The file name ends in -ok (or -ko): run-RUN_ID-ok.csv, run-RUN_ID-merged-ok.csv. For a run that called every row or reached its max cost, CSV and Excel files keep the same columns as the full export; with merged=true, or for a run cancelled or still going, they only have the columns the rows kept fill. In the dashboard, tick Successful rows only in the run's Export menu.
curl "https://dataflow.piloterr.com/v1/runs/RUN_ID/export?format=csv&rows=ok" \
-H "x-api-key: YOUR_API_KEY" -o results-ok.csvThe export also takes the filters of Read results, status and http_status, to download what a filtered page shows: ?format=csv&status=error&http_status=404 gives the rows the API answered 404. When status and rows are both sent, status wins. The file name says which rows it holds, and the parts add up:
| Filter | File name ends in | Example |
|---|---|---|
rows=ok or status=ok | -ok | run-RUN_ID-ok.csv |
rows=ko or status=failed | -ko | run-RUN_ID-ko.csv |
status=error | -error | run-RUN_ID-error.json |
status=invalid | -invalid | run-RUN_ID-invalid.json |
http_status=404 | -http404 | run-RUN_ID-http404.json, with status=error: run-RUN_ID-error-http404.json |
q=espresso | -search- and 8 characters standing for the search | run-RUN_ID-search-1a2b3c4d.csv |
columns=… | -columns- and 8 characters standing for the columns | run-RUN_ID-columns-5e6f7a8b.csv |
A merged export puts -merged first: run-RUN_ID-merged-ko.json.
Large exports
Exports are never zipped. A run's results are streamed to you as they are read, in JSON, NDJSON, CSV or XLSX, whatever the run's size, so a download starts at once and never waits for an archive to be built. JSON, NDJSON and CSV are sent gzip-compressed to any client that sends Accept-Encoding: gzip (browsers, curl --compressed and most HTTP libraries do), which shrinks text exports several times over on the way; your client unpacks them, and the file you save is the plain file. Such an answer has Content-Encoding: gzip and no Content-Length. XLSX files are already compressed (an XLSX is a zip), so they are sent as they are.
curl --compressed "https://dataflow.piloterr.com/v1/runs/RUN_ID/export?format=ndjson" \
-H "x-api-key: YOUR_API_KEY" -o results.ndjsonA link to an export
To hand a download to a browser or another tool without giving it your API key, ask for a signed link:
curl "https://dataflow.piloterr.com/v1/runs/RUN_ID/export/link?format=csv" -H "x-api-key: YOUR_API_KEY"{
"id": "LINK_ID",
"url": "https://dataflow.piloterr.com/exports/…",
"expires_at": "2026-12-02T09:05:00.000Z"
}The link takes the same query as /export and downloads the same file, without a key, until expires_at: 24 hours by default, the project's export_link_ttl_hours (from 1 to 168), or expires_in_hours= on the request. Anyone with the link can download the file until then, so share it with care; ask for a new one once it has expired. A finished run's full export links to the file saved when the run ended; a filtered file of a finished run is written once and given again; a merged export, or one of a run still going, is written when you ask. Every file is deleted with the run's results.
Each download goes through Dataflow: it checks the link, records the download (time, format, IP) and sends the browser to the file for 60 seconds. A link answers 410 once it was revoked (link_revoked), expired (link_expired) or the run's results were deleted (results_expired).
Revoke links
When a link leaked, revoke it: it stops at once, the files stay.
| Request | Revokes |
|---|---|
DELETE /v1/export-links/{id} | One link (id from the answer above). |
DELETE /v1/runs/{id}/export/links | Every link to the run: the API's, the emails' and the webhooks'. The run's page in the dashboard does the same (Export, Revoke download links). |
DELETE /v1/export-links?project_id=… | Every link of a project. |
DELETE /v1/export-links | Every link of the workspace. |
Each answers {"revoked": 2}. GET /v1/export-links (optionally ?run_id= or ?project_id=) lists the latest 100 with where they were given (api, email, webhook), their state, expiry and download count, never the link itself. Links of an email delivery are also revoked when the delivery is turned off, removed, loses its direct link or its recipients change.