API — Tags
CRUD for Tags — freeform labels applied to locations. All endpoints require auth:api, auth_session, and audit middleware. Results are workspace-scoped.
Endpoints
GET /tags
List all tags in the active workspace.
Query params: workspace_id
Response 200: Array of tag objects { id, name, slug, workspace_id, created_at, updated_at }.
Tag slugs are auto-generated from the name on creation (lowercase, hyphenated). The slug is used as the stable identifier in refinement conditions and the widget filter UI.
GET /tags/{id}
Get a single tag by numeric ID.
Response 200: Tag object.
POST /tags
Create a new tag.
Body: { name, workspace_id }
Response 201: Created tag object including the generated slug.
PUT /tags/{id}
Rename a tag.
Body: { name }
Response 200: Updated tag object. The slug is regenerated from the new name.
⚠️ Warning: Renaming a tag regenerates the slug. If any finder refinements or advanced rules reference the old slug by value, those conditions will no longer match. Update refinements after renaming tags.
DELETE /tags/{id}
Delete a tag. Removes the tag from all locations it was applied to.
Response 204
Admin variants
Under role:admin middleware via /admin/tags:
GET /admin/tags,POST /admin/tags,PUT /admin/tags/{tag},DELETE /admin/tags/{tag}