routing.skipAuth is enabled for local development, unauthenticated requests inherit the synthetic admin identity (actorVia: "skip-auth"), as documented in Authentication — never enable skipAuth in production.
GET /api/audit/available
Check whether configuration audit logging is enabled.
GET /api/audit
List audit events using keyset cursor pagination and metadata filters.
DELETE /api/audit/cleanup
Prune audit events older than the configured or specified retention window.
Check Audit Availability
Checks whether PostgreSQL audit logging is active for the current deployment.- Endpoint:
/api/audit/available - Method:
GET - Access: Admin only (
403for non-admin callers) - Success Response:
Query Audit Events
Returns configuration and access audit events ordered from newest to oldest(occurredAt DESC, id DESC) using keyset cursor pagination. Returns 404 when running in file mode.
- Endpoint:
/api/audit - Method:
GET - Access: Admin only
- Query Parameters:
limit(optional, integer1–100, default50): Number of events per page.cursor(optional, opaque string):pagination.nextCursorreturned by a previous response.actor(optional, string): ExactactorUsernamematch.actionPrefix(optional, string): Prefix filter onaction(e.g.server.,group.,key.,config.).targetType(optional, enum): One ofserver,group,bearer_key,user,system_config,template.targetId(optional, string): ExacttargetIdmatch.startDate(optional, ISO 8601 date string): Inclusive lower bound foroccurredAt.endDate(optional, ISO 8601 date string): Inclusive upper bound foroccurredAt.
- Success Response:
Clean Up Expired Audit Events
Deletes audit events older than the configured retention period (system_config.audit.retentionDays, default 365) or an explicit days override. Uses a PostgreSQL transaction advisory lock and batched deletes so multi-replica deployments do not contend on cleanup.
- Endpoint:
/api/audit/cleanup - Method:
DELETE - Access: Admin only
- Query Parameters:
days(optional, integer1–3650): Override the configuredaudit.retentionDaysfor this cleanup run.
- Success Response:
- Conflict Response (
409): Returned when another worker already holds the cleanup advisory lock (data.skipped === true,deletedCount === 0).