Skip to main content

GET /api/v1/audit-logs

Query audit log entries. Admin only. Logs are immutable — no DELETE, PUT, or PATCH operations are permitted.

Query Parameters

ParameterTypeDefaultDescription
entityTypestringFilter by entity type (e.g., "connector", "offer", "decision_flow")
pageinteger1Page number
limitinteger50Results 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

ParameterTypeDescription
limitintegerOnly 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

ReasonDescription
hash_mismatchRecomputed SHA-256 hash does not match the stored hash
chain_link_mismatchEntry’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

ParameterTypeDefaultDescription
formatstring"json"Output format: "json", "csv", "soc2"
startDatestringISO date string for range start
endDatestringISO date string for range end
entityTypestringFilter by entity type
actionstringFilter by action ("create", "update", "delete")
limitinteger10000Max records (max 10000)
offsetinteger0Pagination 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

FieldTypeRequiredDescription
actionstringYesMust be "verify_integrity"
startDatestringNoISO start date for range verification
endDatestringNoISO end date for range verification

Roles

EndpointAllowed Roles
GET /audit-logsadmin
GET /audit-logs/verifyadmin
GET /audit-exportadmin
POST /audit-exportadmin
See also: Compliance | Operations Dashboard