• Home
  • Dynatrace API
  • Configuration
  • RUM
  • Applications detection
  • PUT a rule

Applications detection rules API - PUT a rule

Updates the specified application detection rule.

If the application detection rule with the specified ID doesn't exist, a new rule is created and appended to the end of the rule list.

If the order parameter is set for an existing rule, the request uses this value. Otherwise, it keeps the existing order of rules.

The request consumes and produces an application/json payload.

PUTManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/config/v1/applicationDetectionRules/{id}
SaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/applicationDetectionRules/{id}
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/applicationDetectionRules/{id}

Authentication

To execute this request, you need an access token with WriteConfig scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
idstring

The ID of the application detection rule to be updated.

If you set the ID in the body as well, it must match this ID.

pathrequired
bodyApplicationDetectionRuleConfig

The JSON body of the request. Contains updated parameters of the application detection rule.

If the order parameter is set, the rule is placed to this position.

bodyoptional

Request body objects

The ApplicationDetectionRuleConfig object

Application detection rule.

ElementTypeDescriptionRequired
metadataConfigurationMetadataDtoImpl

Metadata useful for debugging.

optional
idstring

The ID of the rule.

optional
orderstring

The order of the rule in the rules list.

The rules are evaluated from top to bottom. The first matching rule applies.

optional
applicationIdentifierstring

The Dynatrace entity ID of the application, for example APPLICATION-4A3B43.

You must use an existing ID. If you need to create a rule for an application that doesn't exist yet, create an application first and then configure detection rules for it.

required
filterConfigApplicationFilter

The condition of an application detection rule.

required
namestring

The unique name of the Application detection rule.

optional

The ConfigurationMetadataDtoImpl object

Metadata useful for debugging.

ElementTypeDescriptionRequired
currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

optional
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

optional
clusterVersionstring

Dynatrace version.

optional

The ApplicationFilter object

The condition of an application detection rule.

ElementTypeDescriptionRequired
patternstring

The value to look for.

required
applicationMatchTypestring

The operator of the matching.

The element can hold these values
  • BEGINS_WITH
  • CONTAINS
  • ENDS_WITH
  • EQUALS
  • MATCHES
required
applicationMatchTargetstring

Where to look for the the pattern value.

The element can hold these values
  • DOMAIN
  • URL
required

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

json
{ "metadata": { "configurationVersions": [ 4, 2 ], "clusterVersion": "Mock version" }, "id": "12345678-abcd-1234-abcd-1234567890ab", "applicationIdentifier": "APPLICATION-123456", "name": "uniqueName", "filterConfig": { "pattern": "myapp.example.com", "applicationMatchType": "EQUALS", "applicationMatchTarget": "DOMAIN" } }

Response

Response codes

CodeTypeDescription
201EntityShortRepresentation

Success. Application detection rule has been created. Response contains the ID of the new rule.

204

Success. Application detection rule has been updated. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid.

Response body objects

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

ElementTypeDescription
idstring

The ID of the Dynatrace entity.

namestring

The name of the Dynatrace entity.

descriptionstring

A short description of the Dynatrace entity.

Response body JSON model

json
{ "id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a", "name": "Dynatrace entity", "description": "Dynatrace entity for the REST API example" }

Validate payload

We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.

The request consumes an application/json payload.

POSTManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/config/v1/applicationDetectionRules/{id}/validator
SaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/applicationDetectionRules/{id}/validator
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/applicationDetectionRules/{id}/validator

Authentication

To execute this request, you need an access token with WriteConfig scope.

To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

CodeTypeDescription
204

Validated. The submitted configuration is valid. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid.

Example

In this example, the request updates the application detection rule from the POST request example. It changes the order of the rule to position two and changes the condition of the rule to the domain that contains the booking.easyTravel pattern.

The API token is passed in the Authorization header.

The request body is truncated in the Curl section. See the Request body section for the full body. You can download or copy the example request body to try it out on your own. Be sure to use an application ID that is available in your environment.

Curl

bash
curl -X PUT \ https://mySampleEnv.live.dynatrace.com/api/config/v1/applicationDetectionRules/9568a82b-73d8-4b18-be1a-4289433e2619 \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \ -H 'Content-Type: application/json' \ -d '{ <truncated - see the Request body section > }'

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/config/v1/applicationDetectionRules/9568a82b-73d8-4b18-be1a-4289433e2619

Request body

json
{ "id": "9568a82b-73d8-4b18-be1a-4289433e2619", "applicationIdentifier": "APPLICATION-900C1E36674F607D", "order": 2, "filterConfig": { "pattern": "booking.easyTravel", "applicationMatchType": "BEGINS_WITH", "applicationMatchTarget": "DOMAIN" } }

Response code

204

Related topics
  • Real User Monitoring

    Learn about Real User Monitoring, key performance metrics, mobile app monitoring, and more.

  • Check application detection rules

    Easily understand the detection rules of your RUM application.

  • Define applications for Real User Monitoring

    Learn how to define your applications following the suggested, manual, application detection rules, or browser extension approach.