The audit_events core model exposes audit log entries from the observability store.
It is a read-only model designed for inspection, filtering, and monitoring.
What This Model Represents¶
Rows include:
idtimestampevent_typeactor_user_identity_typeentity_idoperationstatus
Detail rows also include:
actor_roleorganization_idsession_idnode_idrequest_idcorrelation_idclient_ipchannel
Typical Use Cases¶
Use module_sdk.models.audit_events when you need to:
- build audit dashboards
- list security or admin events
- drill into one audit record for troubleshooting
The monitor module uses its schema in audit tables.
Access Scope¶
This model overrides the generic access-scope behavior.
In practice:
- super-level access can see everything
- organization-level access is scoped by
organization_id - lower-level access is scoped to rows where
actor_user_idmatches the current user
That is a good example of why the model layer is the correct place for access semantics.
Listing Audit Events¶
Example:
listing = module_sdk.models.audit_events.list(
page=0,
page_size=50,
filters={"event_type": "auth.login"},
)Supported filters include:
event_typeactor_user_identity_typeentity_idoperationstatus
The default sort is timestamp desc.
Viewing One Audit Event¶
Example:
event = module_sdk.models.audit_events.view(event_id)Use this when the detail metadata matters more than the list row.
Write Operations Are Disabled¶
This model is read-only through the SDK. Audit data is produced by core runtime instrumentation and should not be mutated as ordinary CRUD data. Modules should not write audit events directly.