The system diagnostics endpoints giveDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CodexaCP/SERVICIOS-BACK/llms.txt
Use this file to discover all available pages before exploring further.
SUPER_ADMIN operators a real-time view into the running API process: server identity and uptime, in-memory request metrics, live process resource usage, and a feed of recent error events pulled from the PRO audit log. All four endpoints live under /api/v1/system, require a valid JWT issued to a SUPER_ADMIN account, and will return 500 with the message "Diagnostico deshabilitado." if Diagnostics:EnableDiagnostics is set to false in application configuration.
Authentication
All four endpoints require a Bearer token for a user with theSUPER_ADMIN role.
401 Unauthorized or 403 Forbidden before the diagnostics check runs.
Configuration
The diagnostics feature is controlled by theDiagnostics section of appsettings.json:
| Key | Type | Default | Description |
|---|---|---|---|
EnableDiagnostics | bool | true | Master switch. Set to false to disable all /api/v1/system endpoints. |
EnableDetailedErrors | bool | false | Whether to include stack traces in error responses. |
AuditRetentionDays | int | 90 | How many days of audit events to retain. |
MetricsWindowMinutes | int | 5 | Rolling window used by the metrics snapshot (see below). |
GET /api/v1/system/status — Server status
Returns the current server identity, the result of the readiness check (same logic as/health/ready), the environment name, the assembly version, and the total process uptime in seconds. The uptime counter starts from the moment the process first handled a request, not from OS boot time.
Authentication: SUPER_ADMINMethod:
GETPath:
/api/v1/system/status
Response — 200 OK
Result of the internal readiness check. Same possible values as
/health/ready: "OK", "Warning", or "Error".ASP.NET Core environment name as set by the
ASPNETCORE_ENVIRONMENT variable, e.g. "Production" or "Development".The assembly version of the running API binary, e.g.
"1.0.0". Falls back to "1.0.0" if the version attribute is absent.The server’s current UTC clock at response time.
Fractional seconds elapsed since the
SystemController static initializer ran (proxy for process start time).Example
GET /api/v1/system/metrics — Request metrics snapshot
Returns a snapshot of in-memory request counters and response-time statistics computed over the rollingMetricsWindowMinutes window (default 5 minutes). Counters are maintained by InMemorySystemMetricsService, which is updated by a middleware layer that wraps every request. The snapshot is computed lazily on demand and reflects only requests processed since the last application restart.
Authentication: SUPER_ADMINMethod:
GETPath:
/api/v1/system/metrics
Response — 200 OK
Cumulative count of all requests completed since the process started. Never resets without a restart.
Number of requests completed in the last 60 seconds at the moment of the snapshot.
Mean response time in milliseconds across all requests within the metrics window, rounded to 2 decimal places.
Percentage of requests within the window that returned HTTP status
>= 400, rounded to 2 decimal places. For example, 2.15 means 2.15 % of requests errored.Number of requests currently being processed (in-flight) at the moment of the snapshot.
Up to 5 most-called endpoints within the window, ordered by descending request count.
The request path as tracked by the middleware, e.g.
"/api/v1/service-requests".Number of times this endpoint was called within the window.
Start boundary of the rolling metrics window (
now − MetricsWindowMinutes).End boundary of the rolling metrics window (the moment the snapshot was taken).
Example
GET /api/v1/system/resources — Process resource usage
Returns a point-in-time snapshot of the current process’s memory consumption, CPU utilisation, thread count, and .NET GC collection counts. CPU percentage is computed by comparingProcess.TotalProcessorTime across two successive calls and normalising by wall-clock elapsed time and logical CPU count. Consecutive rapid calls may therefore report 0 CPU if the elapsed interval is too short.
Authentication: SUPER_ADMINMethod:
GETPath:
/api/v1/system/resources
Response — 200 OK
Estimated CPU utilisation as a percentage (0–100), rounded to 2 decimal places. Computed from
Process.TotalProcessorTime delta since the previous snapshot call.Process working set in megabytes (
Process.WorkingSet64 / 1024 / 1024), rounded to 2 decimal places.Number of OS threads currently owned by the process (
Process.Threads.Count).Total Gen-0 garbage collections since process start (
GC.CollectionCount(0)).Total Gen-1 garbage collections since process start.
Total Gen-2 (full) garbage collections since process start. A high or rapidly increasing value may indicate memory pressure.
Example
GET /api/v1/system/errors — Recent error events
Returns the most recent audit events whoseSeverity is "Error" or "Critical", drawn from the PRO dbo.AuditEvents table. If the AuditEvents table does not yet exist in the database, the endpoint returns an empty array rather than an error. Results are ordered by TimestampUtc DESC, then by Id DESC.
Authentication: SUPER_ADMINMethod:
GETPath:
/api/v1/system/errors
Query parameters
Maximum number of error records to return. Values less than or equal to
0 are treated as 50. The server-side cap is 200; any value above that is clamped to 200.Response — 200 OK
Unique identifier of the audit event.
When the event was recorded.
Functional module that generated the error (e.g.
"PAYMENTS", "AUTH").Specific action that failed (e.g.
"VALIDATE_PAYMENT").Always
"Error" or "Critical" for results returned by this endpoint.Outcome recorded at the time of the event (e.g.
"Failure").The entity type affected, if recorded (e.g.
"Payment").The entity’s primary key, if recorded.
The correlation ID of the originating HTTP request, useful for cross-referencing application logs.
Human-readable error summary as recorded in the audit event.