GET /api/audit-logs
Retrieves a paginated list of audit logs that capture all system activities. Each log entry records user actions, including authentication events, role assignments, permission changes, and other security-relevant operations.Authentication
This endpoint requires admin privileges. Include a valid JWT token in the Authorization header.ADMIN
Query Parameters
Filter logs by module name. Common modules include:
AUTH- Authentication eventsUSERS- User management operationsROLES- Role assignment and modificationsPERMISSIONS- Permission changesAUDIT- Audit system events
Filter logs by date in ISO 8601 format (YYYY-MM-DD). Returns all logs created on the specified date.Example:
2026-03-04Page number for pagination (zero-based index).
Number of records per page.
Field to sort by. Available options:
timestamp- Log creation timemodule- Module nameaction- Action typestatus- Operation statususerId- User identifier
Sort direction. Options:
asc (ascending) or desc (descending).Response
Array of activity log entries.
Unique identifier for the log entry (UUID format).
Identifier of the user who performed the action. May be null for system-initiated events.
The system module where the action occurred (e.g., AUTH, USERS, ROLES, PERMISSIONS).
Description of the action performed (e.g., LOGIN, CREATE_USER, ASSIGN_ROLE, UPDATE_PERMISSION).
Additional context and arguments for the action. May contain JSON-formatted data with relevant parameters.
IP address from which the action was initiated.
Outcome of the operation. Common values:
SUCCESS- Operation completed successfullyFAILURE- Operation failedERROR- System error occurred
ISO 8601 timestamp when the action occurred (e.g.,
2026-03-04T10:30:45.123Z).Current page number (zero-based).
Number of items per page.
Total number of log entries matching the filter criteria.
Total number of pages available.
Indicates whether this is the last page of results.
Examples
Get all audit logs (paginated)
Filter by module
Filter by date
Filter by module and date
Sort by user ID in ascending order
Response Example
Error Responses
403 Forbidden
Returned when the authenticated user does not have admin privileges.What Data is Captured
The audit logging system automatically captures comprehensive information about system activities:- User Identity: The userId field identifies who performed the action
- IP Address: The source IP address from which the request originated
- Action Type: A descriptive action name indicating what operation was performed
- Module Context: The system module or component where the action occurred
- Arguments: The details field contains JSON-formatted data with relevant parameters, input values, and context
- Outcome: The status field indicates whether the operation succeeded or failed
- Timestamp: Precise date and time when the action was executed (automatically set by the system)