Data export
How audit logs and traces leave the gateway — JSON/CSV and webhooks via the API.
Data export
Three things customers ask for: a copy of their audit log, a copy of their raw traces, and a webhook stream to their own warehouse. All three are available through the gateway API, covered below.
Audit log
Every dashboard mutation writes a row to the org's audit table. The exporter route returns those rows in either JSON or CSV.
The endpoint is scoped to the calling org — there is no admin-level "export everything" path. CSV columns are stable: id, orgId, actor, action, target, metadata, occurredAt.
Traces
GET /v1/traces paginates by cursor, filters by class/type/time:
Response: { events: TraceEvent[], nextCursor: string | null }. Pass nextCursor back as ?cursor= to page.
Use GET /v1/metrics?since=... for pre-aggregated counts (per type, per outcome, per hour). The SDK already hourly-rolls up the trace stream so analytics queries don't pay the raw cost.
Webhooks
Schedule a delivery from your dashboard or via API:
The cron-driven dispatcher drains the pending queue every minute. Failed deliveries retry up to 3 times with backoff before being dead-lettered. Dead-lettered deliveries stay queryable via GET /v1/webhooks so you can inspect what didn't make it.
Available channels
| Channel | Notes |
|---|---|
POST /v1/audit/export (JSON / CSV) | Per-org audit rows; stable columns. |
GET /v1/traces (paginated) | Cursor-based, 200 max per page. |
POST /v1/webhooks/test + cron drain | 3 retries → dead-letter, queryable via GET /v1/webhooks. |