REST /api/v1/bufdir-exports 6 endpoints
GET /api/v1/bufdir-exports/api/v1/bufdir-exports

List export jobs

Public

Response Example

{
  "data": [
    {
      "export_id": "exp-20260301-abc123",
      "org_id": "org-bufdir-042",
      "status": "completed",
      "format": "excel",
      "period_from": "2025-01-01",
      "period_to": "2025-12-31",
      "created_at": "2026-03-01T08:00:00Z",
      "completed_at": "2026-03-01T08:03:21Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 4
  }
}
GET /api/v1/bufdir-exports/api/v1/bufdir-exports/:export_id

Get export job status and metadata

Public

Response Example

{
  "export_id": "exp-20260301-abc123",
  "org_id": "org-bufdir-042",
  "status": "completed",
  "format": "excel",
  "period_from": "2025-01-01",
  "period_to": "2025-12-31",
  "activity_types": [
    "group_session",
    "individual_counseling"
  ],
  "file_url": "https://storage.example.no/exports/exp-20260301-abc123.xlsx",
  "file_expires_at": "2026-04-01T08:00:00Z",
  "created_at": "2026-03-01T08:00:00Z",
  "completed_at": "2026-03-01T08:03:21Z",
  "error_message": null
}
POST /api/v1/bufdir-exports/api/v1/bufdir-exports

Initiate a new export

Public

Request Example

{
  "org_id": "org-bufdir-042",
  "format": "excel",
  "period_from": "2025-01-01",
  "period_to": "2025-12-31",
  "activity_types": [
    "group_session",
    "individual_counseling"
  ],
  "include_attachments": true,
  "submit_to_bufdir_api": false
}

Response Example

{
  "export_id": "exp-20260326-xyz789",
  "status": "queued",
  "estimated_duration_seconds": 45,
  "created_at": "2026-03-26T10:00:00Z"
}
PUT /api/v1/bufdir-exports/api/v1/bufdir-exports/:export_id/cancel

Cancel an in-progress export

Public

Request Example

{
  "reason": "Incorrect date range selected"
}

Response Example

{
  "export_id": "exp-20260326-xyz789",
  "status": "cancelled",
  "cancelled_at": "2026-03-26T10:01:00Z"
}
POST /api/v1/bufdir-exports/api/v1/bufdir-exports/:export_id/retry

Retry a failed export

Public

Response Example

{
  "export_id": "exp-20260326-xyz789",
  "status": "queued",
  "retry_count": 1,
  "queued_at": "2026-03-26T10:05:00Z"
}
DELETE /api/v1/bufdir-exports/api/v1/bufdir-exports/:export_id

Delete an export record and its files

Public

Response Example

{
  "deleted": true,
  "export_id": "exp-20260301-abc123"
}

Additional Metadata

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