Bufdir Export Audit Repository
API Contract
REST
/api/v1/bufdir-audit-records
6 endpoints
GET
/api/v1/bufdir-audit-records/api/v1/bufdir-audit-records
List audit records for an organisation
Public
Response Example
{
"data": [
{
"record_id": "rec-20260301-001",
"export_id": "exp-20260301-abc123",
"org_id": "org-bufdir-042",
"triggered_by_user_id": "usr-0042",
"status": "completed",
"format": "excel",
"file_url": "https://storage.example.no/exports/exp-20260301-abc123.xlsx",
"created_at": "2026-03-01T08:00:00Z",
"updated_at": "2026-03-01T08:03:21Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 9
}
}
GET
/api/v1/bufdir-audit-records/api/v1/bufdir-audit-records/:record_id
Get a single audit record by ID
Public
Response Example
{
"record_id": "rec-20260301-001",
"export_id": "exp-20260301-abc123",
"org_id": "org-bufdir-042",
"triggered_by_user_id": "usr-0042",
"status": "completed",
"format": "excel",
"period_from": "2025-01-01",
"period_to": "2025-12-31",
"file_url": "https://storage.example.no/exports/exp-20260301-abc123.xlsx",
"activity_count": 312,
"created_at": "2026-03-01T08:00:00Z",
"updated_at": "2026-03-01T08:03:21Z"
}
POST
/api/v1/bufdir-audit-records/api/v1/bufdir-audit-records
Insert a new audit record
Public
Request Example
{
"export_id": "exp-20260326-xyz789",
"org_id": "org-bufdir-042",
"triggered_by_user_id": "usr-0099",
"status": "queued",
"format": "pdf",
"period_from": "2025-01-01",
"period_to": "2025-12-31"
}
Response Example
{
"record_id": "rec-20260326-007",
"export_id": "exp-20260326-xyz789",
"status": "queued",
"created_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/bufdir-audit-records/api/v1/bufdir-audit-records/:record_id/status
Update the status of an audit record
Public
Request Example
{
"status": "completed",
"updated_at": "2026-03-26T10:03:00Z"
}
Response Example
{
"record_id": "rec-20260326-007",
"status": "completed",
"updated_at": "2026-03-26T10:03:00Z"
}
PUT
/api/v1/bufdir-audit-records/api/v1/bufdir-audit-records/:record_id/file-url
Attach a file URL to an audit record
Public
Request Example
{
"file_url": "https://storage.example.no/exports/exp-20260326-xyz789.pdf"
}
Response Example
{
"record_id": "rec-20260326-007",
"file_url": "https://storage.example.no/exports/exp-20260326-xyz789.pdf",
"updated_at": "2026-03-26T10:03:05Z"
}
DELETE
/api/v1/bufdir-audit-records/api/v1/bufdir-audit-records/:record_id
Delete an audit record
Public
Response Example
{
"deleted": true,
"record_id": "rec-20260301-001"
}