Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Audit Log

Aero2 records audit events for security-relevant actions: logins, logouts, role changes, client modifications, and more. Audit logs are scoped per application — each app only sees its own events. All audit endpoints require admin access.

GET/api/auditAdmin

Returns a paginated list of audit events. Supports filtering by event type, user, and date range.

ParameterTypeDescription
page
query
numberPage number (default: 1)
limit
query
numberResults per page (default: 50, max: 100)
event_type
query
stringFilter by event type
user_id
query
stringFilter by user ID
start_date
query
stringFilter events after this date (ISO 8601)
end_date
query
stringFilter events before this date (ISO 8601)
Response
{
  "audit_logs": [
    {
      "id": "audit-uuid",
      "user_id": "user-uuid",
      "user_email": "jane@example.com",
      "event_type": "user_login",
      "event_data": {
        "idp": "github"
      },
      "ip_address": "203.0.113.1",
      "user_agent": "Mozilla/5.0...",
      "created_at": "2026-02-01T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 1,
    "total_pages": 1
  }
}
GET/api/audit/:idAdmin

Returns details of a specific audit event.

ParameterTypeDescription
id*
path
stringAudit event ID
Response
{
  "id": "audit-uuid",
  "user_id": "user-uuid",
  "user_email": "jane@example.com",
  "user_name": "Jane Doe",
  "event_type": "user_login",
  "event_data": {
    "idp": "github"
  },
  "ip_address": "203.0.113.1",
  "user_agent": "Mozilla/5.0...",
  "created_at": "2026-02-01T10:00:00Z"
}
GET/api/audit/eventsAdmin

Returns all distinct event types with their counts. Useful for building filter UIs.

Response
{
  "event_types": [
    {
      "event_type": "user_login",
      "count": 150
    },
    {
      "event_type": "session_revoked",
      "count": 12
    },
    {
      "event_type": "client_created",
      "count": 3
    }
  ]
}
GET/api/users/:id/auditAdmin

Returns audit events for a specific user.

ParameterTypeDescription
id*
path
stringUser ID
page
query
numberPage number (default: 1)
limit
query
numberResults per page (default: 50, max: 100)
Response
{
  "user": {
    "id": "user-uuid",
    "email": "jane@example.com"
  },
  "audit_logs": [
    {
      "id": "audit-uuid",
      "event_type": "user_login",
      "event_data": {
        "idp": "github"
      },
      "ip_address": "203.0.113.1",
      "user_agent": "Mozilla/5.0...",
      "created_at": "2026-02-01T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 1,
    "total_pages": 1
  }
}

Event Types

Common event types include:

EventDescription
user_loginUser authenticated
user_logoutUser signed out
session_revokedSingle session revoked
session_revoked_allAll sessions revoked
client_createdOAuth client registered
client_deletedOAuth client removed
role_assignedRole assigned to user
role_removedRole removed from user
idp_createdIdentity provider configured