Everything an AI agent can do with the Grafana API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints41
API versionService account token
Last updated23 June 2026
Orientation

How the Grafana API works.

The Grafana API is how an app or AI agent works with a Grafana instance: reading and saving dashboards, organizing folders, managing data sources and alert rules, and adding annotations to charts. Access is granted through a service account token, and what each call can do is set by the organization role that token holds, Viewer, Editor, or Admin, plus any fine-grained permissions on top. There is no dated version of the API: it ships with each Grafana release, and alerting is how Grafana pushes a notification out when a rule fires.

41Endpoints
10Capability groups
19Read
22Write
29Permissions
Authentication
Requests authenticate with a service account token sent as 'Authorization: Bearer '. A service account is created inside one organization, given an organization role, and issued one or more long-lived tokens. Basic authentication with a username and password also works, and a few server-wide endpoints, such as the global Users API and creating organizations, require a Grafana server administrator and cannot be reached by a service account, because a service account is scoped to a single organization.
Permissions
Every method maps to a fine-grained RBAC action, such as dashboards:read, dashboards:write, datasources:create, alert.provisioning:write, or annotations:delete, paired with a scope that narrows it to specific resources, such as dashboards:uid:abc. In Grafana open source the action a token can perform follows its organization role: Viewer reads, Editor reads and writes most content, Admin manages the organization. Assigning individual RBAC actions and custom roles for least-privilege access is a Grafana Enterprise and Grafana Cloud feature.
Versioning
The HTTP API carries no dated version string and is not separately versioned. It is part of Grafana itself, so the methods an instance exposes are the ones in the Grafana version it runs. Notable changes arrive through the Grafana release notes and changelog with each release. From Grafana 13 onward, dashboards and folders are also reachable through newer app-platform routes under /apis, while the stable /api routes documented here continue to work.
Data model
The API is resource-oriented JSON over HTTPS, served by the Grafana instance itself rather than a central host, so the base URL is the instance address, such as https://play.grafana.org. Dashboards and folders are identified by a stable uid, and a dashboard is saved as a single JSON model through one create-or-update endpoint. Most resources are scoped to one organization; a server administrator manages users and organizations across the whole instance.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Grafana determines what it can reach. There are a few routes, each governed by the service account token behind it, the organization role that token carries, and any fine-grained permissions on top.

Ways to connect

HTTP API

The HTTP API is served by the Grafana instance itself, so its base URL is the instance address, such as https://play.grafana.org. It is JSON over HTTPS and authenticates with a service account token in an Authorization header.

Best forConnecting an app or AI agent to Grafana.
Governed byThe service account token, its organization role, and any fine-grained permissions.
Docs ↗

MCP server (Model Context Protocol)

Grafana publishes a first-party MCP server, grafana/mcp-grafana, that lets an agent call Grafana through the Model Context Protocol. It exposes tools for dashboards, data sources and querying, alerting, annotations, incidents, and more, and authenticates with a Grafana service account token. The source is at github.com/grafana/mcp-grafana under the Apache 2.0 license, and it needs Grafana 9.0 or later.

Best forConnecting an app or AI agent to Grafana.
Governed byThe service account token, its organization role, and any fine-grained permissions.
Docs ↗

Alerting contact points

Grafana has no generic change webhook. Its push route is alerting: an alert rule fires, a notification policy routes it, and a contact point delivers to a receiver such as a webhook URL, email, Slack, or PagerDuty. Provisioned through the alerting API under /api/v1/provisioning.

Best forReceiving a notification when a Grafana alert rule fires.
Governed byThe service account token and the alert.provisioning permissions.
Docs ↗
Authentication

Service account token

A service account is created inside one organization and given an organization role, then issued one or more long-lived tokens. Each request sends the token as 'Authorization: Bearer '. This is the recommended credential for an app or AI agent, and it replaced the deprecated API keys.

TokenService account token (Bearer)
Best forMachine and agent access within one organization
Docs ↗

Basic authentication

A Grafana username and password can authenticate API requests directly. The server-administrator endpoints, such as the global Users API and creating organizations, require basic auth as a server admin and cannot be reached by a service account token.

TokenUsername and password
Best forServer-administrator endpoints and simple scripts
Docs ↗
Capability map

What an AI agent can do in Grafana.

The Grafana API is split into areas an agent can act on, such as dashboards, folders, data sources, alerting, and the people and organizations behind them. Each area has its own methods and its own permission actions, and some grant access to far more than others.

Dashboards

4 endpoints

Save and read dashboards by their stable uid, get the home dashboard, and delete a dashboard. A dashboard is one JSON model saved through a single create-or-update endpoint.

Writes here create, overwrite, or delete real dashboards.
View endpoints

