Skip to Content
API ReferenceAudit Logs

Audit Logs

Query the audit trail for compliance and debugging. Every significant action in Expunct is logged as an audit event.

Audit Event Object

FieldTypeDescription
idstringUnique event identifier
event_typestringType of event
resource_typestringResource affected (e.g. job, policy, connector)
resource_idstringID of the affected resource
actorstringAPI key or user that triggered the event
metadataobjectAdditional context (varies by event type)
tenant_idstringTenant the event belongs to
created_atstringISO 8601 timestamp

Event Types

EventDescription
job.createdA redaction job was created
job.completedA redaction job completed successfully
job.failedA redaction job failed
policy.createdA policy was created
policy.updatedA policy was updated
connector.createdA connector was created
connector.sync_triggeredA connector sync was manually triggered
api_key.createdAn API key was created
api_key.revokedAn API key was revoked

GET /audit

List audit events.

Query Parameters

ParameterTypeRequiredDescription
tenant_idstringNoFilter by tenant
event_typestringNoFilter by event type
resource_typestringNoFilter by resource type (job, policy, connector, api_key)
from_datestringNoStart date (ISO 8601)
to_datestringNoEnd date (ISO 8601)
limitnumberNoMax results (default: 50, max: 100)
offsetnumberNoPagination 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"