Our next-gen architecture is built to help you make sense of your ever-growing data Watch a 4-min demo video!

Back to All Integrations

Grafana API Grafana API

Last Updated: Dec. 12, 2022

Coralogix provides a secure Grafana API for creating, editing, exporting, importing, querying, and other Grafana API operations. Through Grafana APIs, you can manage your hosted Grafana dashboards.

Prerequisites

In order to use the Grafana API to query your dashboard, first locate your:

  • Logs Query Key. You can find your key in the Coralogix UI under Data Flow –> API Keys.
  • Coralogix Domain. You can find your Domain here.

HTTP request for your Hosted Grafana

The Logs Query Key should be added as Coralogix token with each HTTP request. Your Coralogix Domain will be used to construct the Grafana API endpoint specific to your account.

The API request should contain the following:

  • Headers:
    • ‘token:<Alerts, Rules and Tags API Key>’
    • ‘Content-type: application/json‘
  • URL: https://ng-api-http.<domain>/grafana/api/

Examples

  • GET Home Dashboard
curl --location --request GET 'https://ng-api-http.<DOMAIN>/grafana/api/dashboards/home' \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer <Alerts, Rules and Tags API Key>' \
  • Search all dashboards in your team:
curl --location --request GET 'https://ng-api-http.<DOMAIN>/grafana/api/search' \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer <Alerts, Rules and Tags API Key>' \
  • Get a dashboard and panels by uid:
curl --location --request GET 'https://ng-api-http.<DOMAIN>/grafana/api/dashboards/uid/<UID>' \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer <Alerts, Rules and Tags API Key>' \
  • Post Dashboard – create and update existing dashboards:
curl --location --request POST 'https://ng-api-http.coralogix.com/grafana/api/dashboards/db' \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer ' \
--data-raw '<Alerts, Rules and Tags API Key>'
  • GET Annotations:
curl --location --request GET 'https://ng-api-http.<DOMAIN>/grafana/api/annotations?from=1669631285&to=1669634885&tags=tag' 
--header 'Content-type: application/json' \
--header 'Authorization: Bearer <Alerts, Rules and Tags API Key>' \'

Additional Resources

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email to [email protected].

On this page