Export, and optionally purge, audit records
Requires audit:export, and audit:purge as well when purging.
Streams matching records as JSON Lines or CSV, oldest first, optionally
gzipped. One export covers at most 100,000 records; narrow the filters
and repeat if you have more. The filters are the ones the query endpoint
accepts, sent in the body; page and per_page are accepted and
ignored.
With purge set, the exported records are deleted in the same
transaction that read them, so nothing can be purged that was not
successfully exported. A purge is itself recorded, with the window it
covered, so a later chain verification can tell an authorised purge
apart from tampering.
The body is optional; send none to export everything in the default format.
Authorizations
A machine credential, qk_ followed by its secret. Only a hash of the
secret is stored, so a key is displayed exactly once, when it is created
or rotated. A key reaches only the configurations it is linked to.
It may also be sent as Authorization: Bearer qk_..., which is
recognised by the prefix.
Body
Accepts every filter the query endpoint accepts, plus the three fields
at the end. page and per_page are accepted and ignored: an export
covers the whole matching range up to its ceiling.
An exact action, or a kms.* style prefix.
user, api_key, anonymous, system success, denied, error jsonl streams one JSON record per line; csv flattens them into a
header row and one row per record.
jsonl, csv Compress the stream. Signalled by Content-Encoding, not by a
different content type.
Delete the exported records in the same transaction that read them,
so nothing is purged that was not successfully exported. Requires
audit:purge, and is itself recorded with the window it covered.
Response
The export stream. Content-Type follows format, and a gzipped
export is the same content type under Content-Encoding: gzip
rather than a type of its own.
The response is of type string.