This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.

Enterprise Open source Grafana Cloud

Grafana HTTP API reference guide

Every Grafana instance exposes an HTTP API, used by the Grafana frontend to manage resources like saving dashboards, creating users, updating data sources, deleting alerts, and more. You can use the HTTP API to programmatically access or manage resources from your Grafana instance.

If you need to manage or access other resources from your Grafana Cloud Stack, refer to the Grafana Cloud API instead.

New generation HTTP APIs

Grafana is deprecating legacy APIs (/api) in favor of a new generation of improved APIs (/apis) which follow a standardized API structure alongside consistent API versioning.

To learn more refer to:

The Grafana API specification

Grafana HTTP APIs comply both with the OpenAPI v2 specification (Swagger 2.0) and OpenAPI v3 specification. While both describe the exact same set of Grafana HTTP API routes (dashboards, folders, data sources, organizations, users, teams, RBAC, alerting provisioning…), v2 is the canonical specification and source of truth, and v3 is converted from the v2 file using a conversion script.

If you’re consuming a Grafana HTTP API:

  • Use v2 if your tooling (SDK generators, older Swagger UI, terraform-provider-grafana) expects Swagger 2.0.
  • Use v3 if your tooling requires OpenAPI 3.x (for example, newer codegen tools, some API gateways, Postman’s newer import features).

You can browse and try out both via the Swagger UI editor, served by the Grafana server, by navigating to /swagger.

Authentication

In OSS, you can authenticate your requests to the HTTP APIs using basic auth or a service account token. In Grafana Cloud, only the service account token option is available. For more details refer to HTTP API authentication.

List of available HTTP APIs

The following table lists all available HTTP APIs that comply with the new structure:

APIAvailabilityReplaces legacy API
Advisor HTTP APIAll editionsNo
Alert enrichment HTTP APICloud onlyNo
Alert notifications HTTP APIAll editionsThis API partially replaces /api/v1/provisioning/*
Alert rules HTTP APIAll editionsThis API partially replaces /api/v1/provisioning/*
Annotations HTTP APIAll editions/api/annotations/*
Banners HTTP API (Swagger)All editionsNo
Collections HTTP API (currently offers stars)All editions/api/user/stars/*
Dashboard HTTP API (also serves library panels, snapshots, search, notebooks, and global variables)All editions/api/dashboards/*
Folder HTTP APIAll editions/api/folders/*
Notebooks HTTP APIAll editionsNo
SLO (Swagger) / Kubernetes CRDCloud onlyNo
Playlist HTTP APIAll editionsNo
Preferences HTTP APIAll editions/api/*/preferences
Queries HTTP APIEnterprise and Cloud onlyThis API partially replaces /api/query-history/*
Resource history HTTP APIAll editions/api/dashboards/uid/:uid/versions/*
SCIM HTTP API (Swagger)Enterprise and Cloud onlyNo
Secrets Management HTTP APIEnterprise and Cloud onlyNo
Short URL HTTP APIAll editions/api/short-urls/*

Legacy APIs

The following table lists legacy APIs and their replacements, if any:

Use the following resources to keep working with Grafana APIs: