Skip to main content

Audit client

Writing audit events requires a write-scoped f0_live_* API key. Read-scoped keys can query, verify and export records.

Config Options

The Config struct supports the following options:

Write methods

Log(ctx context.Context, event AuditEventInput) error

Validates and writes a single audit event immediately.

LogBatch(ctx context.Context, events []AuditEventInput) (map[string]any, error)

Sends up to 1000 events in a single batch request.

Read methods

GetEvent(ctx context.Context, id string) (map[string]any, error)

GET /v1/events/{id} Retrieves a single audit event by its ID.

ListEvents(ctx context.Context, query string) (map[string]any, error)

GET /v1/events Filters and lists events. The query string can contain filters like ?actor_id=user_123&action=document.delete.

GetReceipt(ctx context.Context, id string) (map[string]any, error)

GET /v1/receipts/{id} Compatibility method for asynchronous deployments. The supported core ingests synchronously and does not expose receipt polling.

Verify methods

Verify(ctx context.Context, query string) (map[string]any, error)

GET /v1/verify Walks the hash chain and verifies integrity. Query parameters include ?from=&to=.