Summary
The per-folder default values feature (added in v2.2.0) is configurable through the web UI but has no OCS API. External integrations (scripts, migrations, automation using an app-password / Bearer token) cannot read or set field defaults — the existing endpoints are CSRF-protected web routes only.
Current state
The defaults endpoints live in the web routes surface, not the ocs surface, in appinfo/routes.php:
| Endpoint |
Verb |
Purpose |
/api/groupfolders/{id}/defaults |
GET |
get configured defaults (by field id) |
/api/groupfolders/{id}/defaults |
POST |
set/clear a field default — { fieldId, value } |
/api/groupfolders/{id}/defaults/trigger |
POST |
queue a discovery/backfill run |
/api/groupfolders/{id}/defaults/status |
GET |
poll whether backfill is still running |
These are handled by DefaultsController (extends BaseController, #[NoAdminRequired], requires manage_fields on the folder) and are CSRF-protected — usable only from an authenticated browser session, not from an external client.
There is no OCS equivalent (verified: the ocs route block has zero default entries). The only non-UI path today is the occ metavox:apply-defaults command, which applies existing defaults but does not configure them.
Proposal
Expose the defaults functionality on the OCS API, mirroring the existing Api*Controller pattern (ApiFieldController / ApiFilterController / ApiViewController + BaseOCSController):
GET /api/v1/groupfolders/{groupfolderId}/defaults — list configured defaults
POST /api/v1/groupfolders/{groupfolderId}/defaults — set/clear a default ({ fieldId, value })
POST /api/v1/groupfolders/{groupfolderId}/defaults/trigger — queue backfill
GET /api/v1/groupfolders/{groupfolderId}/defaults/status — backfill status
Implementation notes:
- Add an
ApiDefaultsController extends BaseOCSController that delegates to the existing DefaultsService (so behaviour stays identical to the web controller — no logic duplication).
- Keep the same authorization: require
manage_fields permission on the groupfolder.
- Reuse the same value validation as the web
setDefault (type-correct per field type, null = clear).
- Document the new endpoints under
docs/ (and the NL docs/*.nl.md source-of-truth), consistent with how the other OCS endpoints are documented.
Why
This enables SharePoint-style bulk provisioning use cases — e.g. a migration script that creates Team folders, defines fields, and seeds their default values end-to-end without a human clicking through Personal/Admin settings. It rounds out the API parity that fields, metadata, filters and views already have on OCS.
Acceptance criteria
Spun off from the v2.2.0 release work — targeted at a future release.
Summary
The per-folder default values feature (added in v2.2.0) is configurable through the web UI but has no OCS API. External integrations (scripts, migrations, automation using an app-password / Bearer token) cannot read or set field defaults — the existing endpoints are CSRF-protected web routes only.
Current state
The defaults endpoints live in the web
routessurface, not theocssurface, inappinfo/routes.php:/api/groupfolders/{id}/defaults/api/groupfolders/{id}/defaults{ fieldId, value }/api/groupfolders/{id}/defaults/trigger/api/groupfolders/{id}/defaults/statusThese are handled by
DefaultsController(extendsBaseController,#[NoAdminRequired], requiresmanage_fieldson the folder) and are CSRF-protected — usable only from an authenticated browser session, not from an external client.There is no OCS equivalent (verified: the
ocsroute block has zerodefaultentries). The only non-UI path today is theocc metavox:apply-defaultscommand, which applies existing defaults but does not configure them.Proposal
Expose the defaults functionality on the OCS API, mirroring the existing
Api*Controllerpattern (ApiFieldController/ApiFilterController/ApiViewController+BaseOCSController):GET /api/v1/groupfolders/{groupfolderId}/defaults— list configured defaultsPOST /api/v1/groupfolders/{groupfolderId}/defaults— set/clear a default ({ fieldId, value })POST /api/v1/groupfolders/{groupfolderId}/defaults/trigger— queue backfillGET /api/v1/groupfolders/{groupfolderId}/defaults/status— backfill statusImplementation notes:
ApiDefaultsController extends BaseOCSControllerthat delegates to the existingDefaultsService(so behaviour stays identical to the web controller — no logic duplication).manage_fieldspermission on the groupfolder.setDefault(type-correct per field type, null = clear).docs/(and the NLdocs/*.nl.mdsource-of-truth), consistent with how the other OCS endpoints are documented.Why
This enables SharePoint-style bulk provisioning use cases — e.g. a migration script that creates Team folders, defines fields, and seeds their default values end-to-end without a human clicking through Personal/Admin settings. It rounds out the API parity that fields, metadata, filters and views already have on OCS.
Acceptance criteria
manage_fieldsDefaultsService), no behavioural driftSpun off from the v2.2.0 release work — targeted at a future release.