Skip to main content

List Audit Events

GET /v1/console/audit-events
Returns a paginated list of audit events for the current tenant. Each event records a mutation (create, update, delete, activate, deactivate) to a user, role, or permission, along with who performed it and when.

Authentication

Requires Super Admin role.

Query parameters

actor_user_id
string
Filter by the user who performed the action.
target_type
string
Filter by target type: user, role, or permission.
target_id
string
Filter by specific target ID.
event_type
string
Filter by event type (see table below).
start_date
datetime
Filter events after this date (ISO 8601).
end_date
datetime
Filter events before this date (ISO 8601).
skip
integer
default:"0"
Number of records to skip.
limit
integer
default:"50"
Max records to return (1-200).

Event types

Event typeDescription
user.createdA new user was invited/created
user.updatedA user’s profile or role was changed
user.activatedA user was reactivated
user.deactivatedA user was deactivated
user.deletedA user was soft-deleted
role.createdA new role was created
role.updatedA role was renamed or updated
role.deletedA role was deleted
permission.updatedRole permissions were changed

Example request

curl "https://mind-be.staging.miva.university/v1/console/audit-events?target_type=user&limit=20" \
  -H "Authorization: Bearer <access_token>"

Response

{
  "success": true,
  "data": [
    {
      "id": "6650f6a7b8c9d0e1f2a3b4c5",
      "tenant_id": "6650a0b1c2d3e4f5a6b7c8d9",
      "actor_user_id": "6650a1b2c3d4e5f6a7b8c9d0",
      "actor_email": "admin@example.com",
      "actor_name": "Admin User",
      "target_type": "user",
      "target_id": "6650b2c3d4e5f6a7b8c9d0e1",
      "event_type": "user.created",
      "event_time": "2026-04-01T14:00:00Z",
      "metadata": {
        "user_id": "6650b2c3d4e5f6a7b8c9d0e1",
        "tenant_id": "6650a0b1c2d3e4f5a6b7c8d9"
      }
    }
  ],
  "total": 1,
  "page": 1,
  "page_size": 20,
  "total_pages": 1,
  "message": null
}

Notes

  • Events are sorted newest first by default.
  • actor_email and actor_name are resolved from the user record. If the actor has been deleted, these will be null.
  • metadata contains the raw event payload and varies by event type.
  • Audit events are created automatically when mutations occur through the console. They are not retroactive — only events after the audit system was enabled are recorded.