Export filtered audit events as CSV
Same filters as /audit-events; capped at 5,000 rows and recorded in the tenant audit chain as audit.exported.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
action |
query | string | No | action prefix |
actor |
query | string | No | — |
resource_type |
query | string | No | — |
q |
query | string | No | — |
from |
query | string (date-time) | No | — |
to |
query | string (date-time) | No | — |
limit |
query | integer | No | default 5000 · max 5000 |
Request
This endpoint has no request body.
curl "$MONICHEK_API/audit-events.csv?limit=5000" \
-H "Authorization: Bearer $MONICHEK_API_KEY"const res = await fetch(`${MONICHEK_API}/audit-events.csv?limit=5000`, {
method: "GET",
headers: {
Authorization: `Bearer ${MONICHEK_API_KEY}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
f"{os.environ['MONICHEK_API']}/audit-events.csv?limit=5000",
headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
)
print(res.json())$ch = curl_init(getenv('MONICHEK_API') . '/audit-events.csv?limit=5000');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MONICHEK_API_KEY'),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
200 OK
CSV attachment
text/csv
Binary or streamed response (text/csv). Send the request with Accept: text/csv and write the body to a file.
Error responses
| Status | Meaning | Body |
|---|---|---|
| 401 | Unauthorized | RFC 9457 problem |
Errors use the RFC 9457 problem format with a stable code.