Tunnel Tags

Durable, account-owned labels attached to a tunnel. These are the editable counterpart to the ephemeral agent-reported tags returned inside the agents[] array on GET /v1/tunnels/{id} — agent-reported tags are rewritten on every reconnect, whereas these survive disconnect/reconnect because they're keyed by the stable tunnel ID.

Tags are normalized server-side: trimmed, lowercased (so Prod and prod collapse to one), and truncated to 64 characters. A single tunnel may carry at most 20 tags.

Account scope: tags belong to your active account — a tunnel must belong to that account before its tags can be read or written. Use switch account to act in a different account.

List Account Tags

GET /v1/tunnels/tags

Returns the active account's full distinct set of durable tags — used to seed a fleet-filter dropdown without paging through every tunnel.

Response (200 OK)

tags string[]
Distinct tags across all of the account's tunnels, sorted alphabetically. Always present (empty array when none).

Add a Tag

POST /v1/tunnels/{id}/tags

Adds a durable tag to a tunnel the account owns. Idempotent — re-adding an existing tag is a no-op and does not count against the per-tunnel cap. Returns the tunnel's full tag set after the add.

Path parameters

id int64 Req
Tunnel ID. Get from /tunnels.

Request body

tag string Req
The tag to add. Normalized (trimmed, lowercased, capped at 64 chars). Must not be empty after normalization.

Response (200 OK)

tunnel_id int64
The tunnel the tags belong to.
tags string[]
The tunnel's full, sorted tag set after the add.

Remove a Tag

DEL /v1/tunnels/{id}/tags/{tag}

Deletes a durable tag from a tunnel the account owns. Idempotent — deleting a tag that isn't present is still a 200 with the resulting set. Returns the tunnel's full tag set after the delete.

Path parameters

id int64 Req
Tunnel ID.
tag string Req
The tag to remove. Normalized the same way as on add (trimmed, lowercased) before matching.

Response (200 OK)

tunnel_id int64
The tunnel the tags belong to.
tags string[]
The tunnel's full, sorted tag set after the delete.

Errors

400 Bad Request
Invalid tunnel ID, invalid request body, empty tag, or (on add) the 20-tag-per-tunnel limit reached.
401 Unauthorized
Missing auth.
404 Not Found
The tunnel doesn't exist or doesn't belong to your active account.
Request — list account tags
curl -X GET "https://api.ngris.com/v1/tunnels/tags" \ -H "X-API-KEY: <your_api_key>"
Response — list (200 OK)
{ "tags": ["api", "prod", "staging"] }
Request — add a tag
curl -X POST "https://api.ngris.com/v1/tunnels/<tunnel_id>/tags" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"tag": "prod"}'
Response — add (200 OK)
{ "tunnel_id": 4521, "tags": ["api", "prod"] }
Request — remove a tag
curl -X DELETE "https://api.ngris.com/v1/tunnels/<tunnel_id>/tags/prod" \ -H "X-API-KEY: <your_api_key>"
Response — remove (200 OK)
{ "tunnel_id": 4521, "tags": ["api"] }
On this page
Tunnel Tags
Iris