# Scheduled Exports of Query Results via a Secure Email Link

Veza users can now schedule a periodic export (daily, weekly, etc.) of query results delivered via a secure link in email. When configured, recipients receive a secure link in email which they can download only if they have permission to view the query’s results in Veza.

When clicking a link to download a scheduled export, users are redirected to the Veza login page for Single Sign On (SSO), and the results are downloaded in CSV format. This enables Veza users to share sensitive query results data with other stakeholders while ensuring query data from Veza is protected.

### Link Expiration

* Download links expire after 28 days from the export date. This is a security measure to protect customer data. Expired links cannot be reactivated. If you need to keep the links active beyond 28 days, please contact the Veza support team.

### Granting Download Access

Recipients must have appropriate Veza permissions to download the data. Users must have one of these roles: Admin, Operator, or Viewer. User permissions are checked at download time, and users without sufficient permissions will be unable to download the results.

1. Users must have one of these Veza roles:
   * `Admin`
   * `Operator`
   * `Viewer`
2. For users with other roles (e.g., `Reviewer`):
   * Assign them the `Viewer` role in addition to their current role
   * This grants them access to view and download query results
   * Note: This also gives them access to other queries and dashboards
   * Contact Veza Support if you need more granular permissions

For more information about Veza teams and roles, see [User Management](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/administration/administration/users). For technical support or to request modifications to the link expiration period, please contact your Veza support representative.

How scheduled exports work:

1. Click **Schedule Export** from the ⋮ menu on a query’s details page, or from the **Save** menu in Query Builder. Note that other export options (Save Results as CSV, Send email with Results as CSV, Export to Snowflake) are only available in Query Builder.

   ![Scheduling exports for a saved query.](https://1967633068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZDkWMxox3pekd0NsZJ%2Fuploads%2Fgit-blob-6dcf71274081f0b6aaeb68ffce9c5dc3eb77c292%2Fschedule-export-saved-query.png?alt=media)
2. Select the *CSV Via Secure Link in Email* option in the next window:

   ![Using the export to CSV email option.](https://1967633068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZDkWMxox3pekd0NsZJ%2Fuploads%2Fgit-blob-4980c9e1fcf27c9c8aebd71d32f82d542558b03a%2Fscheduled-export-options.png?alt=media)
3. Configure the schedule and recipient email address
4. At the scheduled intervals, recipients will receive an email containing basic usage instructions and:
   * A secure link to download the query results
   * The query name and execution timestamp

### Scheduling Saved Query Exports

You can enable scheduled exports when [saving a query](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/search/query-builder#saving-a-query). To schedule exports for a saved query:

* Click on a [Dashboard](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/insights/dashboards) tile to open the query details, or find the query on the **Access Visibility** > *Queries* page.
* From the **Query Details** view (Query Actions > Schedule Export)
* Choose a query on the **Separation of Duties** overview and choose **Schedule Export** from the row actions.

To configure the exports from the **Save Query** page:

1. On the **Scheduled Exports** tab, click CSV via Secure Link in Email
2. Choose a single email recipient
3. Choose an export time (UTC)
4. Choose the export frequency:
   * **Daily**: Export runs every day at the specified time
   * **Weekly**: Choose specific days of the week for the export to run
   * **Monthly**: Choose specific months and day of month (1st or 15th) for the export to run
5. (Optional) Configure additional settings for the export:
   * **Include all source tags in results**: Add a column for Veza Tags or provider-native tags on source entities.
   * **Include all destination tags in results**: Add a column for tags on destination entities.
   * **Show {Destination Entity} properties**: Add columns for attributes on the destination entity type.
   * **Show Summary Entities**: Add a column for a summary of entities between the source and destination nodes (if specified in the original query).

Use the **Queries** > **Exports** tab page to review all queries that have been exported or are scheduled for export. The status column indicates whether the results were exported successfully. Use the actions menu to:

* **View Query Details**: Open the query details page.
* **Open in Query Builder**: Edit the query in Query Builder.
* **Open in Graph**: View the query results as a graph.
* **Rerun Export**: Run the export again immediately.
* **Cancel Export**: Cancel an in-progress export.

For scheduled (recurring) exports, an **Edit Export** option is displayed in the menu. Use **Edit Export** to change the schedule, recipient, and export settings. Editing scheduled exports requires the Operator or Admin role.