Folders

5 endpoints

List folders, read one by uid, and create, update, or delete a folder. Deleting a folder also removes the dashboards and alerts inside it.

Deleting a folder removes its dashboards and alerts too.
View endpoints

Data sources

5 endpoints

List data sources, read one by uid, and create, update, or delete a data source connection.

Writes here change how Grafana connects to backend databases.
View endpoints

Alerting

8 endpoints

Read and provision alert rules, and read and manage contact points and the notification policy tree that routes a firing alert to them.

Writes here change which alerts fire and where notifications go.
View endpoints

Annotations

4 endpoints

Find, create, update, and delete annotations, the time-stamped event markers shown on dashboard panels.

Writes here add or remove event markers on dashboards.
View endpoints

Search

1 endpoint

Search dashboards and folders by text, tag, and type, returning only those the token can see.

Read-only listing of dashboards and folders.
View endpoints

Service accounts

4 endpoints

Search and read service accounts, create and update them, delete them, and issue or revoke their long-lived tokens.

Writes here mint or revoke credentials that call the API.
View endpoints

Users

3 endpoints

Read the current user, search the global user directory, and read a single user by id. The global directory requires a server administrator.

The global directory exposes every user on the instance.
View endpoints

Teams

3 endpoints

Search and read teams, create, update, and delete a team, and list or change its members.

Writes here change team membership and access.
View endpoints

Organizations

4 endpoints

Read and update the current organization and its members, and, for a server administrator, manage organizations across the instance.

Writes here change organization settings and membership.
View endpoints
Endpoint reference

Every Grafana API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Dashboards

Save and read dashboards by their stable uid, get the home dashboard, and delete a dashboard. A dashboard is one JSON model saved through a single create-or-update endpoint.4

One endpoint both creates and updates: omit a uid to create, send a known uid and version to update. A stale version returns 412 unless overwrite is true. Scope narrows to dashboards:uid: or a folder.

Acts ondashboard
Permission (capability)dashboards:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Scope can narrow to a single dashboard as dashboards:uid:.

Acts ondashboard
Permission (capability)dashboards:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Scope can narrow to dashboards:uid:.

Acts ondashboard
Permission (capability)dashboards:delete
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Returns the configured home dashboard, falling back to the built-in default.

Acts ondashboard
Permission (capability)dashboards:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Folders

List folders, read one by uid, and create, update, or delete a folder. Deleting a folder also removes the dashboards and alerts inside it.5

Scope folders:* covers all folders; it can narrow to folders:uid:.

Acts onfolder
Permission (capability)folders:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Scope can narrow to folders:uid:.

Acts onfolder
Permission (capability)folders:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Creating a folder uses folders:create; later writes to it use folders:write.

Acts onfolder
Permission (capability)folders:create
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Scope can narrow to folders:uid:.

Acts onfolder
Permission (capability)folders:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

This cascades: deleting the folder removes its dashboards and alert rules too. Scope can narrow to folders:uid:.

Acts onfolder
Permission (capability)folders:delete
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Data sources

List data sources, read one by uid, and create, update, or delete a data source connection.5

Returns up to 5000 by default. Scope can narrow to datasources:uid:.

Acts ondata source
Permission (capability)datasources:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Secret fields such as passwords are not returned. Scope can narrow to datasources:uid:.

Acts ondata source
Permission (capability)datasources:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

The request can include credentials for the backend database in secureJsonData.

Acts ondata source
Permission (capability)datasources:create
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Scope can narrow to datasources:uid:.

Acts ondata source
Permission (capability)datasources:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Scope can narrow to datasources:uid:.

Acts ondata source
Permission (capability)datasources:delete
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Alerting

Read and provision alert rules, and read and manage contact points and the notification policy tree that routes a firing alert to them.8

Covers the Grafana-managed alerting rules under provisioning.

Acts onalert rule
Permission (capability)alert.provisioning:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Acts onalert rule
Permission (capability)alert.provisioning:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A provisioned rule defines the query, condition, and the folder it lives in.

Acts onalert rule
Permission (capability)alert.provisioning:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Acts onalert rule
Permission (capability)alert.provisioning:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Acts onalert rule
Permission (capability)alert.provisioning:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A contact point is the push target, such as a webhook URL, email, Slack, or PagerDuty.

Acts oncontact point
Permission (capability)alert.provisioning:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

This is how an integration registers where a firing alert is delivered.

Acts oncontact point
Permission (capability)alert.provisioning:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

The policy tree decides which contact point each alert reaches by its labels.

Acts onnotification policy
Permission (capability)alert.provisioning:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Annotations

Find, create, update, and delete annotations, the time-stamped event markers shown on dashboard panels.4

