All audit log endpoints require admin role authentication.
Get Audit Logs
Retrieve audit logs with optional filtering by user, table, or date range.Query Parameters
Filter logs by user ID
Filter logs by table name (e.g., “products”, “inventory”)
Start date for date range filter (format: YYYY-MM-DD)
End date for date range filter (format: YYYY-MM-DD)
Number of records to skip for pagination
Maximum number of records to return
Response
Operation status (
success or error)Number of audit logs returned
Array of audit log entries
Get Audit Log by ID
Retrieve detailed information about a specific audit log entry.Path Parameters
Unique identifier of the audit log
Response
Operation status (
success or error)Detailed audit log object including IP address
Create Audit Log
Manually create an audit log entry. This is typically used by system processes to record custom actions.Request Body
ID of the user performing the action
Username of the user (optional)
Type of action: CREATE, UPDATE, DELETE, or READ
Name of the database table affected
ID of the record affected by the action
Previous values (for UPDATE/DELETE actions)
New values (for CREATE/UPDATE actions)
Human-readable description of the action
IP address from which the action was performed
Response
Operation status (
success or error)ID of the created audit log entry
Get Audit Summary
Retrieve aggregated statistics about audit logs, grouped by table, user, and action type.Response
Operation status (
success or error)Total number of audit log entries
Count of actions per table name
Count of actions per user
Count of actions per action type (CREATE, UPDATE, DELETE, READ)
Action Types
Audit logs track the following action types:CREATE
CREATE
Records the creation of new records. The
new_values field contains the initial data of the created record.UPDATE
UPDATE
Records modifications to existing records. Both
old_values and new_values are populated to show what changed.DELETE
DELETE
Records deletion of records. The
old_values field contains the data that was deleted.READ
READ
Records access to sensitive data. Used for compliance and security monitoring.
Common Tables
Audit logs commonly track changes to these tables:products- Product catalog changesinventory- Stock level modificationswarehouses- Warehouse configuration changesusers- User account modificationsmovements- Inventory movement recordstransactions- Transaction history