Skip to content

Query API

Use AuditService.query() to search audit log entries with wildcard filters, pagination, and date range support.

Example

typescript
const result = await auditService.query({
  actorId: 'user-123',
  action: 'invoice.*',     // wildcard support
  targetType: 'Invoice',
  from: new Date('2026-01-01'),
  to: new Date('2026-04-01'),
  limit: 50,
  offset: 0,
});
// -> { entries: AuditEntry[], total: number }

Query Parameters

ParameterTypeDescription
actorIdstringFilter by actor ID
actionstringFilter by action name (supports wildcards, e.g. invoice.*)
targetTypestringFilter by target type
fromDateStart of date range
toDateEnd of date range
limitnumberMaximum number of entries to return
offsetnumberNumber of entries to skip (for pagination)

Response Format

typescript
{ entries: AuditEntry[], total: number }

Released under the MIT License.