Skip to content

Audit API

GET /api/v1/audit?project_id=...&action=task.retry&from=...&to=...&actor_user_id=...

Filters:

  • project_id - scope
  • action - prefix match (e.g. auth.*, task.retry)
  • actor_user_id - filter by actor
  • from / to - RFC 3339 timestamps
  • target_type, target_id - narrow by resource

Response:

{
"items": [
{
"id": "01H...",
"ts": "...",
"actor_user_id": "...",
"project_id": "...",
"action": "task.retry",
"target_type": "task",
"target_id": "01H...",
"details": { "original_task_id": "01H...", "new_task_id": "01H..." },
"row_hmac": "...",
"prev_row_hmac": "..."
}
],
"next_cursor": "...",
"has_more": true
}
GET /api/v1/audit/export?format=csv&from=2026-01-01&to=2026-04-01

Role: admin. Formats: csv, ndjson. Includes row_hmac and prev_row_hmac for external chain verification.

For large ranges, exports are streamed (no size cap) with Transfer-Encoding: chunked.

POST /api/v1/audit/verify

Role: admin. Runs the full-chain verification and returns:

{
"ok": true,
"rows_verified": 42091,
"first_broken_id": null
}

Or on failure:

{
"ok": false,
"rows_verified": 1028,
"first_broken_id": "01H..."
}

See security § HMAC audit chain for how the chain is constructed.