Overview
The Audit Trail automatically logs all significant actions performed in your organization, providing a complete history of who did what, when, and whether it succeeded or failed.Permission required:
audit_logs:read (ANY scope)Audit logs are automatically created for all CREATE, UPDATE, DELETE, and CONFIGURE operations. Read-only operations (READ, VIEW, SEARCH) are excluded to reduce clutter.API Endpoint
Get audit logs:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
actorType | enum | No | - | Filter by actor: organization_admin, organization_user |
resourceType | enum | No | - | Filter by resource (see resource types below) |
actionType | enum | No | - | Filter by action: CREATE, UPDATE, DELETE, DEFAULT, CONFIGURE |
startDate | string (ISO date) | No | - | Filter logs from this date |
endDate | string (ISO date) | No | - | Filter logs to this date |
search | string | No | - | Search in actor name and description |
page | number | No | 1 | Page number for pagination |
limit | number | No | 20 | Records per page (max recommended: 100) |
sortBy | enum | No | createdAt | Sort by: createdAt, actorName, actionType, resourceType |
sortOrder | enum | No | desc | Sort order: asc, desc |
| Value | Description |
|---|---|
ORGANIZATION | Organization settings |
ORGANIZATION_USER | Members/users |
SAVINGS | Deposits and withdrawals |
LOAN | Loan creation and modifications |
LOAN_INSTALLMENT | Loan installment changes |
LOAN_PAYMENT | Loan payment recording |
EXPENSE | Expense recording |
ASSET | Fixed asset management |
TRANSACTION | General transactions |
UPLOAD | File uploads |
CONFIG | Configuration changes |
Response Structure
| Field | Type | Description |
|---|---|---|
id | string | Audit log ID |
actorName | string | Name of person who performed action |
actorType | enum | Actor type: organization_admin, organization_user |
actionType | enum | Action performed: CREATE, UPDATE, DELETE, DEFAULT, CONFIGURE |
resourceType | enum | Type of resource affected |
description | string | Human-readable description of action |
metadata | object | Additional details including status (success/failed) |
createdAt | string (ISO datetime) | When action occurred |
| Field | Type | Description |
|---|---|---|
page | number | Current page number |
limit | number | Records per page |
totalCount | number | Total audit logs matching filters |
totalPages | number | Total pages available |
hasNextPage | boolean | More pages available after current |
hasPreviousPage | boolean | Pages available before current |
What Gets Logged
Automatically logged: CREATE operations:- ✅ New loan creation
- ✅ New deposit recording
- ✅ New expense recording
- ✅ New asset addition
- ✅ New member registration
- ✅ New invitation sent
- ✅ Loan modifications
- ✅ Member information changes
- ✅ Configuration updates
- ✅ Role assignments
- ✅ Expense deletion
- ✅ Asset disposal
- ✅ Member deactivation
- ✅ Organization settings changes
- ✅ Permission modifications
- ✅ System configuration updates
- ❌ READ operations (viewing pages, reports)
- ❌ VIEW operations (browsing data)
- ❌ SEARCH operations (searching records)
- ❌ System admin actions (excluded from organization audit trail)
Filtering Audit Logs
Filter by Actor Type
Organization Admins only:Filter by Resource Type
Loan-related activities:Filter by Action Type
Only creations:Filter by Date Range
Last 7 days:Search by Keywords
Find actions by specific user:actorName and description fields (case-insensitive).
Combine Filters
Deletions by admins in last month:Pagination
Default: 20 records per page Navigate pages:- If
hasNextPage = true: Requestpage + 1 - If
hasPreviousPage = true: Requestpage - 1
Sorting
Most recent first (default):Status Detection
Success vs Failed: Backend determines status from HTTP response code:- Status = ‘success’: HTTP 200-299 (successful operation)
- Status = ‘failed’: HTTP 400+ (error occurred)
Use Cases
Compliance & Audit
Annual audit review:- All financial transactions
- Proper authorization
- Change tracking
Security Monitoring
Track deletions (sensitive operations):- Failed operations may indicate permission issues
- Unusual patterns (many failed attempts) warrant investigation
Troubleshooting
Find who made erroneous entry:Training & Quality Control
Review new user actions:Example Scenarios
Scenario 1: Investigating Loan Error
Problem: Member claims loan amount was recorded incorrectly Investigation:Scenario 2: Monthly Security Review
Goal: Check for unusual admin activity in June API call:- Are deletions authorized?
- Are deletion counts normal?
- Any suspicious patterns?
Scenario 3: Audit Trail Export
Goal: Provide audit evidence for external audit API calls:- Paginate through all results
- Export to spreadsheet or PDF
- Provide to auditors as supporting documentation
Audit Log Retention
Storage: Audit logs are permanently stored in the database and cannot be deleted by users. Why permanent?- Compliance requirements (may need 7+ years)
- Legal evidence
- Fraud investigation
- Historical analysis
Best Practices
Effective audit trail management:Regular monitoring:
- ✅ Review audit logs weekly for unusual activity
- ✅ Check failed operations (may indicate issues)
- ✅ Monitor DELETE actions (sensitive)
- ✅ Track admin actions (elevated permissions)
- ✅ Use date filters to narrow down to specific periods
- ✅ Filter by resourceType when investigating specific area
- ✅ Search by actor name to track specific user’s actions
- ✅ Combine filters for precise results
- ✅ Sort chronologically (sortBy=createdAt) to see timeline
- ✅ Check metadata for additional context
- ✅ Cross-reference with actual records (loans, deposits, etc.)
- ✅ Document findings
- ✅ Export audit logs for external audits
- ✅ Keep copies of audit exports with financial reports
- ✅ Review audit logs before period closing
- ✅ Demonstrate access controls to auditors
- ✅ Use appropriate page size (20-50 for UI, 100 for exports)
- ✅ Check
hasNextPagebefore requesting more - ✅ Don’t request all logs at once (use filters)
Limitations
Cannot delete audit logs: Logs are permanent and immutable. This ensures audit trail integrity but means:- No way to remove incorrect/test logs
- Logs accumulate over time
- Use filters to find relevant logs in large datasets
- Viewing reports not logged
- Browsing pages not logged
- Search queries not logged
- organization_admin actions
- organization_user actions
- System admin actions excluded (different audit trail)
- Default: 20 records per page
- Use filters to reduce result set
- Paginate through results as needed
Troubleshooting
Q: Can’t see audit logs A: Requiresaudit_logs:read permission with ANY scope. Contact administrator to grant permission.
Q: Too many logs to review A: Use filters to narrow down:
Q: Log description unclear A: Check
metadata field for additional details:
Q: Can’t find specific action A: Verify:
- Is action CREATE/UPDATE/DELETE/CONFIGURE? (READ/VIEW not logged)
- Is actor organization user/admin? (system_admin excluded)
- Check date range is correct
- Try broader search terms
Q: Want to export audit logs A: Paginate through results and save to CSV/Excel:
Related Topics
Permissions
Understanding access control
Journal Entries
View financial transaction details
Period Closing
Review audit trail before closing
Organization Settings
Configure organization