Documentation Index
Fetch the complete documentation index at: https://mintlify.com/InsForge/InsForge/llms.txt
Use this file to discover all available pages before exploring further.
The Logs API provides admin endpoints to retrieve and manage activity logs for your InsForge backend. Track database operations (INSERT, UPDATE, DELETE) and authentication events (LOGIN) across all tables and users.
List Activity Logs
Retrieve paginated activity logs with optional filtering by action type or table name.Authentication
Requires:- Bearer Token: Admin JWT token in
Authorization: Bearer <token>header
Query Parameters
Maximum number of logs to return per page
Number of logs to skip for pagination
Filter by action type. Valid values:
INSERT- Record creation eventsUPDATE- Record modification eventsDELETE- Record deletion eventsLOGIN- User authentication events
Filter by table name (e.g.,
posts, comments). Not applicable for LOGIN actions.Response Headers
Total number of logs matching the query
Current page number (calculated from offset and limit)
Number of items per page (same as limit parameter)
Total number of pages available
Response Body
Unique log entry identifier
When the action occurred (ISO 8601 format)
Type of action:
INSERT, UPDATE, DELETE, or LOGINTable name affected by the action (null for LOGIN actions)
ID of the affected record (null for LOGIN actions)
ID of the user who performed the action
Additional context about the action (structure varies by action type)
Example Request
Example Response
Clear Logs
Delete activity logs, optionally filtering by date. Use this endpoint to manage log storage and comply with data retention policies.Authentication
Requires:- Bearer Token: Admin JWT token in
Authorization: Bearer <token>header
Query Parameters
Delete logs before this timestamp (ISO 8601 format). If not provided, all logs will be deleted.Example:
2024-01-21T10:30:00ZResponse
Success message confirming logs were cleared
Number of log entries deleted
Example Request
Example Response
Error Responses
400 Bad Request - Invalid date format:Get Logs Statistics
Retrieve aggregated statistics about activity logs including action counts, table activity, and recent activity metrics.Authentication
Requires:- Bearer Token: Admin JWT token in
Authorization: Bearer <token>header
Response
Count of logs created in the last 24 hours
Total number of logs in the system
Example Request
Example Response
When to Use Logs APIs
Use these endpoints to:
- Audit database changes: Track all INSERT, UPDATE, and DELETE operations
- Monitor user activity: Review authentication events and user actions
- Debug issues: Investigate what changed and when in your database
- Compliance: Maintain audit trails for regulatory requirements
- Analytics: Analyze usage patterns and activity trends
Common Use Cases
- Admin Dashboard: Display recent activity and statistics using
/api/logs/stats - Audit Trail: Use
/api/logswith filters to track specific tables or users - Security Monitoring: Filter by
action=LOGINto review authentication events - Data Retention: Use
/api/logsDELETE endpoint to comply with retention policies - Debugging: Filter by table and date range to investigate data issues