Export shell audit events as CSV or JSON
GET
/api/audit/export
const url = 'https://example.com/api/audit/export?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&format=csv';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/audit/export?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&format=csv' \ --header 'Authorization: Bearer <token>'Stream a full CSV or JSON export of audit events for the organisation.
The export is capped at EXPORT_ROW_CAP rows (default 100 000). Requests
that would exceed the cap receive a 413 response. Exporting is itself an
auditable event (audit.exported) with the filter params and row count in
the payload.
Role required: audit.view.
CSV columns: id, created_at, event_type, actor_id, target_user_id, payload_json, reason, prev_hash, event_hash.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “ Query Parameters ” organization_id
required
Organization Id
string format: uuid
format
Format
Export format: ‘csv’ (default) or ‘json’.
string
Export format: ‘csv’ (default) or ‘json’.
Responses
Section titled “ Responses ”Successful Response
Media type application/json
Example generated
exampleValidation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}