Factorizer/Cluster ERP WikiCluster ERP Türkçe
Home / API reference

API

Logs API (logs)

HTTP endpoints of the logs module under /api/v1/logs: 9 routes with permissions, schemas, status codes, and error codes.

The logs module serves the activity log, the error log with a client error report and a lookup by trace id, and the change history. All 9 endpoints sit under /api/v1/logs. For business meaning see the Logs module page.

Group facts

Item Value Source
Base path /api/v1/logs src/cluster_erp/core/module_base.py:37-38, src/cluster_erp/modules/logs/module.py:42
Routers 3 router objects in 3 files; listed in the section Endpoint summary src/cluster_erp/modules/logs/module.py:31
Endpoints 9, counted from the route decorators and add_api_route calls of the routers that register_routes mounts src/cluster_erp/modules/logs/activity_log/routes.py, src/cluster_erp/modules/logs/change_history/routes.py, src/cluster_erp/modules/logs/error_log/routes.py
Authentication Bearer header or session cookie, resolved by get_current_user; see Authentication and headers src/cluster_erp/modules/auth/guards.py:85-167
Permission guard 8 of 9 routes declare require_permission; the other routes show their guard in the tables src/cluster_erp/modules/auth/guards.py:205-240
Error format JSON body {"error": {...}}; see Errors src/cluster_erp/server/error_handler.py:33-46

Endpoint summary

One row per sub-module folder. The router prefix is added to the base path.

Sub-module Routers Endpoints Router source
activity_log router (/activities) 2 src/cluster_erp/modules/logs/activity_log/routes.py:18
error_log router (/errors) 4 src/cluster_erp/modules/logs/error_log/routes.py:19
change_history router (/change-history) 3 src/cluster_erp/modules/logs/change_history/routes.py:19

Activity log endpoints

Activity log list and read.

Method Path Handler Permission Request Query Response Status Source
GET /api/v1/logs/activities/ list_activity_logs activity_log.read none search, actor_id, module, method, status_min, status_max, date_from, date_to, limit, offset ActivityLogListResponse 200 (default) src/cluster_erp/modules/logs/activity_log/routes.py:21
GET /api/v1/logs/activities/{log_id} get_activity_log activity_log.read none none ActivityLogRead 200 (default) src/cluster_erp/modules/logs/activity_log/routes.py:58

Error log endpoints

A client error report, the error log list, a read by trace id, and a read by id.

Method Path Handler Permission Request Query Response Status Source
POST /api/v1/logs/errors/client report_client_error authenticated user (get_current_user) ClientErrorReport none ErrorLogRead 201 src/cluster_erp/modules/logs/error_log/routes.py:22
GET /api/v1/logs/errors/ list_error_logs error_log.read none search, trace_id, error_code, http_status, actor_id, date_from, date_to, limit, offset ErrorLogListResponse 200 (default) src/cluster_erp/modules/logs/error_log/routes.py:47
GET /api/v1/logs/errors/by-trace/{trace_id} get_error_by_trace error_log.read none none ErrorLogRead 200 (default) src/cluster_erp/modules/logs/error_log/routes.py:82
GET /api/v1/logs/errors/{log_id} get_error_log error_log.read none none ErrorLogRead 200 (default) src/cluster_erp/modules/logs/error_log/routes.py:95

Change history endpoints

Change history list, the list of tables, and the history of one record.

Method Path Handler Permission Request Query Response Status Source
GET /api/v1/logs/change-history/ list_change_history change_history.read none search, entity_type, table_name, action, actor_id, date_from, date_to, limit, offset ChangeHistoryListResponse 200 (default) src/cluster_erp/modules/logs/change_history/routes.py:29
GET /api/v1/logs/change-history/tables list_change_history_tables change_history.read none none list[str] 200 (default) src/cluster_erp/modules/logs/change_history/routes.py:65
GET /api/v1/logs/change-history/{record_id} get_change_history change_history.read none none ChangeHistoryRead 200 (default) src/cluster_erp/modules/logs/change_history/routes.py:74

Error codes

The table lists the error codes that code under src/cluster_erp/modules/logs/ raises, found by a syntax-tree scan for AppError(...), the factories in src/cluster_erp/core/errors.py (not_found, conflict, protected, permission_denied, privilege_escalation, check_version), and HTTPException(...). A status of 400 is the AppError default (src/cluster_erp/core/errors.py:23). Guard errors (401, 403), the entitlement codes, and validation errors (422) apply to every route and are listed on Errors.

Code HTTP status Raised in First site
RESOURCE_NOT_FOUND 404 activity_log, change_history, error_log src/cluster_erp/modules/logs/activity_log/routes.py:67

Events emitted

The table lists the contract classes that code under src/cluster_erp/modules/logs/ passes directly to EventBus.emit, found by a syntax-tree scan. Events built in a variable first are not counted. The contracts are described in Contracts reference.

None found by the scan.


Verified against commit 92f8051 on 2026-11-13.

Verified against commit 92f8051 · 2026-11-13