Reporting API

This API allows you to interact programmatically with the Reporting feature.

Reporting is only available in Grafana Enterprise. Read more about Grafana Enterprise.

If you have Fine-grained access Control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.

Send a report

Only available in Grafana Enterprise v7.0+.

This API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.

POST /api/reports/email

Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds.

Required permissions

See note in the introduction for an explanation.

ActionScope
reports:sendn/a

Example request

  1. POST /api/reports/email HTTP/1.1
  2. Accept: application/json
  3. Content-Type: application/json
  4. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
  5. {
  6. "id":"3",
  7. "useEmailsFromReport": true
  8. }

JSON Body Schema

Field nameData typeDescription
idstringID of the report to send. It is the same as in the URL when editing a report, not to be confused with the ID of the dashboard. Required.
emailsstringComma-separated list of emails to which to send the report to. Overrides the emails from the report. Required if useEmailsFromReport is not present.
useEmailsFromReportbooleanSend the report to the emails specified in the report. Required if emails is not present.

Example response

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: 29
  4. {"message":"Report was sent"}

Status Codes

CodeDescription
200Report was sent.
400Bad request (invalid json, missing content-type, missing or invalid fields, etc.).
401Authentication failed, refer to Authentication API.
403User is authenticated but is not authorized to generate the report.
404Report not found.
500Unexpected error or server misconfiguration. Refer to server logs for more details.