Exportar eventos de auditoria
RegistosGET /audit/export
Time-bounded audit export in CSV or JSONL with a SHA-256 digest header
Streams every audit event of the tenant between from and to, oldest first, as a file download (Content-Disposition attachment). Response headers carry the SHA-256 of the exact bytes returned, a signature over that digest, the event count and the hash of the last event in the chain, so a recipient can check the file with sha256sum and confirm the signature through the export verify endpoint. The range must not exceed 366 days and may hold at most 200,000 events; otherwise the call answers 400 and you should narrow it. Requires audit:read.
Parâmetros
fromRequired start of the export window as an RFC 3339 timestamp (for example
2026-01-01T00:00:00Z); it must be before to.toRequired end of the export window as an RFC 3339 timestamp; the window may span at most 366 days.
formatOutput format: jsonl (one JSON event per line, the default) or csv (header row plus one row per event, with details as a JSON string and the prev_hash and hash columns).
um de
csv,jsonl
Devolve
curl -X GET "$BUSINESS_API/audit/export" \
-H "Authorization: Bearer sk_test_..."
# Sem comando CLI equivalente; use cURL ou HTTP directo.
const res = await fetch("$BUSINESS_API/audit/export", {
method: "GET",
headers: {
Authorization: "Bearer sk_test_..."
}
});
const data = await res.json();
import requests
res = requests.get(
"$BUSINESS_API/audit/export",
headers={
"Authorization": "Bearer sk_test_..."
}
)
data = res.json()
req, _ := http.NewRequest("GET", "$BUSINESS_API/audit/export", nil)
req.Header.Set("Authorization", "Bearer sk_test_...")
resp, err := http.DefaultClient.Do(req)
Exported events