Event export status
Poll an event export until its download link is ready.
Statuses run pending → processing → completed (or failed). Once completed, the response carries download_url and row_count; a failed job explains itself in error_message — most commonly the 1,000,000-row cap, in which case split the window and re-submit. Exports expire 7 days after completion; expires_at tells you when.
GET /v3/events/export/{id}
Response fields
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | Optional | pending → processing → completed (or failed / expired). |
download_url | string | Optional | Set once completed — points at GET /v3/events/export/{id}/download. |
row_count / filename / expires_at | mixed | Optional | Rows in the file, the suggested filename, and when the file is deleted. |
error_message | string | Optional | Why a failed export failed — actionable, e.g. how far over the row cap the window was. |
Responses
| Status | Description |
|---|---|
200 | The export job. |
404 | No such export on your account. |
Code examples
cURL
curl https://api.wemail.io/v3/events/export/$EXPORT_ID \
-H "Authorization: Bearer afn_live_…"
# → { "status": "completed", "row_count": 48210, "download_url": "…" }Node.js
const job = await (await fetch(
`https://api.wemail.io/v3/events/export/${exportId}`,
{ headers: { Authorization: `Bearer ${process.env.WEMAIL_API_KEY}` } },
)).json();
if (job.status === "completed") console.log(job.download_url);Python
job = requests.get(
f"https://api.wemail.io/v3/events/export/{export_id}",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
).json()
if job["status"] == "completed":
print(job["download_url"])