Event export status

Poll an event export until its download link is ready.

Statuses run pendingprocessingcompleted (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

ParameterTypeRequiredDescription
statusstringOptionalpendingprocessingcompleted (or failed / expired).
download_urlstringOptionalSet once completed — points at GET /v3/events/export/{id}/download.
row_count / filename / expires_atmixedOptionalRows in the file, the suggested filename, and when the file is deleted.
error_messagestringOptionalWhy a failed export failed — actionable, e.g. how far over the row cap the window was.

Responses

StatusDescription
200The export job.
404No 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"])