Skip to content

[CD]: Add ensure Query Param to Content Types endpoint #33149

Description

@rjvelazco

[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

  1. Select Activity, Blog, and Product content types in the filter.
  2. Share or reload the URL:
/content-drive?filters=contentType:Activity,Blog,Product
  1. The frontend fetches content types from /api/v1/contenttype.
  2. 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

Activity

  1. added theissue type on Sep 1, 2025
  2. rjvelazco commented on Sep 1, 2025

    @rjvelazco
    MemberAuthor

    Notes

    After discussing with @nollymar, I tested the endpoint /api/v1/contenttype/_filter but it doesn’t seem suitable for the case we want to solve:

    • The available filters types and data have limitations:
      • types only returns the specified content types (too restrictive for our case).
      • data gets ignored.
    • The endpoint also uses POST, which makes it slower since it can’t be cached like a GET request.
  3. moved this from New to Next 2-4 Sprints in dotCMS - Product Planningon Sep 1, 2025
  4. moved this from Next 2-4 Sprints to Current Sprint Backlog in dotCMS - Product Planningon Sep 26, 2025
  5. moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planningon Sep 29, 2025
  6. github-actions commented on Oct 6, 2025

    @github-actions
    Contributor
  7. moved this from In Progress to In Review in dotCMS - Product Planningon Oct 8, 2025
  8. 21 remaining items

  9. removed their assignment
    on Oct 29, 2025
  10. removed their assignment
    on Oct 31, 2025
  11. rjvelazco commented on Oct 31, 2025

    @rjvelazco
    MemberAuthor

    Passed QA

    • dotCMS Docker Image: [dotcms/dotcms:trunk_455b07a]

    Video

    qa-ensure-video.mov
  12. added a commit that references this issue on Nov 3, 2025
    47e10a8
  13. added a commit that references this issue on Dec 9, 2025
    d374aab
  14. added a commit that references this issue on Feb 20, 2026
    ebf7a14
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