Audit

Base URL: $BUSINESS_API

Export audit events

Logs

GET /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.

Parameters

fromstring (date-time) · query · required

Required start of the export window as an RFC 3339 timestamp (for example 2026-01-01T00:00:00Z); it must be before to.

tostring (date-time) · query · required

Required end of the export window as an RFC 3339 timestamp; the window may span at most 366 days.

formatstring · query · optional

Output 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).

one of csv, jsonl

Returns

200 Exported events

Errors 400 · 401

curl -X GET "$BUSINESS_API/audit/export" \
  -H "Authorization: Bearer sk_test_..."
Response 200

Exported events

Verify audit export

Logs

POST /audit/export/verify

Check that an audit export's signature was issued by this installation

Confirms that a digest and signature taken from the headers of an audit export (GET $BUSINESS_API/audit/export) were issued by this server for the caller's tenant, so a recipient can trust a file whose SHA-256 they computed themselves. Send sha256 as the bare hexadecimal digest (without the "sha256=" prefix the X-Audit-Digest header carries) and signature as returned, with or without its "sha256=" prefix. The answer is 200 with valid true or false; a mismatch is not an error. Both fields are required (400). Requires audit:read.

Body application/json

sha256string · required

Hexadecimal SHA-256 of the exported file, without a prefix.

signaturestring · required

Signature from the export response headers; a leading "sha256=" is accepted.

Returns

200 Verification result

Show attributes
validboolean · required

True when this server issued the signature for this digest and the caller's tenant.

Errors 400 · 401 · 403

Permissions audit:read · Roles: admin, analyst, owner

curl -X POST "$BUSINESS_API/audit/export/verify" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "signature": "sha256=4b8e1c0f2a9d6e7b3c5a1f0e9d8c7b6a5f4e3d2c1b0a99887766554433221100"
}'
Response 200
{
  "valid": true
}