Repository navigation
Description
[BE] Problem Statement
The /api/v1/contenttype endpoint is paginated (40 per page by default). This is fine for performance but creates a problem in the UI when restoring filters from a shared URL.
For example, a user might share this URL:
/content-drive?filters=contentType:Activity,Blog,Product
When another user opens it, the frontend fetches content types using /api/v1/contenttype. Since the endpoint only returns 40 per page, there’s no guarantee that Activity, Blog, and Product will be in the first response. As a result, the filters can’t be restored correctly.
Video
You can find the video in Slack: https://dotcms.slack.com/archives/CQNF9PCFQ/p1756743528005029?thread_ts=1756743501.342459&cid=CQNF9PCFQ
Proposed Solution
Introduce a query parameter (e.g., ensure=Activity,Blog,Product) to guarantee that these specific content types are included in the response, regardless of pagination.
Example:
/api/v1/contenttype?limit=40&ensure=Activity,Blog,Product
This allows the frontend to always display the correct filters from a shared URL.
Steps to Reproduce
- Select Activity, Blog, and Product content types in the filter.
- Share or reload the URL:
/content-drive?filters=contentType:Activity,Blog,Product
- The frontend fetches content types from
/api/v1/contenttype. - Notice that sometimes Activity/Blog/Product are missing if they don’t appear in the first 40 results.
Expected Behavior
- The API should always return the requested content types when specified in the query.
- Filters in the UI can always be restored correctly from shared URLs.
Acceptance Criteria
- Add support for a new query parameter (name TBD:
ensure,variables, or similar). - Ensure requested content types are included in the response even if they fall outside normal pagination.
- Maintain good performance for large datasets.
- Update API documentation with the new parameter.
dotCMS Version
main / trunk
Proposed Objective
User Experience & API Usability
Proposed Priority
Priority 2 – Important
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rjvelazco commentedon Sep 1, 2025
Notes
After discussing with @nollymar, I tested the endpoint
/api/v1/contenttype/_filterbut it doesn’t seem suitable for the case we want to solve:typesanddatahave limitations:typesonly returns the specified content types (too restrictive for our case).datagets ignored.POST, which makes it slower since it can’t be cached like aGETrequest.github-actions commentedon Oct 6, 2025
PRs linked to this issue
PRs linked to this issue
21 remaining items
rjvelazco commentedon Oct 31, 2025
Passed QA
dotcms/dotcms:trunk_455b07a]Video
qa-ensure-video.mov
Enhance dot-edit-content layout with view state management and conten… (
fix[CD]: Sorting when using `ensure` queryParam on Content Type Endpo…
fix[CD]: Sorting when using `ensure` queryParam on Content Type Endpo…