Skip to main content
The Audit Export API provides SOC 2 compliant audit log exports in multiple formats and integrity verification of the audit chain. Rate limited to 10 requests/min. Admin only.

GET /api/v1/audit-export

Export audit logs with filtering and pagination.

Query Parameters

ParameterTypeRequiredDescription
formatstringNoExport format: json, csv, or soc2 (default: json)
startDatestringNoISO 8601 start date filter
endDatestringNoISO 8601 end date filter
entityTypestringNoFilter by entity type (e.g., offer, channel, user)
actionstringNoFilter by action: create, update, delete
limitnumberNoMax records (default: 10000, max: 10000)
offsetnumberNoPagination offset

Example

curl "https://playground.kaireonai.com/api/v1/audit-export?format=csv&startDate=2026-03-01&endDate=2026-03-18" \
  -H "X-Tenant-Id: my-tenant" \
  -H "X-User-Role: admin" \
  -o audit-export.csv

Response — JSON Format

{
  "data": [
    {
      "id": "clx...",
      "action": "create",
      "entityType": "offer",
      "entityId": "clx...",
      "entityName": "Premium Card",
      "userId": "admin@example.com",
      "timestamp": "2026-03-18T10:00:00.000Z",
      "changes": { ... }
    }
  ],
  "total": 1500,
  "exportedAt": "2026-03-18T12:00:00.000Z"
}

Response — CSV Format

Returns a CSV file download with Content-Disposition: attachment.

POST /api/v1/audit-export

Verify the integrity of the audit log chain. Ensures no records have been tampered with or deleted. Admin only.

Request Body

FieldTypeRequiredDescription
actionstringYesMust be verify_integrity
startDatestringNoISO 8601 start date
endDatestringNoISO 8601 end date

Example

curl -X POST https://playground.kaireonai.com/api/v1/audit-export \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -d '{ "action": "verify_integrity" }'

Response

{
  "verified": true,
  "recordsChecked": 15000,
  "chainIntact": true,
  "startDate": "2026-01-01T00:00:00.000Z",
  "endDate": "2026-03-18T12:00:00.000Z"
}