API: tags
Manage tags and their auto-tagging rules, and attach or detach tags on individual issues. All requests use the api query parameter and require an API key. See API conventions for headers and error shapes.
List, create, update, delete tags - ?api=tags
| Method | Action |
|---|---|
GET | List all tags with issue_count and their rules. |
POST | Create a tag. Returns 201. |
PUT / PATCH | Update a tag by id. |
DELETE | Delete a tag by id. Returns { "id": ..., "deleted": true }. |
GET returns { "data": [ ... ] }; every tag includes a live issue_count and a rules array of { id, match_word, enabled }.
Body fields (create / update)
| Field | Required | Default | Rules |
|---|---|---|---|
name | yes | - | Trimmed, 1-80 chars, must be unique |
color | no | #64748b | Six-digit hex (#rrggbb), stored lower-case |
icon | no | tag | ^[a-z][a-z0-9_-]{0,31}$ |
match_word | no | "" | Max 200 chars; empty means no rule |
For update, supply id in the body or as ?id=. A non-empty match_word creates a single auto-tagging rule; rules apply immediately after create and update, matching issue title, sample message, or exception class. Updating a tag rebuilds its rule and re-applies it - previously rule-tagged issues are cleared and recomputed, while manual assignments are preserved. Deleting a tag removes all of its issue assignments.
curl -X POST 'http://localhost:8080/?api=tags' \
-H 'X-Log-Lens-Token: YOUR_KEY' -H 'Content-Type: application/json' \
-d '{"name":"Payments","color":"#ef4444","icon":"credit-card","match_word":"Stripe"}'
Tag an issue - ?api=issue-tags
POST only. Adds or removes a tag on one issue.
| Field | Required | Default |
|---|---|---|
group_id | yes | - |
tag_id | yes | - |
action | no | add (remove to detach) |
Adding marks the assignment as manual, so a later rule pass will not undo it. Returns the echoed { groupId, tagId, action }.
curl -X POST 'http://localhost:8080/?api=issue-tags' \
-H 'X-Log-Lens-Token: YOUR_KEY' -H 'Content-Type: application/json' \
-d '{"group_id":42,"tag_id":3,"action":"add"}'
Errors
Validation failures (bad name, color, icon, length, or duplicate name) return 422. A missing tag on update or delete returns 404. A valid id below 1, or a missing group_id/tag_id, returns 422. See status codes.
Related: Tags and automatic rules / Bulk status and tag actions / API: status and bulk actions