Download an event export
Download the generated events CSV.
Streams the CSV with a Content-Disposition: attachment header — pipe it straight to a file (curl -o events.csv …) or load it into your warehouse. Available once the export status is completed, until it expires (7 days after completion).
GET /v3/events/export/{id}/download
Responses
| Status | Description |
|---|---|
200 | The CSV file (text/csv). |
404 | No such export, not finished yet, or expired (exports are kept for 7 days). |
Code examples
cURL
curl -L -o events.csv \
https://api.wemail.io/v3/events/export/$EXPORT_ID/download \
-H "Authorization: Bearer afn_live_…"Node.js
const csv = await (await fetch(
`https://api.wemail.io/v3/events/export/${exportId}/download`,
{ headers: { Authorization: `Bearer ${process.env.WEMAIL_API_KEY}` } },
)).text();Python
csv_text = requests.get(
f"https://api.wemail.io/v3/events/export/{export_id}/download",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
).text