Problem Statement
The TagResource v2 API (/api/v2/tags) has three related bugs around the siteId field that break site-specific tag management:
- Create ignores siteId:
POST /api/v2/tags with a non-SYSTEM_HOST siteId silently saves the tag under SYSTEM_HOST instead.
- Edit site makes tag disappear from list:
PUT /api/v2/tags/{id} to change a tag's site returns 200 with correct data, but the tag no longer appears in GET /api/v2/tags results.
- Filter by siteId doesn't work:
GET /api/v2/tags?siteId={id} does not return tags that were assigned to that site via PUT.
These bugs make it impossible to manage tags per-site, which is a core multi-site feature.
Steps to Reproduce
Bug 1 — Create ignores siteId:
- Get a non-SYSTEM_HOST site ID (e.g.,
demo.dotcms.com with id 48190c8c-42c4-46af-8d1a-0cd5db894797)
POST /api/v2/tags with body: [{"name": "test-tag", "siteId": "48190c8c-42c4-46af-8d1a-0cd5db894797"}]
- Response returns
siteId: "SYSTEM_HOST" — the requested siteId is ignored
Bug 2 — Edit site makes tag disappear:
- Create a tag (it will be on SYSTEM_HOST due to Bug 1)
PUT /api/v2/tags/{tagId} with body: {"tagName": "test-tag", "siteId": "48190c8c-42c4-46af-8d1a-0cd5db894797"}
- Response returns
200 with correct siteId
GET /api/v2/tags?filter=test-tag — returns 0 results, the tag disappeared
Bug 3 — Filter by siteId broken:
- After Bug 2's PUT, the tag should be on
demo.dotcms.com
GET /api/v2/tags?siteId=48190c8c-42c4-46af-8d1a-0cd5db894797 — our tag is not in the results
GET /api/v2/tags?filter=test-tag&siteId=48190c8c-42c4-46af-8d1a-0cd5db894797 — returns 0 results
Automated test script output (6 of 12 tests fail):
Test 1: POST with siteId=demo.dotcms.com → FAIL (saved as SYSTEM_HOST)
Test 2: GET after create → FAIL (siteId is SYSTEM_HOST, not requested site)
Test 3: PUT to SYSTEM_HOST → PASS
Test 4: PUT to demo.dotcms.com → FAIL (tag disappears from list)
Test 5: GET with siteId filter → FAIL (our tag not found)
Acceptance Criteria
dotCMS Version
Latest from main branch (local dev environment, localhost:8080)
Severity
High - Major functionality broken
Links
Problem Statement
The
TagResourcev2 API (/api/v2/tags) has three related bugs around thesiteIdfield that break site-specific tag management:POST /api/v2/tagswith a non-SYSTEM_HOSTsiteIdsilently saves the tag underSYSTEM_HOSTinstead.PUT /api/v2/tags/{id}to change a tag's site returns200with correct data, but the tag no longer appears inGET /api/v2/tagsresults.GET /api/v2/tags?siteId={id}does not return tags that were assigned to that site via PUT.These bugs make it impossible to manage tags per-site, which is a core multi-site feature.
Steps to Reproduce
Bug 1 — Create ignores siteId:
demo.dotcms.comwith id48190c8c-42c4-46af-8d1a-0cd5db894797)POST /api/v2/tagswith body:[{"name": "test-tag", "siteId": "48190c8c-42c4-46af-8d1a-0cd5db894797"}]siteId: "SYSTEM_HOST"— the requested siteId is ignoredBug 2 — Edit site makes tag disappear:
PUT /api/v2/tags/{tagId}with body:{"tagName": "test-tag", "siteId": "48190c8c-42c4-46af-8d1a-0cd5db894797"}200with correctsiteIdGET /api/v2/tags?filter=test-tag— returns 0 results, the tag disappearedBug 3 — Filter by siteId broken:
demo.dotcms.comGET /api/v2/tags?siteId=48190c8c-42c4-46af-8d1a-0cd5db894797— our tag is not in the resultsGET /api/v2/tags?filter=test-tag&siteId=48190c8c-42c4-46af-8d1a-0cd5db894797— returns 0 resultsAutomated test script output (6 of 12 tests fail):
Acceptance Criteria
POST /api/v2/tagswith a validsiteIdcreates the tag on that site (not SYSTEM_HOST)PUT /api/v2/tags/{id}changingsiteIdkeeps the tag visible inGET /api/v2/tagsresultsGET /api/v2/tags?siteId={id}returns tags that belong to that siteGET /api/v2/tags?filter={name}&siteId={id}returns matching tags on that sitedotCMS Version
Latest from main branch (local dev environment,
localhost:8080)Severity
High - Major functionality broken
Links