Skip to content

Folders ​

Overview ​

Folders are the category resource: DigitalAssetsCategory rows in digital_assets_categories. They nest through parent_id, and each row caches its ancestor chain in category_path (comma separated ids, root first). An asset has one folder (digital_assets.category_id) or none; an asset without a folder is an uncategorised recent upload and is not searchable. Folders use soft deletes, so the trash is the set of soft-deleted folders plus assets flagged is_deleted.

The Admin API (/api/v1/digital-assets/category/*) owns create, rename, browse, trash, restore and permanent delete. Moving folders goes through the asset move endpoint. The Portal API (/dam/v1/digital/...) reads only folders that are public or protected in the partner's portal. The External API reads folders through get-category and get-category-with-file, filtered by an ACL role. Folders are Scout searchable while visible_in_trashed = 0 and not final deleted; see Search.

Most admin folder endpoints call DamInstance::checkUser() (DAM module active, role Admin, Manager or Viewer). The exceptions are listed under each workflow. Per-portal visibility of folders is covered in Permissions and Portal Visibility.

Endpoints ​

Admin API (/api/v1/digital-assets) ​

MethodPathController@methodcheckUserPurpose
POST/category/addCategoryController@addCategoryyesCreate a root folder
POST/category/add-sub-categoryCategoryController@addSubCategoryyesCreate a sub folder
POST/category/rename/{categoryId}CategoryController@renameCategorynoRename and set description
GET/category/all-category-listCategoryController@getAllCategoryyesRoot folders with child flags and permission names
GET/category/sub-category-listCategoryController@getSubCategoryListyesDirect children of category_id, by name
POST/category/viewCategoryController@viewCategoryyesFolder detail with children and asset counts
POST/category/get-count/{categoryId}CategoryController@getCategoryAssetCountnoLive asset count of the folder and its whole subtree
GET/category/view-files-with-categoryCategoryController@getCategoryAndFilesnoOne page of sub folders plus assets
GET/category/view-files-with-category/select-allCategoryController@getCategoryAndFilesSelectAllIdsnoAll ids for select-all, capped
GET/category/view-files-with-category-tagsCategoryController@getCategoryAndFilesOldOlder browse endpoint
POST/multiple-file-folder-moveAssetController@moveMultipleFileOrFolderToFolderyesMove folders and assets
POST/category/delete-category-with-filesCategoryController@deleteCategoryAndFilesyesMove to trash
GET/category/get-deleted-category-with-filesCategoryController@getDeleteCategoryAndFilesyesList trash
POST/category/restore-deleted-category-with-filesCategoryController@restoreDeleteCategoryAndFilesyesRestore selected items
GET/category/all-restore-deleted-category-with-filesCategoryController@allRestoreDeleteCategoryAndFilesyesRestore everything
POST/category/permanent-delete-category-with-filesCategoryController@permanentDeleteCategoryAndFilesyesDelete for good

Portal API (/dam/v1/digital) ​

MethodPathController@methodPurpose
GET/category-listCategoryController@getCategoryRoot folders visible in the portal, with child folders and counts
GET/view-files-with-categoryCategoryController@getCategoryAndFilesFolder contents for the portal
POST/view-categoryCategoryController@viewCategoryFolder detail
POST/get-count/{categoryId}CategoryController@getCategoryAssetCountPublic asset count of the subtree
POST/sub-categoryCategoryController@getChildCategoryChildren of parent_id
POST/get-parent-categoryCategoryController@getParentCategoryParent chain for breadcrumbs
GET/view-asset-metadataCategoryController@GetAssetMetaDataAsset metadata

External API (/external/v1) ​

MethodPathController@methodPurpose
POST/get-categoryExternal\AssetsController@getCategoryFolders with counts of assets carrying the role ACL
POST/get-category-with-fileExternal\AssetsController@getCategoryAndFilesFolder contents for a role

Workflows ​

Create a folder or sub folder ​

category/add needs url_workspace_id and folder_name and always creates a root folder with the legacy column visibility = 0 but no portal permission rows, so a new root folder is private in every portal (portal visibility reads only the permission rows). add-sub-category does not run a validator, so a missing folder_name is not rejected by a rule. Neither endpoint checks for duplicate names.

Rename a folder ​

Rename does not call checkUser. The model save() lets Scout sync the folder document; asset breadcrumbs that include the old name are not reindexed by this endpoint.

Browse a folder (admin) ​

Folders and assets share one paged list: folders come first, and each page takes assets only after the folders that fall on it, so the asset offset is max(0, offset - folders). Allowed sort columns are display_file_name, file_size, file_type, created_at, updated_at, modified_at; anything else falls back to created_at. Folders sort by folder_name when the asset sort is a name, size or type column. Only live assets count (is_archive, is_deleted, final_deleted all 0). get_tags=true and get_cf=true add tags and custom fields in the Typesense shape; display_file is appended for document, GIF and SVG types. collage_adobe_integration=true also returns all_assets_ids and all_folder_ids for the Adobe plugin. The endpoint does not call checkUser. select-all returns ids up to constant.MAX_BULK_OPERATION_LIMIT (default 5000), folders first.

Move a folder ​

The same endpoint moves assets; see Assets. Folder documents are reindexed in chunks of 500. Assets under a moved folder are reindexed inline up to 2000; above that they go through ReindexAssetsByIds jobs.

Trash a folder ​

Only the folders the user picked get visible_in_trashed = 1; their sub folders are trashed with visible_in_trashed = 0, stay out of the trash list and come back with their parent. Directly picked assets also get visible_in_trashed = 1 and their embed codes turned off. The trash list (get-deleted-category-with-files) unions trashed folders and trashed assets with visible_in_trashed = 1, ordered by sort_by (default desc).

Restore and permanent delete ​

all-restore-deleted-category-with-files restores every trashed folder that is not final deleted, then every trashed asset whose folder is live or missing. permanent-delete-category-with-files takes category_ids and assets_ids, removes the S3 files, sets final_deleted = 1 and clears category_id on the deleted assets. dam:assets-delete purges anything trashed more than 30 days ago (daily 09:10).

Portal folder browse ​

The query uses the request instance_id (required here), falling back to the partner's own instance_id on other portal endpoints. Sub-folder counts on this page join permission rows with visibility in [0, 1], so they count private children and skip protected ones; the folder list itself uses [0, 2]. sub-category and get-parent-category do not apply the portal visibility filter or a workspace filter.

Data ​

Model / tableUse
DigitalAssetsCategory / digital_assets_categoriesparent_id, category_path, folder_name, description, visible_in_trashed, final_deleted, modified_at, soft deletes. visibility is the legacy single-portal column (0 public, 1 private, 2 protected), copied into dam_instance_permissions by migration 2026_03_23_120000; it is still written on create and restore
DigitalAssetscategory_id, live flags
AssetsVersioncategory_id and trash flags copied from the asset
DamInstancePermissionPer-portal folder rows (permissionable_type = DigitalAssetsCategory)
DamGroupLegacy group permission names shown on folder lists