Documentation

Auto-Tagging

ZopNight predicts environment tags (prod, staging, dev) and a noStop flag for resources that are missing them. Predictions come from name patterns, existing tags, topology, and resource characteristics — not from an LLM — so they are reproducible and cheap to re-run.

Why this matters

Tag-based cost attribution, schedules, and recommendation rules all rely on consistent environment tagging. In practice most accounts have partial coverage — auto-tagging closes the gap so Showback and Schedules can rely on a full set of tags.

How predictions work

  1. Discoverer emits a resource event with name, tags, parent, and type.
  2. Recommender evaluates deterministic rules (e.g. name contains prod-, or parent EKS cluster is already tagged).
  3. Each prediction carries a confidence score (1–100) and a reason string.
  4. Predictions are never auto-applied — you accept or reject them.

Accepted predictions are merged with cloud tags when computing Showback, so a resource can be attributed to a team or tag key even when the cloud account owner hasn't tagged it yet.

List Suggestions

GET
/autotagging

List open auto-tagging suggestions with filters.

Query Parameters

ParameterDescription
providerFilter by cloud provider (aws, gcp, azure)
resource_typeFilter by resource type
statusopen, accepted, rejected (default: open)
min_confidenceOnly return suggestions with confidence >= this value
searchSearch by resource name or UID
pagePage number (default: 1)
limitItems per page (default: 20)
Responsejson
{
  "data": {
    "items": [
      {
        "id": "tag_001",
        "resourceUID": "i-0abc123def456",
        "resourceName": "prod-api-server",
        "resourceType": "aws-ec2",
        "provider": "aws",
        "predictedEnv": "prod",
        "predictedNoStop": true,
        "confidence": 92,
        "reason": "Name contains 'prod', has production cluster parent, runs 24/7",
        "status": "open",
        "createdAt": "2026-04-20T08:00:00Z"
      }
    ],
    "total": 15,
    "page": 1,
    "limit": 20
  }
}

Count Suggestions

GET
/autotagging/count

Total open suggestions for the org. Accepts the same filters as the list endpoint and is used to render the badge on the Auto-Tagging nav entry.

Responsejson
{
  "data": {
    "open": 15,
    "accepted": 84,
    "rejected": 12
  }
}

Accept or Reject

PATCH
/autotagging/{resourceUID}

Unified accept/reject endpoint. Pass the final verdict as status.

Request — Acceptbash
curl -X PATCH https://zopnight.com/api/autotagging/i-0abc123def456 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "accepted",
    "env": "prod",
    "noStop": true
  }'
Request — Rejectbash
curl -X PATCH https://zopnight.com/api/autotagging/i-0abc123def456 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "status": "rejected" }'

Legacy endpoints

POST /autotagging/accept and POST /autotagging/reject still work but are deprecated. Target removal: 2026-07-01. Please move to the PATCH endpoint.

Confidence Buckets

BucketRangeGuidance
High80–100Safe to accept in bulk — the signal is strong (name + parent + existing tags agree)
Medium50–79Review individually — a single signal drove the prediction
Low< 50Not shown in the UI by default; exposed only via min_confidence=0