Custom tags API - GET tags

Lists all custom tags assigned to the specified monitored entities. Automatically applied tags and imported tags are not included.

The request produces an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

  • Managed https://{your-domain}/e/{your-environment-id}/api/v2/tags
  • SaaS https://{your-environment-id}


To execute this request, you need the Read entities ( permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.


Parameter Type Description In Required
entitySelector string

Specifies the entities where you want to read tags.

You need to set one of these criteria:

  • Entity type: type("value").
  • Dynatrace entity ID: entityId("id"). You can specify several IDs, separated by a comma (entityId("id-1","id-2")).

And you can add one or several of the following criteria. Values are case-sensitive and the EQUALS operator is used unless otherwise specified.

  • Tag: tag("value"). Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. If a value-only tag has a colon (:) in it, you must escape the colon with a backslash(\). Otherwise, the tag will be parsed as a key:value tag. All tag values are case-sensitive.
  • Management zone ID: mzId("ID")
  • Management zone name: mzName("value").
  • Dynatrace entity name: entityName("value"). The CONTAINS operator is used and the value is NOT case-sensitive.
  • Health state (HEALTHY,UNHEALTHY): healthState("HEALTHY")

Further information can be found here. To set several criteria, separate them with a comma (,). For example, type("HOST"),healthState("HEALTHY"). Only results matching all criteria are included in response.

The length of the string is limited to 10,000 characters.

query optional


Response codes

Code Description


Response body

The CustomEntityTags object

A list of custom tags.

Element Type Description
tags METag[]

A list of custom tags.

totalCount integer

The total number of tags in the response.

The METag object

The tag of a monitored entity.

Element Type Description
stringRepresentation string

The string representation of the tag.

value string

The value of the tag.

key string

The key of the tag.

context string

The origin of the tag, such as AWS or Cloud Foundry.

Custom tags use the CONTEXTLESS value.


In this example, the request lists custom tags that are applied to services that belong to the management zones with the ID of 229130632296508575249. To achieve that, the entitySelector query parameter is set to type("SERVICE"),mzId("9130632296508575249").

The API token is passed in the Authorization header.

Because the full result is rather lengthy, it is truncated to three entries.


curl -L -X GET ',mzId(%229130632296508575249%22)' \
-H 'Authorization: Api-Token abcdefjhij1234567890'

Request URL,mzId(%229130632296508575249%22)

Response body

  "totalCount": 31,
  "tags": [
      "context": "CONTEXTLESS",
      "key": "Billing",
      "stringRepresentation": "Billing"
      "context": "CONTEXTLESS",
      "key": "Booking",
      "stringRepresentation": "Booking"
      "context": "CONTEXTLESS",
      "key": "easytravel",
      "value": "backend",
      "stringRepresentation": "easytravel:backend"

Response code