Get All Logs
Retrieve all system logs including user access, changes, and errors.Authentication
Bearer token from login response
Response
Request success status
Combined logs from all logging tables
Response Example
Log Types
User login/logout events
- User identification
- IP addresses and user agents
- Session duration
- Login and logout timestamps
User deactivation events
- Deactivated user ID
- Admin who performed deactivation
- Reason for deactivation
- Timestamp
Permission modifications
- User and module affected
- Admin who made the change
- Old and new permission values
- Action type (granted/revoked/modified)
WhatsApp webhook events
- Event type (incoming/outgoing)
- Full webhook payload
- Processing status
- Errors if any
Email send history
- Recipients list
- Subject and status
- Sender user
- Timestamps
System errors and exceptions
- Error type and message
- Stack trace
- User who triggered error
- Request path
Error Responses
Unauthorized (401)
Forbidden (403)
Log Data Structure
Thefn_get_all_logs() database function aggregates logs from multiple tables:
Access Log Fields
access_id: Unique identifieruser_id: User who logged inip_address: Client IP addressuser_agent: Browser/client informationlogin_timestamp: When user logged inlogout_timestamp: When user logged out (null if still active)session_duration_minutes: Calculated session length
Permission Change Log Fields
log_id: Unique identifieruser_id: User whose permissions changedmodule_id: Affected modulechanged_by: Admin who made the changeaction: Type of change (granted,revoked,modified)old_permissions: Permission state before changenew_permissions: Permission state after changechanged_at: Timestamp of change
WhatsApp Webhook Log Fields
log_id: Unique identifierevent_type:incomingorstatus_updatepayload: Full webhook JSON payloadprocessed: Boolean indicating if webhook was successfully processederror: Error message if processing failedcreated_at: When webhook was received