Report History Repository
API Contract
REST
/api/v1/report-records
5 endpoints
GET
/api/v1/report-records/api/v1/report-records
Retrieve paginated report records for an organisation (repository layer)
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",
"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"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
GET
/api/v1/report-records/api/v1/report-records/:report_id
Fetch a single report record by ID from the repository
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"
}
POST
/api/v1/report-records/api/v1/report-records
Insert a new report record into the repository
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",
"file_ref": null,
"generated_by": "user_09AXKL2"
}
Response Example
{
"report_id": "rpt_04PD6Q0U1V2W3X4Y5Z6A7B8C",
"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,
"file_size_bytes": 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-records/api/v1/report-records/:report_id
Update the file reference and status of a report record after generation
Public
Request Example
{
"file_ref": "reports/org_bufdir_oslo_42/2026-Q1/report_final.xlsx",
"file_size_bytes": 318720,
"status": "completed",
"generated_at": "2026-03-26T12:45:00Z"
}
Response Example
{
"report_id": "rpt_04PD6Q0U1V2W3X4Y5Z6A7B8C",
"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-records/api/v1/report-records/:report_id
Hard-delete a report record from the repository
Public
Response Example
{
"report_id": "rpt_04PD6Q0U1V2W3X4Y5Z6A7B8C",
"deleted": true,
"deleted_at": "2026-03-26T13:00:00Z"
}