Reports API - POST a report

Creates a new report.

The request consumes and produces an application/json payload.

Early Adopter

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

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/reports
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/reports

Parameters

Parameter Type Description In Required
body DashboardReport

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

body optional

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.

Element Type Description Required
id string

The ID of the report.

optional
type string The type element can hold these values. required
dashboardId string

The ID of the associated dashboard.

required
enabled boolean

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

optional
subscriptions DashboardReportSubscription required

The DashboardReportSubscription object

A list of the report subscribers.

Element Type Description Required
WEEK string[]

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
MONTH string[]

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

Possible values

Possible values for the type element in the DashboardReport object:

  • DASHBOARD

Response format

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

Element Type Description
id string

The ID of the Dynatrace entity.

name string

The name of the Dynatrace entity.

description string

A short description of the Dynatrace entity.

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.

Early Adopter

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

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/reports/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/reports/validator

Response codes

Code Description
204 Validated. The submitted report is valid. The response doesn't have a body.
400 Failed. The input is invalid.

Example

In this example, the request creates a new report for the dashboard with the ID of 2768e6ca-e199-4433-9e0d-2922aec2099b.

The report is sent weekly to Dynatrace user john.smith and monthly to Dynatrace user jane.brown.

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 that are available in your environment.

Curl

curl -X POST \
  https://mySampleEnv.live.dynatrace.com/api/config/v1/reports \
  -H 'Accept: application/json' \  
  -H 'Authorization: Api-token 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

https://mySampleEnv.live.dynatrace.com/api/config/v1/reports

Request body

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

Response body

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

Response code

204