Enterprise Open source Grafana Cloud

Data source API

Note

Starting in Grafana 13, /api endpoints are being deprecated in favor of the /apis route. Note that while Grafana is working on migrating existing APIs, currently there may not be an exact match to the legacy API you’re using.

This change doesn’t disrupt or break your current setup. Legacy APIs are not being disabled and remain fully accessible and operative, but /api routes will no longer be updated.

To learn more refer to the new API structure in Grafana.

Requirements

If you are running Grafana Enterprise, for some endpoints you’ll need to have specific permissions. Refer to Role-based access control permissions for more information.

Endpoints

MethodURISummary
GET/api/datasourcesGet all data sources
GET/api/datasources/uid/:uidGet a single data source by uid
GET/api/datasources/name/:nameGet a single data source by name (deprecated)
GET/api/datasources/id/:nameGet data source Id by name (deprecated)
POST/api/datasourcesCreate a data source
PUT/api/datasources/uid/:uidUpdate an existing data source
DELETE/api/datasources/uid/:uid