Audit Logs
Query the audit trail for compliance and debugging. Every significant action in Expunct is logged as an audit event.
Audit Event Object
| Field | Type | Description |
|---|---|---|
id | string | Unique event identifier |
event_type | string | Type of event |
resource_type | string | Resource affected (e.g. job, policy, connector) |
resource_id | string | ID of the affected resource |
actor | string | API key or user that triggered the event |
metadata | object | Additional context (varies by event type) |
tenant_id | string | Tenant the event belongs to |
created_at | string | ISO 8601 timestamp |
Event Types
| Event | Description |
|---|---|
job.created | A redaction job was created |
job.completed | A redaction job completed successfully |
job.failed | A redaction job failed |
policy.created | A policy was created |
policy.updated | A policy was updated |
connector.created | A connector was created |
connector.sync_triggered | A connector sync was manually triggered |
api_key.created | An API key was created |
api_key.revoked | An API key was revoked |
GET /audit
List audit events.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tenant_id | string | No | Filter by tenant |
event_type | string | No | Filter by event type |
resource_type | string | No | Filter by resource type (job, policy, connector, api_key) |
from_date | string | No | Start date (ISO 8601) |
to_date | string | No | End date (ISO 8601) |
limit | number | No | Max results (default: 50, max: 100) |
offset | number | No | Pagination offset (default: 0) |
Example
curl "https://api.pii-redactor.dev/api/v1/audit?event_type=job.completed&from_date=2026-02-12T00:00:00Z&limit=10" \
-H "X-API-Key: pk_live_abc123"[
{
"id": "evt_m1n2o3p4",
"event_type": "job.completed",
"resource_type": "job",
"resource_id": "job_8f3a1b2c4d5e",
"actor": "pk_live_abc...123",
"metadata": {
"input_uri": "s3://my-bucket/report.pdf",
"entity_count": 14,
"duration_ms": 12340
},
"tenant_id": "tenant_xyz",
"created_at": "2026-02-13T10:00:12Z"
},
{
"id": "evt_q5r6s7t8",
"event_type": "job.completed",
"resource_type": "job",
"resource_id": "job_c4d5e6f7",
"actor": "pk_live_abc...123",
"metadata": {
"input_uri": "s3://my-bucket/notes.txt",
"entity_count": 3,
"duration_ms": 890
},
"tenant_id": "tenant_xyz",
"created_at": "2026-02-12T14:30:05Z"
}
]Filtering by Date Range
To retrieve all events for a specific day:
curl "https://api.pii-redactor.dev/api/v1/audit?from_date=2026-02-13T00:00:00Z&to_date=2026-02-14T00:00:00Z" \
-H "X-API-Key: pk_live_abc123"Filtering by Resource
To see all events related to a specific resource type:
curl "https://api.pii-redactor.dev/api/v1/audit?resource_type=policy&limit=20" \
-H "X-API-Key: pk_live_abc123"