Bufdir Column Mapper
API Contract
REST
/api/v1/bufdir-column-schemas
4 endpoints
GET
/api/v1/bufdir-column-schemas/api/v1/bufdir-column-schemas/:org_id
Get current column schema for an organisation
Public
Response Example
{
"org_id": "org-bufdir-042",
"schema_version": "2025-v3",
"columns": [
{
"source_field": "activity_type",
"bufdir_column": "Aktivitetstype",
"required": true,
"data_type": "string"
},
{
"source_field": "participant_count",
"bufdir_column": "Antall deltakere",
"required": true,
"data_type": "integer"
},
{
"source_field": "date",
"bufdir_column": "Dato",
"required": true,
"data_type": "date"
}
],
"updated_at": "2026-01-10T09:00:00Z"
}
PUT
/api/v1/bufdir-column-schemas/api/v1/bufdir-column-schemas/:org_id
Update column schema for an organisation
Public
Request Example
{
"columns": [
{
"source_field": "activity_type",
"bufdir_column": "Aktivitetstype",
"required": true,
"data_type": "string"
},
{
"source_field": "participant_count",
"bufdir_column": "Antall deltakere",
"required": true,
"data_type": "integer"
},
{
"source_field": "duration_minutes",
"bufdir_column": "Varighet (minutter)",
"required": false,
"data_type": "integer"
}
]
}
Response Example
{
"org_id": "org-bufdir-042",
"schema_version": "2026-v1",
"column_count": 3,
"updated_at": "2026-03-26T10:00:00Z"
}
POST
/api/v1/bufdir-column-schemas/api/v1/bufdir-column-schemas/:org_id/map
Map a list of activity rows using the org's column schema
Public
Request Example
{
"rows": [
{
"activity_id": "act-001",
"activity_type": "group_session",
"date": "2025-06-15",
"participant_count": 8,
"duration_minutes": 90
}
]
}
Response Example
{
"mapped_rows": [
{
"Aktivitetstype": "group_session",
"Dato": "2025-06-15",
"Antall deltakere": 8,
"Varighet (minutter)": 90
}
],
"schema_version": "2026-v1",
"unmapped_fields": []
}
POST
/api/v1/bufdir-column-schemas/api/v1/bufdir-column-schemas/:org_id/validate-row
Validate a single mapped row against the schema
Public
Request Example
{
"row": {
"Aktivitetstype": "group_session",
"Dato": "2025-06-15",
"Antall deltakere": 8
}
}
Response Example
{
"valid": true,
"issues": []
}