Audit Log API
Read-only immutable audit trail with filtering, export, and per-resource history.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /spaces/{slug}/audit-log | List audit entries |
| GET | /spaces/{slug}/audit-log/export | Export (JSON/CSV) |
| GET | /spaces/{slug}/audit-log/{resource_type}/{resource_id} | Resource history |
List Audit Entries
GET /spaces/{slug}/audit-log
Query Parameters
| Parameter | Type | Description |
|---|---|---|
action | string | Filter by action type |
resource_type | string | Filter by resource type |
user_id | UUID | Filter by acting user |
start_date | datetime | Start of date range |
end_date | datetime | End of date range |
Response
[
{
"id": "...",
"user": { "id": "...", "email": "alice@example.com", "full_name": "Alice" },
"action": "create",
"resource_type": "product",
"resource_id": "...",
"resource_name": "Customer Events",
"details": {},
"ip_address": "192.168.1.1",
"created_at": "2026-01-15T10:30:00Z"
}
]
Export Audit Log
GET /spaces/{slug}/audit-log/export?fmt=csv
Export up to 10,000 rows as JSON array or CSV file. Supports the same query parameters as the list endpoint.
Resource History
GET /spaces/{slug}/audit-log/{resource_type}/{resource_id}
Returns the audit history for a single resource (e.g., a specific product or quality check).