REST /api/v1/bufdir-export-audit 6 endpoints
GET /api/v1/bufdir-export-audit/api/v1/bufdir-export-audit

Get export history for an organisation

Public

Response Example

{
  "data": [
    {
      "audit_id": "aud-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-export-audit/api/v1/bufdir-export-audit/:audit_id

Get a single audit record

Public

Response Example

{
  "audit_id": "aud-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-export-audit/api/v1/bufdir-export-audit

Create a new audit entry when an export is initiated

Public

Request Example

{
  "export_id": "exp-20260326-xyz789",
  "org_id": "org-bufdir-042",
  "triggered_by_user_id": "usr-0099",
  "format": "pdf",
  "period_from": "2025-01-01",
  "period_to": "2025-12-31",
  "activity_types": [
    "group_session"
  ]
}

Response Example

{
  "audit_id": "aud-20260326-007",
  "export_id": "exp-20260326-xyz789",
  "status": "queued",
  "created_at": "2026-03-26T10:00:00Z"
}
PUT /api/v1/bufdir-export-audit/api/v1/bufdir-export-audit/:audit_id/status

Update audit record status

Public

Request Example

{
  "status": "processing",
  "updated_at": "2026-03-26T10:00:10Z"
}

Response Example

{
  "audit_id": "aud-20260326-007",
  "status": "processing",
  "updated_at": "2026-03-26T10:00:10Z"
}
PUT /api/v1/bufdir-export-audit/api/v1/bufdir-export-audit/:audit_id/file

Attach a generated file URL to an audit record

Public

Request Example

{
  "file_url": "https://storage.example.no/exports/exp-20260326-xyz789.pdf",
  "file_size_bytes": 1048576
}

Response Example

{
  "audit_id": "aud-20260326-007",
  "file_url": "https://storage.example.no/exports/exp-20260326-xyz789.pdf",
  "updated_at": "2026-03-26T10:02:45Z"
}
DELETE /api/v1/bufdir-export-audit/api/v1/bufdir-export-audit/:audit_id

Delete an audit record (admin only)

Public

Response Example

{
  "deleted": true,
  "audit_id": "aud-20260301-001"
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}