Data exports
A data export writes one environment’s records to a CSV file in the background. A warehouse load or a scheduled job reads that one file, where it would otherwise page through a list endpoint one company at a time. You create exports through the API with a secret key, and each export covers the environment the key belongs to.
Export types
Set export_type to one of the values below. The metadata object for each type is listed under Create data export.
Creating and retrieving an export
An export runs in the background, and you retrieve it in three steps:
- Call Create data export with
export_typeandoutput_file_typeset tocsvorcsv.gz. The response returns the export’sidwith astatusofpending. - Wait for the export to finish. Subscribe to the
data_export.completedanddata_export.failedwebhooks, or call Get data export untilstatusissuccessorfailure. Afailurestatus means no file was produced, and you can create a new export to try again. - Call Get data export artifact to download the file. The response body is the file itself, and its
Content-Dispositionheader names it after the export type and creation time, for exampleuser-20261201-090000.csv.
Schematic deletes the file three days after the export completes, so download it within that window. List data exports returns earlier exports, filtered by export_type and status.
When you send metadata, its export_type must match the request’s export_type. Every type accepts notification_email_recipient_email_addresses, a list of up to 100 account member emails that receive a message when the export completes. An ID filter sent as an empty string fails the create request with a 400, so omit a filter you do not want to apply.
Webhooks for finished exports
Schematic sends data_export.completed when an export’s file is ready to download, and data_export.failed when an export fails. Both events fire for every export in the environment, including exports created from the dashboard, so read export_type in the body to route each one. Create the endpoint and subscribe to the events as described in Webhooks.
Schematic retries an export job that fails partway through, and sends data_export.failed only after the last attempt fails. An export that succeeds on a retry sends only data_export.completed.
The body is the data export as Get data export returns it, with artifact_filename added. The body carries no download link, so your handler downloads the file from Get data export artifact with a secret key.
Credit balance export
A credit-balance export writes one row for each company and credit type where the company holds a live grant of that credit, meaning a grant that has not expired or been zeroed out. With no metadata, it covers every company in the environment.
The CSV has these columns:
The export reads companies 250 at a time, so in a large environment the rows for later companies can include usage recorded after the As Of time. The export reads the grants Schematic holds, so a credit balance that an external billing provider such as Orb or Metronome manages does not appear in it.
User export
A user export writes one row per user, oldest first. With no metadata, it covers every user in the environment. The filters work the same way as on GET /users.
A key or trait definition ID that matches no user key or trait fails the create request with a 400. If someone deletes a definition after the export is created, the export leaves its column out.
The CSV has these columns:
Permissions
In the dashboard, a member needs the Data Exports permission for an environment to create exports in it, and admins can always create them. See Roles & permissions.