Create an Audit Log Export. Exports are scoped to a single organization within a specified date range.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const auditLogExport = await workos.auditLogs.createExport({ organizationId: 'org_01EHWNCE74X7JSDV0X3SZ3KJNY', rangeStart: new Date('2022-07-02T18:09:06.996Z'), rangeEnd: new Date('2022-09-02T18:09:06.996Z'), actions: ['user.signed_in'], actors: ['Jon Smith'], targets: ['team'], });
POST/audit_logs /exportsReturns Get an Audit Log Export. The URL will expire after 10 minutes. If the export is needed again at a later time, refetching the export will regenerate the URL.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const auditLogExport = await workos.auditLogs.getExport( 'audit_log_export_01GBZK5MP7TD1YCFQHFR22180V', );
GET/audit_logs /exports /:auditLogExportIdParameters Returns