GET /api/v1/audit-logs
Query audit log entries. Admin only. Logs are immutable — no DELETE, PUT, or PATCH operations are permitted.
Query Parameters
| Parameter | Type | Default | Description |
|---|
entityType | string | — | Filter by entity type (e.g., "connector", "offer", "decision_flow") |
page | integer | 1 | Page number |
limit | integer | 50 | Results per page (max 100) |
Response
{
"logs": [
{
"id": "log_001",
"action": "create",
"entityType": "offer",
"entityId": "offer_001",
"entityName": "Platinum Card",
"changes": { "status": "active" },
"userId": "user_001",
"userName": "John Doe",
"tenantId": "tenant_001",
"requestId": "req_abc123",
"integrityHash": "a1b2c3d4e5f6...",
"prevHash": "x9y8z7w6v5u4...",
"timestamp": "2026-03-16T14:30:00.000Z"
}
],
"total": 5420,
"page": 1,
"limit": 50
}
Audit logs are append-only. DELETE, PUT, and PATCH requests return 405 Method Not Allowed with a clear message that audit logs are immutable.
GET /api/v1/audit-logs/verify
Verify the integrity of the audit log chain using SHA-256 hash verification. Admin only.
Query Parameters
| Parameter | Type | Description |
|---|
limit | integer | Only verify the last N entries (quick check mode). Omit to verify entire chain |
Response
{
"intact": true,
"verified": 5420,
"total": 5420,
"scanned": 5420
}
Broken Chain Response
{
"intact": false,
"verified": 3210,
"total": 5420,
"scanned": 5420,
"brokenAtId": "log_3211",
"brokenReason": "hash_mismatch"
}
Broken Reasons
| Reason | Description |
|---|
hash_mismatch | Recomputed SHA-256 hash does not match the stored hash |
chain_link_mismatch | Entry’s prevHash does not match the previous entry’s integrityHash |
GET /api/v1/audit-export
Export audit logs for SOC 2 compliance. Supports JSON, CSV, and SOC 2 formatted output. Rate limited to 10 requests per 60 seconds. Admin only.
Query Parameters
| Parameter | Type | Default | Description |
|---|
format | string | "json" | Output format: "json", "csv", "soc2" |
startDate | string | — | ISO date string for range start |
endDate | string | — | ISO date string for range end |
entityType | string | — | Filter by entity type |
action | string | — | Filter by action ("create", "update", "delete") |
limit | integer | 10000 | Max records (max 10000) |
offset | integer | 0 | Pagination offset |
Example
curl "https://playground.kaireonai.com/api/v1/audit-export?format=csv&startDate=2026-03-01&endDate=2026-03-16" \
-H "X-Tenant-Id: my-tenant" \
-H "Authorization: Bearer sk_live_abc123" \
-o audit-export.csv
CSV exports are returned as downloadable files with Content-Disposition: attachment.
POST /api/v1/audit-export
Verify audit integrity chain via the export endpoint.
Request Body
| Field | Type | Required | Description |
|---|
action | string | Yes | Must be "verify_integrity" |
startDate | string | No | ISO start date for range verification |
endDate | string | No | ISO end date for range verification |
Roles
| Endpoint | Allowed Roles |
|---|
GET /audit-logs | admin |
GET /audit-logs/verify | admin |
GET /audit-export | admin |
POST /audit-export | admin |
See also: Compliance | Operations Dashboard