An object representing an Audit Log Export.
const auditLogExport = { object: 'audit_log_export', id: 'audit_log_export_01GBZK5MP7TD1YCFQHFR22180V', state: 'ready', url: 'https://exports.audit-logs.com/audit-log-exports/export.csv', created_at: '2022-09-02T17:14:57.094Z', updated_at: '2022-09-02T17:14:57.094Z', };
interface AuditLogExportCreate an Audit Log Export.
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'], });
Get an Audit Log Export.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const auditLogExport = await workos.auditLogs.getExport( 'audit_log_export_01GBZK5MP7TD1YCFQHFR22180V', );
The URL will expire after 10 minutes. If the export is needed again at a later time, refetching the export will regenerate the URL.