Audit (REST)
Inspect audit logs and activity. Auth required.
Audit entries are written automatically: every model mutation (create/update/delete via GraphQL) is recorded with its operation, entity, JSON details, and the acting user (
user_id, from the JWT). A background listener on the model-event stream performs the writes.
Access control:
GET /audit/logs,GET /audit/entity/..., andGET /audit/statisticsrequire theAdminorManagerrole.GET /audit/user/{id}/activityis viewable by the user themselves, or by Admin/Manager for any user.
Endpoints
GET /audit/logs— filters:entity_type,entity_id,user_id,operation,start_date,end_date,limit,offsetGET /audit/user/{user_id}/activity— optionalstart_date,end_date, pagingGET /audit/entity/{entity_type}/{entity_id}/audit— entity audit trailGET /audit/statistics— aggregate stats
Example:
http
GET /audit/logs?entity_type=Contact&limit=50
Authorization: Bearer <jwt>Operations: create | update | delete | read.