Skip to main content

Create Audit Event

Create a custom audit event.
cURL

Request Body

enum
required
Entity type: transaction, wallet, agent, policy, escrow, system
string
required
Entity identifier (UUID or string)
string
required
Event type identifier (e.g., transaction.created, agent.started)
string
Optional transaction UUID for correlation
string
Optional wallet UUID for correlation
string
Optional agent UUID for correlation
string
Optional protocol name for correlation
string
Optional escrow ID for correlation
object
required
Event-specific data (flexible schema)

Response

string
required
Audit event UUID
string
required
Entity type
string
required
Entity ID
string
required
Event type
string
required
ISO 8601 timestamp (server-assigned)
object
required
Event payload
Most audit events are created automatically by the system. This endpoint is for custom application events.

Query Audit Events

Query audit events with filters.
cURL

Query Parameters

string
Filter by transaction UUID
string
Filter by wallet UUID
string
Filter by agent UUID
string
Filter by protocol name
string
Filter by escrow ID
enum
Filter by entity type: transaction, wallet, agent, policy, escrow, system
string
Filter by event type (e.g., transaction.created)
number
default:"50"
Maximum events to return (max: 100)
number
default:"0"
Number of events to skip
string
Filter events after timestamp (ISO 8601)
string
Filter events before timestamp (ISO 8601)

Response


Common Event Types


Increment Metric

Increment a named metric counter.
cURL

Request Body

string
required
Metric name (dot-notation recommended)
number
default:1
Value to increment (default: 1)

Response


Get Metrics

Retrieve all metric counters.
cURL

Response


Observability Patterns

Transaction Tracing

Trace a complete transaction lifecycle:
Expected event sequence:

Agent Activity Monitoring

Monitor agent behavior:
Key metrics:
  • Execution frequency
  • Success/failure ratio
  • Policy violations
  • Budget usage

Policy Effectiveness

Analyze policy decisions:
Analyze:
  • Allow/deny ratios
  • Most common denial reasons
  • Approval queue depth
  • Policy version effectiveness

Error Analysis

Identify failure patterns:
Group by:
  • Error code
  • Failed stage
  • Protocol
  • Wallet/agent

Metric Categories

Transaction Metrics

Policy Metrics

Agent Metrics

Error Metrics


Best Practices

Use structured event types with dot notation (e.g., transaction.created)
Include correlation IDs (txId, walletId, agentId) in all events
Query with time bounds for large event volumes
Monitor metric trends over time, not just absolute values
Set up alerts on critical metrics (error rates, budget exceeded)
Use audit events for compliance and post-incident analysis

Example: Performance Dashboard


Retention and Storage

Audit events are stored in SQLite by default:
For production deployments with high event volume, consider migrating to PostgreSQL or a dedicated logging service.
Regularly export audit events for long-term archival and compliance requirements.