Acts onannotation
Permission (capability)annotations:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

An organization annotation uses a different RBAC scope from a dashboard-scoped one.

Acts onannotation
Permission (capability)annotations:create
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A PATCH on the same path updates only the fields supplied.

Acts onannotation
Permission (capability)annotations:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Acts onannotation
Permission (capability)annotations:delete
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
Search dashboards and folders by text, tag, and type, returning only those the token can see.1

Returns only items the token can see. Defaults to 1000 results, caps at 5000, paged by the page parameter.

Acts onsearch result
Permission (capability)dashboards:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Service accounts

Search and read service accounts, create and update them, delete them, and issue or revoke their long-lived tokens.4

Acts onservice account
Permission (capability)serviceaccounts:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A service account is the identity behind machine and agent access.

Acts onservice account
Permission (capability)serviceaccounts:create
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

The token is returned once in the key field and cannot be retrieved again. This mints a credential that can call the API.

Acts onservice account
Permission (capability)serviceaccounts:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Deleting the account revokes every token issued for it.

Acts onservice account
Permission (capability)serviceaccounts:delete
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Users

Read the current user, search the global user directory, and read a single user by id. The global directory requires a server administrator.3

Returns the signed-in user behind the credential and needs no special action.

Acts onuser
Permission (capability)None required
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

This global directory requires a Grafana server administrator and cannot be reached by a service account, which is scoped to one organization.

Acts onuser
Permission (capability)users:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Requires a server administrator, as with the global user search.

Acts onuser
Permission (capability)users:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Teams

Search and read teams, create, update, and delete a team, and list or change its members.3

Acts onteam
Permission (capability)teams:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Acts onteam
Permission (capability)teams:create
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Managing membership uses the teams.permissions actions, distinct from teams:write on the team itself.

Acts onteam
Permission (capability)teams.permissions:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Organizations

Read and update the current organization and its members, and, for a server administrator, manage organizations across the instance.4

Acts onorganization
Permission (capability)orgs:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Acts onorganization
Permission (capability)orgs:write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Org membership uses the org.users actions, separate from the global users actions.

Acts onorganization
Permission (capability)org.users:read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Acts onorganization
Permission (capability)org.users:add
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

Grafana does not push events to a generic webhook for API changes. Its push mechanism is alerting: a contact point sends a notification to a receiver, such as a webhook URL, email, Slack, or PagerDuty, when an alert rule fires.

EventWhat it signalsTriggered by
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Grafana itself sets no fixed request quota on the HTTP API. How fast and how much an app or AI agent can call depends on the deployment, since a self-hosted instance, a reverse proxy, or Grafana Cloud each apply their own limits.

Request rate

Grafana does not document a fixed request-per-minute quota on its HTTP API. How fast an app or AI agent can call is set by the deployment rather than the API: a self-hosted instance is bounded by its own capacity, an operator may put a reverse proxy or gateway in front that enforces limits and returns 429 Too Many Requests when exceeded, and Grafana Cloud applies its own platform limits. Treat throughput as deployment-dependent, back off on a 429, and avoid tight polling loops against a shared instance.

Pagination

List endpoints that can return many rows use page-based pagination through a page parameter that starts at 1 and a perpage or limit parameter for page size. The dashboard and folder search at /api/search defaults to 1000 results per page and caps at 5000, and the data source list returns up to 5000 by default. Smaller, fixed collections are returned in full without paging.

Request size

Requests and responses are JSON. A dashboard uid is at most 40 characters. There is no single documented maximum body size across the API; a very large dashboard JSON model is the main case to watch, and an operator's reverse proxy may impose its own request-size ceiling.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
400Bad RequestThe request body or parameters are malformed or fail validation, such as a dashboard JSON model that is invalid or a missing required field.Correct the request body or parameters against the endpoint's documented shape and resend.
401UnauthorizedAuthentication is missing or invalid: no token, an expired or revoked service account token, or wrong basic-auth credentials.Send a valid service account token in the Authorization header, or correct the username and password.
403ForbiddenThe caller is authenticated but its role or permissions do not allow the action, for example an Editor token trying to manage organization users, or a service account reaching a server-administrator endpoint.Grant the service account the required role or RBAC action, or use a server-administrator credential where the endpoint demands one.
404Not FoundThe resource does not exist, such as a dashboard, folder, data source, or alert rule uid that is unknown in this organization.Confirm the uid or id and that it belongs to the organization the token is scoped to.
409ConflictThe request conflicts with the current state, such as creating a resource whose name or uid already exists.Use a different name or uid, or update the existing resource instead of creating a new one.
412Precondition FailedA dashboard save lost a version race: the stored version is newer than the one being saved, or another dashboard already has the same title in the folder.Re-read the current dashboard, reapply the change on the latest version, and save again, or set overwrite to true to force the save.
429Too Many RequestsA rate limit was hit. Grafana itself sets no fixed quota, so a 429 comes from the deployment, such as a reverse proxy in front of the instance or a Grafana Cloud platform limit.Back off and retry after a delay, and reduce polling against a shared instance.
Versioning & freshness

