Skip to content

Audit (audit_events)

Audit

Terma Grand maintains a log of all significant actions (audit_events). Access to the audit log is via the API.

What is Logged

EventDescription
pass.createdPass created
pass.cancelledPass cancelled (by user or system)
pass.verifiedPass verified by a guard
blacklist.blockedVehicle added to blacklist
blacklist.unblockedVehicle removed from blacklist
invite.createdInvite link created
invite.activatedInvite link activated (role granted)

Event Fields

FieldDescription
idUnique event identifier
eventTypeEvent type (see table above)
actorUserIdID of the user who performed the action
payloadAdditional data (depends on event type)
createdAtTimestamp (UTC)

API Access

The audit log is accessible via the internal REST API:

GET /api/audit?limit=50&offset=0
Authorization: Bearer <INTERNAL_API_SECRET>

Response:

{
"events": [
{
"id": "evt_abc123",
"eventType": "pass.created",
"actorUserId": "usr_xyz",
"payload": { "passId": "pass_001", "plate": "A777AA77" },
"createdAt": "2025-01-15T10:30:00.000Z"
}
],
"total": 150
}

Data Retention

Events are stored in PostgreSQL in the audit_events table. Data is not automatically deleted — configure a retention policy according to your compliance requirements.