Skip to main content

Audit Trail Guide

Qarion emits structured audit events for governance-sensitive operations. This guide explains how audit events are generated, what they contain, and how to query the audit log API.

How Audit Events Are Emitted

Audit events are emitted server-side by services whenever a governance-sensitive action occurs. Each service calls emit_audit_event() with structured metadata, producing a persisted AuditLog record.

Services That Emit Audit Events

ServiceEvent Examples
GovernanceOwner changed, steward assigned, classification updated
GlossaryTerm created, updated, deleted, linked to field
Access RequestsRequest submitted, approved, rejected, revoked
CatalogProduct created, updated, deleted
Source SystemsSystem created, deleted, credential updated
QualityCheck created, threshold changed
ConnectorsConnector created, deleted, sync triggered
PermissionsRole assigned, permission rule created/modified

Audit Log API

List Audit Logs

GET /spaces/{slug}/audit-logs

Query Parameters

ParameterTypeDefaultDescription
entity_typestringFilter by entity type (product, glossary_term, source_system, etc.)
entity_idUUIDFilter by specific entity
actionstringFilter by action (created, updated, deleted, etc.)
user_idUUIDFilter by acting user
start_dateISO datetimeEvents after this timestamp
end_dateISO datetimeEvents before this timestamp
limitinteger50Max records to return
offsetinteger0Pagination offset

Response

{
"items": [
{
"id": "uuid",
"entity_type": "glossary_term",
"entity_id": "uuid",
"action": "updated",
"user_id": "uuid",
"user_name": "Jane Smith",
"changes": {
"description": {
"old": "Original definition",
"new": "Updated definition with examples"
}
},
"metadata": {},
"created_at": "2026-02-17T10:30:00Z"
}
],
"total": 142
}

Audit Event Fields

FieldTypeDescription
entity_typestringThe type of entity affected
entity_idUUIDThe specific entity's ID
actionstringThe action performed
user_idUUIDThe user who performed the action
user_namestringDisplay name of the acting user
changesobjectDiff of changed fields (old/new values)
metadataobjectAdditional context (e.g., space slug, request ID)
created_atstringISO timestamp of the event

Audit Event Lifecycle

User Action → API Endpoint → Service Layer → emit_audit_event() → AuditLog table

Events are captured synchronously during the request lifecycle. If the primary operation succeeds but the audit event fails to persist, the operation still completes — audit emission is best-effort.

Best Practices

  • Compliance reporting — Use date-range queries to generate periodic audit reports
  • Change investigation — Filter by entity_id to see the full history of a specific entity
  • User activity — Filter by user_id to review a user's actions across entities
  • Webhook integration — Combine with webhooks to push audit events to external SIEM systems
  • Webhooks — Push audit events to external systems
  • Observability — Monitoring and logging infrastructure