Version history.

The Grafana HTTP API has no dated version string. It ships with each Grafana release, so the API an instance exposes tracks the Grafana version it runs, and changes arrive through the Grafana release notes.

Version history

What changed, and when

Latest versionService account token
Service account tokenCurrent version
Unversioned, shipped with each Grafana release

The Grafana HTTP API has no dated version string. It is part of Grafana and changes with each release, so the methods an instance exposes track the Grafana version it runs. Authentication is by service account token. The entries below are notable dated changes from the Grafana release notes, newest first.

What changed
  • From Grafana 13, dashboards and folders are reachable through newer app-platform routes under /apis (such as dashboard.grafana.app and folder.grafana.app), alongside the stable /api routes
  • Service account tokens are the standard credential; the older /api/auth/keys API keys are deprecated in favor of them
  • Alerting provisioning lives under /api/v1/provisioning for alert rules, contact points, and notification policies
2023-05-22Feature update
Grafana 10: service accounts replace API keys

Grafana 10 made service accounts the recommended way to authenticate to the API, with API keys marked for removal. A service account holds an organization role and issues long-lived tokens, and existing API keys can be migrated to service account tokens. Released 22 May 2023.

What changed
  • Service accounts and their tokens became the standard machine credential for the HTTP API
  • Legacy API keys deprecated, with migration to service account tokens

An integration pins to a Grafana version by the instance it points at, and moves up when that instance is upgraded.

Grafana changelog ↗
Questions

Grafana API, answered.

How does an agent authenticate to the Grafana API?+
With a service account token. A service account is created inside an organization and given a role, then one or more tokens are issued for it, and each request sends the token as 'Authorization: Bearer '. Service account tokens replaced the older API keys, which are deprecated. Basic authentication with a username and password also works and is what the server-administrator endpoints expect.
What can a service account token do, and how is that limited?+
It can do whatever its organization role and permissions allow within the one organization it belongs to. In Grafana open source the role is the control: a Viewer token reads, an Editor token reads and writes most content, and an Admin token manages the organization. Grafana Enterprise and Grafana Cloud add fine-grained RBAC, so individual actions like dashboards:write or datasources:read can be granted on specific resources for least-privilege access. A service account cannot reach the server-wide Users or Organizations admin endpoints, because it is scoped to a single organization.
What are the rate limits?+
Grafana sets no fixed quota on the HTTP API itself. Throughput depends on the deployment: a self-hosted instance is limited by its own capacity, an operator may run a reverse proxy or gateway that enforces request limits and returns 429 Too Many Requests, and Grafana Cloud applies its own platform limits. The safe approach is to back off when a 429 is returned and avoid tight polling against a shared instance.
How does an agent receive events from Grafana?+
Grafana has no generic webhook that fires on API changes like a dashboard edit. Its push mechanism is alerting. An alert rule evaluates a query, and when it fires, the notification policy routes it to a contact point, which sends to a receiver such as a webhook URL, email, Slack, or PagerDuty. To be notified of something in Grafana, an agent defines an alert rule and a contact point rather than subscribing to a change feed.
Why did saving a dashboard return a 412?+
A 412 Precondition Failed on a dashboard save means a version conflict: the dashboard was changed by someone else since it was read, so its version number is now higher than the one being sent, or another dashboard already has the same title in that folder. The fix is to re-read the current dashboard, reapply the change on top of the latest version, and save again, or set overwrite to true to force the save and discard the other change.
Does the Grafana API have versions to pin?+
Not as a dated string. The HTTP API ships with Grafana itself, so the version an instance exposes is the Grafana version it runs, and an integration effectively pins by pointing at an instance on a known release. Changes arrive through the Grafana release notes. From Grafana 13, dashboards and folders also have newer app-platform routes under /apis, while the stable /api routes keep working.
Related

More developer API guides for agents

What is Bollard AI?

Control what every AI agent can do in Grafana.

Bollard AI sits between a team's AI agents and Grafana. Grant each agent exactly the access it needs, read or write, area by area, and every call is checked and logged.

  • Set read, write, or full access per agent, never a shared Grafana service account token.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Grafana
Ops Agent
Read dashboards ResourceOffReadFull use
Manage alert rules ActionOffReadFull use
Edit data sources ResourceOffReadFull use
Per-agent access, set in Bollard AI, not in Grafana