Skip to content

API reference — Compliance reporting

The compliance reporting API provides aggregated statistics on DLP policy bundle detections. Admins can retrieve per-bundle event counts by severity and action, an all-bundles overview, and a combined exportable report — suitable for compliance officer dashboards and quarterly reviews.

All endpoints are admin-only. Authentication: Authorization: Bearer arb_live_<admin-key>.

Base path: /api/admin/compliance


Returned by GET /bundles/{bundle_id}/stats.

FieldTypeDescription
bundle_idUUIDCompliance bundle identifier
bundle_namestringBundle display name
total_eventsintegerTotal detection events in the period
by_severityobjectEvent counts grouped by severity label
by_actionobjectEvent counts grouped by policy action (block, redact, allow, require_approval)
daily_trendobject[]Per-day event counts for the period

Returned by GET /summary.

FieldTypeDescription
daysintegerReporting period in days
total_eventsintegerTotal events across all bundles
coverage_percentfloatPercentage of requests that triggered at least one compliance rule
top_triggersobject[]Top 10 triggering rules by event count
bundlesobject[]Per-bundle summary (name, event count, action breakdown)

Returned by GET /report — combines summary with full per-bundle stats.

FieldTypeDescription
generated_atdatetimeISO 8601 timestamp of report generation
period_daysintegerReporting period in days
summaryobjectSame as compliance summary response
bundle_detailsobject[]Full per-bundle stats for all active bundles

GET /api/admin/compliance/bundles/{bundle_id}/stats

Returns event counts, severity breakdown, action breakdown, and daily trend for a specific compliance bundle.

Path parameters:

ParameterDescription
bundle_idUUID of the compliance bundle

Query parameters:

ParameterTypeDefaultDescription
daysinteger30Look-back period in days (1–365)

Request:

Terminal window
GET /api/admin/compliance/bundles/3fa85f64-5717-4562-b3fc-2c963f66afa6/stats?days=30
Authorization: Bearer arb_live_your-admin-key

Response (200):

{
"bundle_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bundle_name": "HIPAA PHI Protection",
"total_events": 4820,
"by_severity": {
"critical": 82,
"high": 640,
"medium": 2100,
"low": 1998
},
"by_action": {
"block": 722,
"redact": 2640,
"allow": 1340,
"require_approval": 118
},
"daily_trend": [
{ "date": "2026-03-11", "event_count": 184 },
{ "date": "2026-03-12", "event_count": 142 }
]
}

Error (400 Bad Request):

{ "detail": "Invalid bundle_id format" }

Error (404 Not Found):

{ "detail": "Compliance bundle not found" }

GET /api/admin/compliance/summary

Returns a top-level compliance overview across all active bundles — total events, coverage percentage, and per-bundle summary.

Query parameters:

ParameterTypeDefaultDescription
daysinteger30Look-back period in days (1–365)

Request:

Terminal window
GET /api/admin/compliance/summary?days=30
Authorization: Bearer arb_live_your-admin-key

Response (200):

{
"days": 30,
"total_events": 18240,
"coverage_percent": 8.4,
"top_triggers": [
{ "rule_name": "Credit card number", "bundle": "PCI DSS", "event_count": 3820 },
{ "rule_name": "SSN pattern", "bundle": "HIPAA PHI Protection", "event_count": 2110 },
{ "rule_name": "AWS key", "bundle": "Credential Exposure", "event_count": 1840 }
],
"bundles": [
{
"bundle_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bundle_name": "HIPAA PHI Protection",
"total_events": 4820,
"by_action": {
"block": 722,
"redact": 2640,
"allow": 1340,
"require_approval": 118
}
},
{
"bundle_id": "7c8d9e0f-1234-5678-abcd-ef0123456789",
"bundle_name": "PCI DSS",
"total_events": 6200,
"by_action": {
"block": 980,
"redact": 4100,
"allow": 1120,
"require_approval": 0
}
}
]
}

coverage_percent is the percentage of all requests in the period that triggered at least one compliance rule detection event. A value of 8.4% means 8.4% of requests contained content matched by a compliance bundle rule.


GET /api/admin/compliance/report

Combines the compliance summary with full per-bundle statistics into a single payload suitable for export or storage.

Query parameters:

ParameterTypeDefaultDescription
daysinteger30Look-back period in days (1–365)

Request:

Terminal window
GET /api/admin/compliance/report?days=90
Authorization: Bearer arb_live_your-admin-key

Response (200):

{
"generated_at": "2026-03-12T14:00:00Z",
"period_days": 90,
"summary": {
"days": 90,
"total_events": 54200,
"coverage_percent": 9.1,
"top_triggers": [ ... ],
"bundles": [ ... ]
},
"bundle_details": [
{
"bundle_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bundle_name": "HIPAA PHI Protection",
"total_events": 14460,
"by_severity": { ... },
"by_action": { ... },
"daily_trend": [ ... ]
}
]
}

Terminal window
# Generate a 90-day report and save to file
curl -s \
"https://api.arbitex.ai/api/admin/compliance/report?days=90" \
-H "Authorization: Bearer arb_live_your-admin-key" \
| jq '.' > compliance-report-q1-2026.json
Terminal window
# Get 7-day stats for a specific bundle
curl -s \
"https://api.arbitex.ai/api/admin/compliance/bundles/{bundle_id}/stats?days=7" \
-H "Authorization: Bearer arb_live_your-admin-key" \
| jq '.by_severity.critical'
import httpx
resp = httpx.get(
"https://api.arbitex.ai/api/admin/compliance/summary",
headers={"Authorization": "Bearer arb_live_your-admin-key"},
params={"days": 7},
)
summary = resp.json()
print(f"Total events: {summary['total_events']}")
print(f"Coverage: {summary['coverage_percent']}%")
for bundle in summary["bundles"]:
print(f" {bundle['bundle_name']}: {bundle['total_events']} events")