Schedule new data export. By default, the exported file is sent to the email of the user who created the export as a download link.
To deliver the export to your own application instead, set channel_id to a webhook Channel that is shared with your organization. When the export completes, Luzmo sends a POST request to the webhook URL with the ID of the export task. No email is sent. The request contains the channel secret both in the body and in the x-secret header, so your endpoint can verify it:
{
"webhookId": "< channel ID >",
"secret": "< channel secret >",
"events": [
{
"id": "ae45db5b-8476-4e6b-baf4-d828d9132b4a",
"type": "dataexport",
"timestamp": 1790169252176,
"taskId": "29b8bb5a-e946-4cf6-8960-5a7ba1163e93",
"tenantId": null,
"userId": "1fc1348a-966a-40e8-81a7-405cf2ec01aa",
"dashboardId": "ebd8af7b-e120-4417-9732-5c13ae857c9d",
"chartId": "625fb04c-47ca-42f1-98e5-a4307548355f",
"status": "completed",
"data": {
"format": "csv"
}
}
]
}status is completed or error . Error events also contain an error object with a code and message .
tenantId is the ID of the tenant derived from the suborganization of the Embed token that requested the export, or null (e.g. for API tokens).
Each event is sent once, with a timeout of 10 seconds, and is not retried. If the completed call fails, an error event is sent instead and the task ends with status error .
Use the taskId to retrieve the task and read the download link from result.downloadUrl . The link expires after 7 days. Exports requested with an Embed token belong to the Embed user, so retrieve the task with an API key and token of an Organization Admin.
npm install @luzmo/nodejs-sdk{
"id": "task_id",
"status": "open"
}