Skip to content

[TASK] New endpoint to create folders with metadata support #33236

Description

@fabrizzio-dotCMS

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

Activity

  1. moved this from New to Current Sprint Backlog in dotCMS - Product Planningon Sep 10, 2025
  2. jpgdotcms commented on Sep 10, 2025

    @jpgdotcms
    Contributor

    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:

    {
        "folders": [
            {
                "path": "/assets/images/products",
                "title": "Marketing Images",
                "name": "marketing",
                "order": 1,
                "showOnMenu": true,
                "defaultType": "images",
                "allowedExtensions": [
                    "jpg",
                    "png"
                ]
            },
            {
                "path": "/assets/documents/2024",
                "title": "Marketing Images",
                "name": "marketing",
                "order": 1,
                "showOnMenu": true,
                "defaultType": "images",
                "allowedExtensions": [
                    "jpg",
                    "png"
                ]
            },
            {
                "path": "/marketing/campaigns",
                "title": "Marketing Images",
                "name": "marketing",
                "order": 1,
                "showOnMenu": true,
                "defaultType": "images",
                "allowedExtensions": [
                    "jpg",
                    "png"
                ]
            }
        ]
    }
  3. moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planningon Sep 10, 2025
  4. added a commit that references this issue on Sep 12, 2025
  5. 24 remaining items

  6. zJaaal commented on Sep 18, 2025

    @zJaaal
    Member

    QA Passed

    We are able to create and update folders via API.

    Screen.Recording.2025-09-18.at.7.34.42.PM-1.mov
  7. removed their assignment
    on Sep 18, 2025
  8. added 2 commits that reference this issue on Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions