Skip to content

Tags

Organize and categorize resources with key-value tags.

Tags are key-value pairs that help you organize, filter, and manage resources:

ComponentDescriptionExample
KeyCategory or attribute nameenvironment, team, region
ValueSpecific value for the keyproduction, platform, us-east-1
ResourceCommon Tag Use Cases
TargetsEnvironment, region, team, application
TenantsTier, industry, support level
┌─────────────────────────────────────────────────────────────┐
│ Tags │
├─────────────────────────────────────────────────────────────┤
│ │
│ Search: [____________________________] [+ New Tag] │
│ │
│ ┌───────────────┬──────────────────┬───────┬───────────┐ │
│ │ Key │ Value │ Used │ Actions │ │
│ ├───────────────┼──────────────────┼───────┼───────────┤ │
│ │ environment │ production │ 24 │ [···] │ │
│ │ environment │ staging │ 8 │ [···] │ │
│ │ environment │ development │ 4 │ [···] │ │
│ │ team │ platform │ 12 │ [···] │ │
│ │ team │ frontend │ 8 │ [···] │ │
│ │ region │ us-east-1 │ 16 │ [···] │ │
│ │ region │ eu-west-1 │ 8 │ [···] │ │
│ └───────────────┴──────────────────┴───────┴───────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Create Tag │
├─────────────────────────────────────────────────────────────┤
│ │
│ Key * │
│ [environment ] │
│ │
│ Value * │
│ [production ] │
│ │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ Tags with the same key and value are shared across │ │
│ │ resources. │ │
│ └───────────────────────────────────────────────────────┘ │
│ │
│ [Cancel] [Create] │
│ │
└─────────────────────────────────────────────────────────────┘

Tags are managed through the REST API. There is no mantisctl subcommand for tag management. Create a tag with a POST to /api/v1/tags:

Terminal window
# Create a tag
curl -X POST https://mantis.example.com/api/v1/tags \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "environment", "value": "production"}'
# Create additional tags with separate requests
curl -X POST https://mantis.example.com/api/v1/tags \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "team", "value": "platform"}'

The tags:create permission is required.

┌─────────────────────────────────────────────────────────────┐
│ Target: web-prod-01 │
├─────────────────────────────────────────────────────────────┤
│ │
│ Tags: │
│ ┌──────────────────────────────────────┐ │
│ │ environment: production [×] │ │
│ │ team: platform [×] │ │
│ │ region: us-east-1 [×] │ │
│ └──────────────────────────────────────┘ │
│ │
│ [+ Add Tag] │
│ │
└─────────────────────────────────────────────────────────────┘

Targets are tagged by attaching existing tag IDs. Tag and target management is done in Lens or via the REST API (there is no mantisctl tag subcommand).

Terminal window
# Attach tags to a target (tags are referenced by ID)
curl -X POST "$MANTIS_URL/api/v1/targets/<target-id>/tags" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"tag_ids": ["<tag-id-1>", "<tag-id-2>"]}'
# Detach tags from a target
curl -X DELETE "$MANTIS_URL/api/v1/targets/<target-id>/tags" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"tag_ids": ["<tag-id-1>"]}'
# List a target's tags
curl "$MANTIS_URL/api/v1/targets/<target-id>/tags" \
-H "Authorization: Bearer $TOKEN"

Tenant tags are managed in Lens (via the tenant detail view) or through the REST API, using the same AttachTagsRequest shape as target tags:

Terminal window
# Attach tags to a tenant
curl -X POST "$MANTIS_URL/api/v1/tenants/<tenant-id>/tags" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"tag_ids": ["<tag-id-1>", "<tag-id-2>"]}'
# Detach tags from a tenant
curl -X DELETE "$MANTIS_URL/api/v1/tenants/<tenant-id>/tags" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"tag_ids": ["<tag-id-1>"]}'
# List a tenant's tags
curl "$MANTIS_URL/api/v1/tenants/<tenant-id>/tags" \
-H "Authorization: Bearer $TOKEN"

The tenants:manage_tags permission is required to attach or detach tenant tags.

Filter targets by tags in Lens:

┌─────────────────────────────────────────────────────────────┐
│ Targets │
├─────────────────────────────────────────────────────────────┤
│ │
│ Filters: │
│ [environment: production ▼] [team: platform ▼] [+ Filter] │
│ │
│ Showing 8 of 36 targets matching filters │
│ │
│ ┌────────────────┬──────────┬────────────────────────────┐│
│ │ Name │ Status │ Tags ││
│ ├────────────────┼──────────┼────────────────────────────┤│
│ │ web-prod-01 │ ● Online │ environment:production,... ││
│ │ web-prod-02 │ ● Online │ environment:production,... ││
│ │ api-prod-01 │ ● Online │ environment:production,... ││
│ │ api-prod-02 │ ● Online │ environment:production,... ││
│ └────────────────┴──────────┴────────────────────────────┘│
│ │
└─────────────────────────────────────────────────────────────┘

