Skip to main content

Audit log

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Append-only, org-scoped SOC2 audit-trail capability — one immutable write API + a forensic-replay query API, so products stop each owning a private admin-audit table and instead EMIT audit records to ONE shared, queryable compliance backend. Records are IMMUTABLE (no update/delete API — retention purge is bulk housekeeping past the legal window). I4: own Postgres store, never a product Mongo.

  • Group: Governance & platform
  • Contract: contracts/audit-log/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/audit/events

Endpoints

MethodPathSummary
POST/v1/audit/eventsRecord one immutable audit event
GET/v1/audit/eventsThe caller org's audit trail, newest-first, optionally filtered (SOC2 forensic replay)
GET/healthliveness
GET/metricsPrometheus

Schemas

Outcome

SOC2 outcome — the UNION of the platform set {success,failure,denied,partial} and the voice audit_logs status set {allowed,denied,error}. An unknown value is normalized to "success" on write (platform parity), never rejected.

AppendRequest

FieldTypeDescription
organization_idstringproduct-tier tenant (I6); anti-spoof-verified against the token
actionstringcanonical '<resource>.<verb>' event name, e.g. 'user.unlock'
resource_typestringthe affected resource class, e.g. 'user'
resource_idstringprimary id of the affected row (if any)
actor_idstringthe acting user id; omit/null for system/webhook actors
detailsobjectstructured context (stored raw JSONB)
outcomeobject
source_ipstringcaller IP for forensic replay
request_idstringcorrelation id across log streams
occurred_atstringevent time; defaults to server now() if omitted

AuditEvent

FieldTypeDescription
idstring
organization_idstring
actor_idstring
actionstring
resource_typestring
resource_idstring
detailsobject
outcomeobject
source_ipstring
request_idstring
occurred_atstring

QueryResult

FieldTypeDescription
eventsarray
countinteger

Error

FieldTypeDescription
errorstringstable machine code (e.g. validation_error, not_found, unauthorized)
reasonstringhuman-readable one-line explanation (no secrets/PII)
detailobject
request_idstring

Generated by scripts/gen-capability-docs.py from contracts/audit-log/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.