Repository navigation
Description
Task Title
We need a rest endpoint that now only creates folders but also also allow to add and modify folder metadata
Description
Currently, we have an endpoint to create folders, but it only accepts a path and a siteName. This limits folder creation since no additional metadata can be defined at creation time.
Additionally, the current design relies on passing paths, which should ideally be handled via POST instead of GET for semantic and practical reasons.
The new/updated endpoint should:
1. Use POST for folder creation or update.
2. Accept the following fields in the request body:
- path (string): Path where the folder should be created.
- siteName (string): Site where the folder belongs.
- title (string): Human-readable folder name.
- sortOrder (number): Custom ordering value for displaying folders.
- showOnMenu (boolean): Whether the folder should appear in navigation menus.
- allowedFileExtensions (array of strings): Extensions allowed for files uploaded into this folder.
- defaultFileAssetType (string): Default file asset type for new files inside this folder.
Here's a proposed JSON payload:
{
"folders": {
"/assets/images/products": {
"title": "Marketing Images",
"order": 1,
"showOnMenu": true,
"defaultType": "images",
"allowedExtensions": ["jpg", "png", "webp", "svg"],
"publicUrl": "my-cool-site.com/images",
"description": "Product marketing and promotional images",
"permissions": {
"read": ["admin", "marketing", "editor"],
"write": ["admin", "marketing"],
"delete": ["admin"]
},
"maxFileSize": "10MB",
"autoOptimize": true
},
"/assets/documents/2024": {
"title": "Documents 2024",
"order": 2,
"showOnMenu": true,
"defaultType": "documents",
"allowedExtensions": ["pdf", "docx", "xlsx", "pptx", "txt"],
"publicUrl": "my-cool-site.com/documents/2024",
"description": "Official documents and reports for 2024",
"permissions": {
...
},
"maxFileSize": "50MB",
}
}
We could include the siteName as a parent field on top of this object
or it could be part of the path
Acceptance Criteria
We need to be able to add or modify a folder and change or update the additional metadata:
"title": "Marketing Images",
"order": 1,
"showOnMenu": true,
"defaultType": "images",
"allowedExtensions": ["jpg", "png", "webp", "svg"],
"publicUrl": "my-cool-site.com/images",
"description": "Product marketing and promotional images",
See support for folder updates
https://github.com/dotCMS/core/blob/main/dotCMS/src/main/java/com/dotmarketing/portlets/folders/business/FolderFactoryImpl.java#L1078
Priority
Medium
Additional Context
No response
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
jpgdotcms commentedon Sep 10, 2025
This is a discussed JSON payload for the request body of this new endpoint, it was also reviewed and approved by Jalinson from the FE team side:
#33236
24 remaining items
zJaaal commentedon Sep 18, 2025
QA Passed
We are able to create and update folders via API.
Screen.Recording.2025-09-18.at.7.34.42.PM-1.mov
#33236
#33236
#33236
#33236
#33236
task(WebAssets) Adding Swagger Tags Refs: #33236 (#33315)
Folder with details support capabilities Refs: #33236 (#33267)
task(WebAssets) Adding Swagger Tags Refs: #33236 (#33315)