Docs
Live demo
POST/api/v2/audit/reports
audit:readAPI token

Enqueue asynchronous audit report generation. options.preset picks a known preset (GET /audit/reports/presets). Options.sections and the target filters customise it. options.format picks the file: pdf (default), csv (a ZIP archive with one CSV file per table) or json (one file with the principal.audit_report schema). Every format holds the same data. An unknown preset, section, target kind or format is refused with 400. Sections that show the current targets and access (the requires list of each section in GET /audit/reports/presets) also need targets:read and identities:read. Without them the request is refused with 403 before anything is queued, and details.sections names the refused sections and details.missing_permissions the missing permissions.

Starts a PDF, CSV or JSON report (202). Download when ready via GET /audit/reports/{id}/download.

Request body application/json · CreateAuditReportRequest

Required2 of 2 fields
17 fields
fromstring

Start of the period (RFC 3339). Without it the report covers the default period of the preset (default_period_days) back from to. A period longer than 1098 days is refused with 400.

tostring

End of the period (RFC 3339). Without it, or when it is in the future, the report ends now.

event_idarray of string
categoryarray of string
typearray of string
actionarray of string
outcomearray of string
severityarray of string
actor_kindarray of string
actor_labelarray of string
actor_querystring
resource_kindarray of string
resource_querystring
owner_domainarray of string
qstring
target_idarray of string · uuid

Limit the report to these targets. Targets of other organizations are ignored.

max items 200
target_kindarray of string

Limit the report to targets of these kinds.

postgresmysqlclickhousemongodbkubernetessshapplication
20 fields
report_versionstring

Accepted and ignored.

v2
deprecated
presetstring

A preset id from GET /audit/reports/presets: executive, access_review, privileged_access, leavers, change_management, security_events, drift, access_activity, iso27001, soc2 or pci_dss. Another value is refused with 400. Default: executive.

formatstring

The report file: pdf, csv (a ZIP archive with one CSV file per table) or json (one file with the principal.audit_report schema). Another value is refused with 400 and a sentence that names the formats. Default: pdf.

titlestring

The report title on the cover. The preset title when empty.

max length 120
sectionsarray of string

Section ids from GET /audit/reports/presets in any order. The report keeps the catalog order. The preset sections when empty. An unknown id is refused with 400.

timeline_modestring

Accepted and ignored.

exceptionsfull
deprecated
main_timeline_limitinteger

The most rows in the refused and failed actions and the activity by area tables. Default: 150.

min 1 · max 500
include_full_timeline_appendixboolean

false leaves the full timeline section out of the report. true adds it to the preset sections when sections is empty. Use sections instead.

deprecated
appendix_timeline_limitinteger

The most events in the full timeline section. 0 leaves the section out. Sent without sections, a value above 0 adds the section to the preset sections. Default: 1000.

min 0 · max 5000
top_events_modestring

Accepted and ignored.

aggregatedraw
deprecated
risk_sensitivitystring

How strictly the report rates risk. Default: balanced.

strictbalancedlenient
show_internal_identifiersboolean

Show internal ids next to names. Default: false.

include_timelineboolean

false leaves the refused, failed and sensitive actions section out of the report. Use sections instead.

deprecated
include_targetsboolean

false leaves the targets section out of the report. Use sections instead.

deprecated
include_top_eventsboolean

false leaves the most frequent events section out of the report. true adds it to the preset sections when sections is empty. Use sections instead.

deprecated
include_filters_appendixboolean

false leaves the methodology section out of the report. Use sections instead.

deprecated
include_raw_idsboolean

Takes precedence over show_internal_identifiers, as before. Use show_internal_identifiers instead.

deprecated
mask_sensitiveboolean

Shorten every IP address and network in the report to its /16 (IPv4) or /48 (IPv6) network and replace the host in URLs and in user@host:port endpoints with hidden. Default: true.

event_limitinteger

The older name of appendix_timeline_limit. Takes precedence over it, as before. Values below 0 count as 0 and values above 5000 as 5000.

deprecated
top_events_limitinteger

The most rows in the most frequent events table. Sent without sections, it adds that section to the preset sections. Default: 25.

min 1 · max 100

Responses

202

Accepted

CreateAuditReportResponse · 5 fields
terminalbooleanrequired

Whether this operation has finished.

outcomestring (entity.OperationOutcome)required

Final operation result, or null while the operation is active.

successfailurecancelledpartial
can be null
substatestring (entity.OperationSubstate)required

Qualifies the status and outcome of an operation where they alone would hide what the operator must know. Null when none applies.

rollback_in_progressrolled_backneeds_repairoutcome_unknowninterruptedrequires_approvalholds_lockawaiting_confirmationexpiredtimed_outrescheduled
can be null
job_idstringrequired
statusstring (entity.OperationLifecycle)required

Where a background operation is in the shared lifecycle (decision S1). outcome says how a finished operation ended and substate qualifies the state.

queuedrunningfinished

Common errors: 400 401 403 409 413 429 500 503 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close