Grafana API: dashboards, alerts and annotations with AI agents
Grafana has an HTTP API to manage dashboards, folders, data sources, alerts, annotations and users. Engineering and operations teams use it to automate observability. Access is by a service account token created in Grafana.
What the Grafana API offers
Dashboards and folders
Create, update, search and version dashboards.
Data sources
Register and query connections to databases and metrics services.
Alerts
Manage alert rules, contact points and silences.
Annotations
Mark events such as deploys and incidents on graphs.
Queries
Run queries against the configured data sources.
Users and teams
Manage access and organizations.
How to access the Grafana API
- With your company’s credentialsA service account token created in Grafana, with a defined role, sent in the authorization header.
- Use the viewer role whenever the agent only reads.
- Silencing alerts can hide an incident: require approval.
- Heavy queries can overload the data sources.
Official documentation: grafana.com/docs/grafana/latest/developers/http_api
What an iTeam agent does with the Grafana API
Alert summary
When an alert fires, the agent checks the panels and posts a summary of what changed in Slack.
Deploy annotations
On every deploy, the agent creates an annotation to make impact analysis easier.
Silence during maintenance
The agent creates an alert silence for the approved maintenance window.
Weekly SLO report
The agent queries metrics and sends a summary of availability and latency.
From the credential to the agent at work, with approval
Service account
Create a service account in Grafana with the minimum role, such as viewer.
Vault and allowed actions
Store the token in the iTeam vault and allow writes only where needed, such as annotations.
Test with approval
Changes to alerts and dashboards go through human approval, with an audit trail.
Ready-made AI teams for this work
Questions about the Grafana API
Is the Grafana API free?
Open source Grafana does not charge for the API. On Grafana Cloud, usage follows the plan you have.
Do I need to write code to use the Grafana API with iTeam?
Not necessarily. iTeam's HTTP tool reads the API documentation and learns the endpoints, and the deployment team sets up credentials, permissions and tests with you.
Does the Grafana API work on Grafana Cloud?
Yes. The HTTP API exists on both self-hosted Grafana and Grafana Cloud, using a service account token.