• Home
  • Dynatrace API
  • Configuration
  • Reports
  • PUT a report

Reports API - PUT a report

Updates the specified report. If a report with the specified ID doesn't exist, a new one is created.

The request consumes and produces an application/json payload.

PUTManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/config/v1/reports/{id}
SaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/reports/{id}
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/reports/{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 report to be updated.

The ID in the request body must match this ID.

pathrequired
bodyDashboardReport

The JSON body of the request. Contains updated parameters of the report.

bodyoptional

Request body objects

The DashboardReport object

Configuration of a dashboard report.

The dashboard report provides a public link to the associated dashboard with a custom reporting period: last week for weekly subscribers or last month for monthly subscribers.

ElementTypeDescriptionRequired
idstring

The ID of the report.

optional
typestring-
The element can hold these values
  • DASHBOARD
required
dashboardIdstring

The ID of the associated dashboard.

required
enabledboolean

The email notifications for the dashboard report are enabled (true) or disabled (false).

optional
subscriptionsDashboardReportSubscription

A list of the report subscribers.

required

The DashboardReportSubscription object

A list of the report subscribers.

ElementTypeDescriptionRequired
WEEKstring[]

A list of weekly subscribers.

Weekly subscribers receive the report every Monday at midnight.

You can specify email addresses or Dynatrace user IDs here.

optional
MONTHstring[]

A list of monthly subscribers.

Monthly subscribers receive the report on the first Monday of the month at midnight.

You can specify email addresses or Dynatrace user IDs here.

optional

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
{ "id": "337d883e-98c3-4dac-b8f2-1a9cdbd05969", "type": "DASHBOARD", "dashboardId": "8dd67562-8bf5-4a09-830d-4e0ca992abd6", "enabled": "true", "subscriptions": { "WEEK": [ "demo@email.com" ], "MONTH": [ "demo@email.com", "demo2@email.com" ] } }

Response

Response codes

CodeTypeDescription
201EntityShortRepresentation

Success. The new report has been created. The response contains the ID of the new report.

204

Success. The report 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/reports/{id}/validator
SaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/reports/{id}/validator
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/reports/{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 report is valid. Response doesn't have a body

400ErrorEnvelope

Failed. The input is invalid.

Example

In this example, the request updates the report from the POST request example. It adds the following subscribers:

  • Weekly for operations@organization.com address.
  • Monthly for cto@organization.com address.

Note that all existing subscribers must be present in the request body. Existing subscribers not present in the request body are removed.

The API token is passed in the Authorization header.

You can download or copy the example request body to try it out on your own. Be sure to use the dashboard ID and user IDs that are available in your environment

Curl

bash
curl -X PUT \ https://mySampleEnv.live.dynatrace.com/api/config/v1/reports/f78f78f5-00bd-4cc1-9e8b-ecfd1e379a73 \ -H 'Accept: application/json' \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \ -H 'Content-Type: application/json' \ -d '{ "type": "DASHBOARD", "dashboardId": "2768e6ca-e199-4433-9e0d-2922aec2099b", "enabled": "true", "subscriptions": { "WEEK": [ "john.smith" ], "MONTH": [ "jane.brown" ] } } '

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/config/v1/reports/f78f78f5-00bd-4cc1-9e8b-ecfd1e379a73

Request body

json
{ "type": "DASHBOARD", "dashboardId": "2768e6ca-e199-4433-9e0d-2922aec2099b", "enabled": "true", "subscriptions": { "WEEK": ["john.smith"], "MONTH": ["jane.brown"] } }

Response body

json
{ "id": "f78f78f5-00bd-4cc1-9e8b-ecfd1e379a73" }

Response code

201

Related topics
  • Subscribe to Dynatrace dashboard reports

    Learn how to subscribe to reports generated from Dynatrace dashboards.