Skip to main content
POST
Export, and optionally purge, audit records

Authorizations

X-Qanapi-Authorization
string
header
required

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

application/json

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.

from
string<date-time>
to
string<date-time>
action
string

An exact action, or a kms.* style prefix.

configuration_id
string<uuid>
principal_id
string
principal_type
enum<string>
Available options:
user,
api_key,
anonymous,
system
status
enum<string>
Available options:
success,
denied,
error
request_id
string
instance_id
string
format
enum<string>
default:jsonl

jsonl streams one JSON record per line; csv flattens them into a header row and one row per record.

Available options:
jsonl,
csv
gzip
boolean
default:false

Compress the stream. Signalled by Content-Encoding, not by a different content type.

purge
boolean
default:false

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.