REST /api/v1/report-history 6 endpoints
GET /api/v1/report-history/api/v1/report-history

List report history for an organisation with optional period filtering

Public

Response Example

{
  "data": [
    {
      "report_id": "rpt_01HX9K2M3N4P5Q6R7S8T9U0V",
      "org_id": "org_bufdir_oslo_42",
      "report_type": "quarterly_activity",
      "period_from": "2025-10-01",
      "period_to": "2025-12-31",
      "status": "completed",
      "file_ref": "reports/org_bufdir_oslo_42/2025-Q4/report_final.xlsx",
      "generated_by": "user_09AXKL2",
      "generated_at": "2026-01-05T08:14:22Z",
      "created_at": "2026-01-05T08:14:22Z"
    },
    {
      "report_id": "rpt_02HY0L3N4O5P6Q7R8S9T0U1W",
      "org_id": "org_bufdir_oslo_42",
      "report_type": "annual_summary",
      "period_from": "2025-01-01",
      "period_to": "2025-12-31",
      "status": "completed",
      "file_ref": "reports/org_bufdir_oslo_42/2025-annual/report_final.xlsx",
      "generated_by": "user_07BXKM3",
      "generated_at": "2026-02-10T11:00:00Z",
      "created_at": "2026-02-10T11:00:01Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 2
  }
}
GET /api/v1/report-history/api/v1/report-history/:report_id

Retrieve a single historical report record

Public

Response Example

{
  "report_id": "rpt_01HX9K2M3N4P5Q6R7S8T9U0V",
  "org_id": "org_bufdir_oslo_42",
  "report_type": "quarterly_activity",
  "period_from": "2025-10-01",
  "period_to": "2025-12-31",
  "status": "completed",
  "file_ref": "reports/org_bufdir_oslo_42/2025-Q4/report_final.xlsx",
  "file_size_bytes": 204800,
  "generated_by": "user_09AXKL2",
  "generated_at": "2026-01-05T08:14:22Z",
  "created_at": "2026-01-05T08:14:22Z",
  "updated_at": "2026-01-05T08:14:25Z"
}
GET /api/v1/report-history/api/v1/report-history/:report_id/download-url

Generate a signed download URL for a report file

Public

Response Example

{
  "report_id": "rpt_01HX9K2M3N4P5Q6R7S8T9U0V",
  "download_url": "https://storage.bufdir.no/reports/org_bufdir_oslo_42/2025-Q4/report_final.xlsx?X-Amz-Signature=abc123&X-Amz-Expires=3600",
  "expires_at": "2026-03-26T14:00:00Z",
  "file_name": "report_final.xlsx",
  "file_size_bytes": 204800
}
POST /api/v1/report-history/api/v1/report-history

Create a new report history record

Public

Request Example

{
  "org_id": "org_bufdir_oslo_42",
  "report_type": "quarterly_activity",
  "period_from": "2026-01-01",
  "period_to": "2026-03-31",
  "status": "pending",
  "generated_by": "user_09AXKL2"
}

Response Example

{
  "report_id": "rpt_03HZ1M4O5P6Q7R8S9T0U1V2X",
  "org_id": "org_bufdir_oslo_42",
  "report_type": "quarterly_activity",
  "period_from": "2026-01-01",
  "period_to": "2026-03-31",
  "status": "pending",
  "file_ref": null,
  "generated_by": "user_09AXKL2",
  "generated_at": null,
  "created_at": "2026-03-26T12:00:00Z",
  "updated_at": "2026-03-26T12:00:00Z"
}
PUT /api/v1/report-history/api/v1/report-history/:report_id

Update an existing report history record (e.g. attach file_ref on completion)

Public

Request Example

{
  "status": "completed",
  "file_ref": "reports/org_bufdir_oslo_42/2026-Q1/report_final.xlsx",
  "file_size_bytes": 318720,
  "generated_at": "2026-03-26T12:45:00Z"
}

Response Example

{
  "report_id": "rpt_03HZ1M4O5P6Q7R8S9T0U1V2X",
  "org_id": "org_bufdir_oslo_42",
  "report_type": "quarterly_activity",
  "period_from": "2026-01-01",
  "period_to": "2026-03-31",
  "status": "completed",
  "file_ref": "reports/org_bufdir_oslo_42/2026-Q1/report_final.xlsx",
  "file_size_bytes": 318720,
  "generated_by": "user_09AXKL2",
  "generated_at": "2026-03-26T12:45:00Z",
  "created_at": "2026-03-26T12:00:00Z",
  "updated_at": "2026-03-26T12:45:02Z"
}
DELETE /api/v1/report-history/api/v1/report-history/:report_id

Delete a report history record (retention policy enforcement applies)

Public

Response Example

{
  "report_id": "rpt_03HZ1M4O5P6Q7R8S9T0U1V2X",
  "deleted": true,
  "deleted_at": "2026-03-26T13:00:00Z"
}

Additional Metadata

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