Attachment Folder Management
Endpoints
GET /{api_prefix}/{attachment_prefix}/foldersPOST /{api_prefix}/{attachment_prefix}/foldersPUT|PATCH /{api_prefix}/{attachment_prefix}/folders/{id}DELETE /{api_prefix}/{attachment_prefix}/folders/{id}
Data Model
Folders are stored in sp_attachment_folders (renamed from sp_document_folders) with:
idnameparent_idscope(internalby default)visibility(privateby default)owner_type/owner_idmetadata
The model supports simple tree-like grouping through parent_id, plus optional public/internal resource organization through scope and visibility.
Rename from sp_document_folders
The endpoints above (/folders, /folders/{id}) are custom function routes and were never affected by this rename — they don't expose the table name in the URL. What changed is the physical table and the record.tables/attachments.tables config key used internally and by the generic /{table} CRUD route:
- The physical table was renamed via a guarded migration (
Schema::rename, mirroring thesp_audit_logsrename precedent). sp_attachment_foldersis now the canonical config key.sp_document_foldersis kept registered as a deprecated alias pointing at the same table, so a client hitting the generic/{api_prefix}/sp_document_foldersroute directly (bypassing the/foldersendpoints above) keeps working.- Both entries set
disableCache: truewhile both are live, so a write through one key's route is immediately visible through the other's — remove that flag (and the deprecated key entirely) once clients have migrated tosp_attachment_folders.
Safety Options
attachments.access.validate_folder_exists=falseby default preserves legacy behavior. Set it totrueto reject uploads or folder updates that reference a missing folder.attachments.folder_delete_strategy=legacypreserves existing delete behavior. Set it torestrictto block deleting folders that still contain child folders or attachments.