grafana/docs/sources/http_api/reporting.md
Christopher Moyer a20b3e2d59
Docs: Fine-grained access control refactor (#47536)
* fleshing out About topic

* docs, fgac refactor initial draft

* updated FGAC with service account details

* finalized restructure

* make prettier, corrects spelling

* fixes typo

* adds rollout strategy topic

* started name change

* renamed to rbac throughout docs

* copy edit to about and actions and scopes docs

* finishes content reorg

* draft of refactored refactored docs

* corrects relrefs

* formatting tweaks

* fixes typo

* copy updates to about rbac

* rbac rollout docs edits

* update rbac role assignment docs

* content update to manage rbac roles doc

* sort and reorder roles reference in rbac docs

* alphabetize permissions table

* Update docs/sources/enterprise/settings-updates.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* incorporates feedback, makes prettier

* update http api references in rbac docs

* fix broken refs and improve wording on enabling RBAC provisioning

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: Mitchel Seaman <mitchel.seaman@gmail.com>
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
2022-04-27 09:51:56 -05:00

3.5 KiB

+++ title = "Reporting API" description = "Grafana Enterprise APIs" keywords = ["grafana", "enterprise", "api", "reporting"] aliases = ["/docs/grafana/latest/http_api/reporting/"] +++

Reporting API

This API allows you to interact programmatically with the [Reporting]({{< relref "../enterprise/reporting.md" >}}) feature.

Reporting is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "../enterprise" >}}).

If you have [Role-based access control]({{< relref "../enterprise/access-control/_index.md" >}}) 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]({{< ref "#reporting-api" >}}) for an explanation.

Action Scope
reports:send n/a

Example request

POST /api/reports/email HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

{
  "id":"3",
  "useEmailsFromReport": true
}

JSON Body Schema

Field name Data type Description
id string ID 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.
emails string Comma-separated list of emails to which to send the report to. Overrides the emails from the report. Required if useEmailsFromReport is not present.
useEmailsFromReport boolean Send the report to the emails specified in the report. Required if emails is not present.

Example response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 29

{"message":"Report was sent"}

Status Codes

Code Description
200 Report was sent.
400 Bad request (invalid json, missing content-type, missing or invalid fields, etc.).
401 Authentication failed, refer to [Authentication API]({{< relref "../http_api/auth.md" >}}).
403 User is authenticated but is not authorized to generate the report.
404 Report not found.
500 Unexpected error or server misconfiguration. Refer to server logs for more details.