Web application configuration API - PUT data privacy of the default application

Updates the data privacy parameters of the default web application of your Dynatrace environment.

The request consumes an application/json payload.

PUT
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/applications/web/default/dataPrivacy
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/applications/web/default/dataPrivacy
  • Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/applications/web/default/dataPrivacy

Authentication

To execute this request, you need the Change data privacy settings (DataPrivacy) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.

Parameters

Parameter Type Description In Required
body ApplicationDataPrivacy

JSON body of the request, containing new data privacy settings.

body optional

Body format

The ApplicationDataPrivacy object

Data privacy settings of the application.

Element Type Description Required
dataCaptureOptInEnabled boolean

Set to true to disable data capture and cookies until JavaScriptAPI dtrum.enable() is called.

required
persistentCookieForUserTracking boolean

Set to true to set persistent cookie in order to recognize returning devices.

required
doNotTrackBehaviour string

How to handle the "Do Not Track" header:

  • IGNORE_DO_NOT_TRACK: ignore the header and capture the data.
  • CAPTURE_ANONYMIZED: capture the data but do not tie it to the user.
  • DO_NOT_CAPTURE: respect the header and do not capture.
required
sessionReplayDataPrivacy SessionReplayDataPrivacySettings optional

The SessionReplayDataPrivacySettings object

Data privacy settings for Session Replay.

Element Type Description Required
optInModeEnabled boolean

If true, session recording is disabled until JavaScriptAPI dtrum.enableSessionReplay() is called.

optional
urlExclusionRules string[]

A list of URLs to be excluded from recording.

optional
contentMaskingSettings SessionReplayContentMaskingSettings optional

The SessionReplayContentMaskingSettings object

Content masking settings for Session Replay.

For more details, see Configure Session Replay in Dynatrace Documentation.

Element Type Description Required
recordingMaskingSettingsVersion integer

The version of the content masking.

You can use this API only with the version 2.

If you're using version 1, set this field to 2 in the PUT request to switch to version 2.

required
recordingMaskingSettings SessionReplayMaskingSetting optional
playbackMaskingSettings SessionReplayMaskingSetting optional

The SessionReplayMaskingSetting object

Configuration of the Session Replay masking.

Element Type Description Required
maskingPreset string

The type of the masking:

  • MASK_ALL: Mask all texts, user input, and images.
  • MASK_USER_INPUT: Mask all data that is provided through user input
  • ALLOW_LIST: Only elements, specified in maskingRules are shown, everything else is masked.
  • BLOCK_LIST: Elements, specified in maskingRules are masked, everything else is shown.
required
maskingRules MaskingRule[]

A list of masking rules.

optional

The MaskingRule object

The masking rule defining how data is hidden.

Element Type Description Required
maskingRuleType string

The type of the masking rule.

required
selector string

The selector for the element or the attribute to be masked.

Specify a CSS expression for an element or a regular expression for an attribute.

required
userInteractionHidden boolean

Interactions with the element are (true) or are not (`false) masked.

required

Response

Response codes

Code Description
204

Success. Data privacy settings have been updated. Response doesn't have a body.

400

Failed. The input is invalid.

Response body

A successful request doesn't return any content.

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.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/applications/web/default/dataPrivacy/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/applications/web/default/dataPrivacy/validator
  • Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/applications/web/default/dataPrivacy/validator

Authentication

To execute this request, you need the Change data privacy settings (DataPrivacy) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

Code Description
204

Validated. The submitted configuration is valid. Response does not have a body.

400

Failed. The input is invalid.

Response body

A successful request doesn't return any content.