GET /api/v1/targets returns each target with its associated tags, so you can list targets and filter by tag client-side (the list endpoint itself does not take a tag query parameter):

Terminal window
# List targets and filter to those tagged environment=production
curl "$MANTIS_URL/api/v1/targets" \
-H "Authorization: Bearer $TOKEN" | \
jq '.data[] | select(.tags[] | .key == "environment" and .value == "production")'

The Lens Targets view does not currently support tag-based filtering; the search bar filters only by name or hostname, and the status filter narrows by Online/Stale/Offline. Tag-based target selection is available during deployment creation (the By Tags tab in the new-deployment flow). Client-side filtering via the REST API (as shown above) is the alternative for ad-hoc tag queries.

Select targets by tag during deployment:

┌─────────────────────────────────────────────────────────────┐
│ Select Deployment Targets │
├─────────────────────────────────────────────────────────────┤
│ │
│ Selection Mode: │
│ ○ All targets in environment │
│ ● Select by tags │
│ ○ Manual selection │
│ │
│ Tag Filters: │
│ [environment: production ▼] [team: platform ▼] │
│ │
│ Matching targets (4): │
│ ✓ web-prod-01 │
│ ✓ web-prod-02 │
│ ✓ api-prod-01 │
│ ✓ api-prod-02 │
│ │
└─────────────────────────────────────────────────────────────┘
CategoryKeysExample Values
Infrastructureenvironment, region, zoneproduction, us-east-1, az-a
Organizationteam, department, ownerplatform, engineering, alice
Costcost-center, project, budgetops-2024, project-x, q1
Technicalos, runtime, versionlinux, nodejs-18, v1.2
Compliancecompliance, data-classificationpci, confidential
PracticeGood ExampleAvoid
Lowercase keysenvironmentEnvironment, ENVIRONMENT
Hyphen separatorscost-centercost_center, costCenter
Short valuesprod, stg, devproduction-environment
Consistent prefixesapp-web, app-apiweb-app, api-application

The tag system is flat key-value pairs — there are no built-in tag groups or categories. Grouping is a human convention enforced through your chosen key names. For example, using a consistent set of keys (such as those in the naming conventions table above) makes it easy to treat all tags sharing a key like environment as a logical group when browsing or filtering.

Resources tagged with a given key/value are discovered through the Lens UI or the REST list endpoints. There is no dedicated cross-resource search command.

Via Lens UI: Use the tag filter on a resource list (for example, the Targets view) to narrow results to a specific key:value pair.

Via REST API: Each resource list endpoint returns the tags associated with every item, so you can filter client-side. For example, list targets and inspect their tags arrays:

Terminal window
curl https://mantis.example.com/api/v1/targets \
-H "Authorization: Bearer $TOKEN"

To enumerate every defined tag, list the tag catalog:

Terminal window
curl https://mantis.example.com/api/v1/tags \
-H "Authorization: Bearer $TOKEN"
┌─────────────────────────────────────────────────────────────┐
│ Tag Usage Report │
├─────────────────────────────────────────────────────────────┤
│ │
│ Total tags: 24 │
│ Unique keys: 6 │
│ │
│ Usage by Key: │
│ ┌───────────────┬────────┬────────────────────────────┐ │
│ │ Key │ Values │ Resource Count │ │
│ ├───────────────┼────────┼────────────────────────────┤ │
│ │ environment │ 3 │ 36 targets │ │
│ │ team │ 5 │ 28 targets │ │
│ │ region │ 4 │ 36 targets │ │
│ │ compliance │ 3 │ 12 targets │ │
│ └───────────────┴────────┴────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

Document and enforce tag standards:

## Tag Standards
Required tags for all targets:
- environment: production | staging | development
- team: <team-name>
- region: <aws-region>
Optional tags:
- cost-center: <cost-code>
- compliance: pci | hipaa | soc2

Apply tags consistently across resources:

ResourceRequired Tags
All targetsenvironment, region
Production targets+ team, compliance
Tenant targets+ tenant (automatic)

Periodically audit tags:

  • Remove unused tags
  • Fix inconsistent naming
  • Update outdated values

Keep tags meaningful:

GoodAvoid
3-6 tags per resource15+ tags per resource
Standard key namesUnique keys per resource
Meaningful valuesRandom or encoded values

Cause: Typo in tag key or value

Solution:

  1. Check exact spelling (case-sensitive values)
  2. Verify tag exists on resources
  3. Use dropdown selectors instead of typing

Cause: Missing permission or tag already detached

Solution:

  1. Check that you have the right permission: tags:delete (detach from the shared vocabulary), targets:update (remove a tag from a target), or tenants:manage_tags (detach from a tenant)
  2. Verify the tag is still attached to the resource
  3. Contact your administrator if the permission is not granted

Cause: Tag not yet saved or sync delay

Solution:

  1. Refresh the page
  2. Verify tag was created successfully
  3. Wait for sync if using distributed setup