Export the audit log (streamed CSV or JSON)
GET /admin/audit/export
Streams the audit log over a date range as CSV or NDJSON
(newline-delimited JSON, format=json), with an
operator-picked column subset (ADR 0032 §Export). The response
is streamed from a keyset cursor, never buffered, so a
multi-million-row export runs in bounded memory.
Gated on system.audit.read. Actor IP is redacted for callers
without system.audit.pii.read, exactly as the /admin/audit
list view redacts it (#425) — the export must not leak what the
list withholds. Requesting the ip column without that
capability yields an empty ip field, not a 403, so the column
layout stays stable.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Output format. Defaults to csv.
Comma-separated column subset, in order. Defaults to all columns. Recognised: id, event_type, occurred_at, actor_user_ref, subject_user_ref, ip, user_agent, metadata, legal_hold. Unknown names are ignored.
ISO-8601 lower bound on occurred_at (inclusive).
ISO-8601 upper bound on occurred_at (inclusive).
Responses
Section titled “ Responses ”The streamed export.
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completed