Bufdir Preview Repository
API Contract
REST
/api/v1/aggregated-report-data
6 endpoints
GET
/api/v1/aggregated-report-data/api/v1/aggregated-report-data
List aggregated report data snapshots for an organization, across all periods
Public
Response Example
{
"data": [
{
"snapshot_id": "snap-001",
"organization_id": "org-1042",
"organization_name": "Barnevernstjenesten Oslo Sør",
"period_id": "2024",
"snapshot_status": "current",
"field_count": 34,
"populated_field_count": 32,
"cache_valid": true,
"aggregated_at": "2026-03-25T14:00:00Z"
},
{
"snapshot_id": "snap-002",
"organization_id": "org-1042",
"organization_name": "Barnevernstjenesten Oslo Sør",
"period_id": "2023",
"snapshot_status": "historical",
"field_count": 34,
"populated_field_count": 34,
"cache_valid": true,
"aggregated_at": "2025-01-08T10:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/aggregated-report-data/api/v1/aggregated-report-data/:id
Get a full aggregated data snapshot including all field values, supporting both current and prior period
Public
Response Example
{
"snapshot_id": "snap-001",
"organization_id": "org-1042",
"organization_name": "Barnevernstjenesten Oslo Sør",
"period_id": "2024",
"snapshot_status": "current",
"cache_valid": true,
"aggregated_at": "2026-03-25T14:00:00Z",
"sections": [
{
"section_id": "barn-under-omsorg",
"section_title": "Barn under omsorg",
"fields": [
{
"field_key": "antall_barn_plassert_utenfor_hjemmet",
"value": 47,
"prior_period_value": 52,
"data_source": "fagsystem-cis"
},
{
"field_key": "antall_akuttplasseringer",
"value": 8,
"prior_period_value": 6,
"data_source": "fagsystem-cis"
}
]
}
],
"prior_period": {
"period_id": "2023",
"snapshot_id": "snap-002",
"aggregated_at": "2025-01-08T10:00:00Z"
}
}
POST
/api/v1/aggregated-report-data/api/v1/aggregated-report-data
Trigger aggregation of report data for an organization and period, creating a new snapshot
Public
Request Example
{
"organization_id": "org-1042",
"period_id": "2024",
"force_reaggregate": false
}
Response Example
{
"snapshot_id": "snap-003",
"organization_id": "org-1042",
"period_id": "2024",
"snapshot_status": "processing",
"job_id": "job-agg-8821",
"estimated_completion_seconds": 12,
"aggregated_at": null,
"created_at": "2026-03-26T09:00:00Z"
}
PUT
/api/v1/aggregated-report-data/api/v1/aggregated-report-data/:id
Invalidate cache and trigger re-aggregation for an existing snapshot
Public
Request Example
{
"invalidate_cache": true,
"reason": "Fagsystem data updated after deadline extension"
}
Response Example
{
"snapshot_id": "snap-001",
"organization_id": "org-1042",
"period_id": "2024",
"snapshot_status": "processing",
"cache_valid": false,
"invalidation_reason": "Fagsystem data updated after deadline extension",
"job_id": "job-agg-8822",
"invalidated_at": "2026-03-26T09:05:00Z"
}
DELETE
/api/v1/aggregated-report-data/api/v1/aggregated-report-data/:id
Delete an aggregated data snapshot and clear its cache entry
Public
Response Example
{
"deleted": true,
"snapshot_id": "snap-003",
"cache_cleared": true
}
GET
/api/v1/aggregated-report-data/api/v1/aggregated-report-data/watch
Server-Sent Events stream: receive real-time updates when aggregated data changes for an organization+period
Public
Response Example
{
"event": "data_updated",
"snapshot_id": "snap-001",
"organization_id": "org-1042",
"period_id": "2024",
"changed_sections": [
"undersokelser"
],
"changed_field_keys": [
"antall_undersokelser_henlagt"
],
"updated_at": "2026-03-26T09:12:00Z"
}