Exporting Events
Export Audit Log Events through the WorkOS Dashboard and API.
You may need to export Audit Log Events in large chunks. WorkOS supports exporting events as CSV files through both the Dashboard and API.
Exports are scoped to a single organization within a specified date range. You can export events within the organization’s configured retention period, which defaults to 30 days and can be increased. You may define additional filters such as actions, actors, and targets.
Each export’s range_start – range_end must span no more than 31 days, regardless of the retention period. Larger ranges return HTTP 400 with code invalid_audit_log_export_range_date and message “Date range cannot exceed 31 days”. To export a longer period, create multiple exports of up to 31 days each.
Exports can be manually created under the Organization page when viewing Audit Log Events by selecting “Export CSV” from the “Actions” dropdown. Set your filters and select “Generate CSV file”.

Once the export has been created, fetch the export at a later time to access the url of the generated CSV file.
If the state of the export is still pending, poll the export until it is ready for download.