Action Endpoints

Tidy Tags exposes its actions as Craft controller endpoints so you can call them from your own templates, modules, or front-end code. Every mutating endpoint requires the accessPlugin-tidytags permission and a CSRF token.

Reference

Action Method Params
tidytags/tags/check-duplicate GET title, groupId, siteId
tidytags/tags/usages GET elementId
tidytags/tags/rename POST tagId, title, siteId
tidytags/tags/delete POST tagId or tagIds[]
tidytags/tags/merge POST targetId, sourceIds[]
tidytags/tags/swap POST targetId, sourceIds[]

check-duplicate

Returns a list of items whose Levenshtein distance to the provided title is within the default threshold. Matches come from the given tag group and every configured tag-like entry section, so the editor warning surfaces near-duplicates across sources. This is what powers the “did you mean?” notice under tag fields, but you can call it yourself:

GET /actions/tidytags/tags/check-duplicate?title=JavaScrpt&groupId=3&siteId=1

usages

Returns every relation that targets a given element — i.e. every source element (entry, asset, etc.) that holds a reference to this tag or entry through a relational field. Used by the duplicates view to expand a cluster item and preview what would move during a swap or merge.

GET /actions/tidytags/tags/usages?elementId=42

rename

Renames a single tag. Passing a siteId scopes the rename to that site's translation; omit it to rename the tag in every site at once.

POST /actions/tidytags/tags/rename
  tagId=123
  title=JavaScript
  siteId=1

delete

Deletes a single tag (tagId) or a batch of tags (tagIds[]). The source tag elements are removed across all sites.

merge

Repoints every relation that targets one of the source tags to the target tag, de-dupes collisions, and deletes the source tags — all inside one transaction. Tag-only. See Merging Tags for a full walkthrough.

POST /actions/tidytags/tags/merge
  targetId=42
  sourceIds[]=87&sourceIds[]=91

swap

The element-type-agnostic version of merge. Runs the same relation re-pointing logic inside a transaction but never deletes the source elements. Safe across element types — tag → tag, entry → entry, or any cross-type combination — because it only touches the {{%relations}} table. See How swap works.

POST /actions/tidytags/tags/swap
  targetId=42
  sourceIds[]=87&sourceIds[]=91

More in Control Panel & Assets

Pairs well with Tidy Tags

Small changes to the control panel that editors notice on day one. Better filters, a real media library, sidebar fields, watermarks and uploads that don't time out.