Skip to main content

Get Exception Audits

Retrieve audit events related to exceptions and errors.
GET /api/v1/audits/exceptions?severity=Error&fromUtc=2026-03-01T00:00:00Z

Query Parameters

area
enum
Filter by subsystem where exception occurred:
  • Api - REST API endpoints
  • Worker - Background workers and jobs
  • Ui - User interface
  • Infra - Infrastructure and framework code
  • Unknown - Cannot determine source
severity
enum
Filter by exception severity:
  • Warning - Handled exceptions, non-critical
  • Error - Errors that were caught and handled
  • Critical - Severe errors requiring immediate attention
exceptionType
string
Filter by exception type name (e.g., “NullReferenceException”, “ValidationException”)
routeOrLocation
string
Filter by route (for API) or code location where exception occurred
fromUtc
datetime
Start date/time for audit events (UTC)
toUtc
datetime
End date/time for audit events (UTC)

Authorization

Requires Permissions.Auditing.View permission.

Response

Returns an array of exception audit summary objects.
id
uuid
Unique audit event identifier
occurredAtUtc
datetime
When the exception occurred
eventType
enum
Always Exception for this endpoint
severity
enum
Exception severity: Warning, Error, or Critical
tenantId
string
Associated tenant identifier
userId
string
User who triggered the exception (if applicable)
userName
string
Display name of the user
traceId
string
Distributed tracing identifier
correlationId
string
Correlation identifier for related events
requestId
string
HTTP request identifier (for API exceptions)
source
string
Module or component where exception occurred
tags
flags
Bitwise flags for additional metadata
[
  {
    "id": "770fa622-g4bd-63f6-c938-668877662222",
    "occurredAtUtc": "2026-03-06T14:28:33.789Z",
    "eventType": "Exception",
    "severity": "Error",
    "tenantId": "acme-corp",
    "userId": "user-123",
    "userName": "[email protected]",
    "traceId": "6dh14h5799d56ec8c5eg141f2g2g6958",
    "correlationId": "ghi789",
    "requestId": "0HN1234567892",
    "source": "FSH.Modules.Catalog",
    "tags": 0
  },
  {
    "id": "880gb733-h5ce-74g7-d049-779988773333",
    "occurredAtUtc": "2026-03-06T14:15:20.123Z",
    "eventType": "Exception",
    "severity": "Critical",
    "tenantId": "acme-corp",
    "userId": null,
    "userName": null,
    "traceId": "7ei25i6800e67fd9d6fh252g3h3h7069",
    "correlationId": "jkl012",
    "requestId": null,
    "source": "FSH.BuildingBlocks.Persistence",
    "tags": 8
  }
]

Exception Areas

Exceptions in REST API endpoints:
  • HTTP request processing errors
  • Validation failures
  • Controller/endpoint exceptions
  • Middleware errors
Common Types: ValidationException, BadHttpRequestException, NotFoundException
Exceptions in background processing:
  • Scheduled job failures
  • Message queue processing errors
  • Background task exceptions
Common Types: JobExecutionException, TimeoutException, TaskCanceledException
Client-side exceptions (if reported):
  • JavaScript errors
  • Rendering failures
  • Client validation issues
Common Types: TypeError, ReferenceError, NetworkError
Infrastructure and framework exceptions:
  • Database connection errors
  • Cache failures
  • Configuration issues
  • Third-party service errors
Common Types: DbException, TimeoutException, HttpRequestException
Exceptions from unclassified sources

Common Use Cases

Monitor Critical Errors

Track severe errors requiring immediate attention:
GET /api/v1/audits/exceptions?severity=Critical&fromUtc=2026-03-06T00:00:00Z
Set up alerts for critical exceptions to ensure rapid response.

Debug API Errors

Find exceptions in API endpoints:
GET /api/v1/audits/exceptions?area=Api&routeOrLocation=/api/v1/products
Use this to identify problematic endpoints and fix recurring issues.

Track Exception Types

Identify the most common exception types:
GET /api/v1/audits/exceptions?exceptionType=NullReferenceException
Helps prioritize bug fixes based on frequency.

Infrastructure Health

Monitor infrastructure-related exceptions:
GET /api/v1/audits/exceptions?area=Infra&severity=Error
Detect database issues, cache failures, or third-party service problems.

Worker Failures

Track background job failures:
GET /api/v1/audits/exceptions?area=Worker&fromUtc=2026-03-01T00:00:00Z
Ensure scheduled tasks and async jobs complete successfully.

Exception Severity Classification

Exceptions are automatically classified by severity:

Warning

Handled exceptions that don’t disrupt operations:
  • Validation failures
  • Expected business rule violations
  • Retryable errors that succeeded on retry
GET /api/v1/audits/exceptions?severity=Warning

Error

Errors that were caught and handled but indicate problems:
  • Database query failures
  • External service timeouts
  • Unexpected null values
  • File I/O errors
GET /api/v1/audits/exceptions?severity=Error

Critical

Severe errors requiring immediate attention:
  • Database connection failures
  • Unhandled exceptions
  • Data corruption
  • Security violations
  • System crashes
GET /api/v1/audits/exceptions?severity=Critical

Getting Exception Details

The summary endpoint returns only basic information. To get full exception details including stack traces, use the detail endpoint:
GET /api/v1/audits/{id}
See Get Audit By ID for more information.

Best Practices

Set Up Alerts

Configure alerts for critical exceptions to ensure rapid response to severe errors.

Review Regularly

Schedule regular reviews of error and warning level exceptions to identify patterns.

Track Trends

Monitor exception frequency over time to measure system stability improvements.

Correlate Events

Use correlationId to find related events and understand the full context of errors.
Critical exceptions may indicate security issues, data loss, or service outages. Investigate immediately.
Exception audits include masked stack traces and error messages. Sensitive data like connection strings and API keys are automatically redacted.

Build docs developers (and LLMs) love