---
title: "Dashboards - Tutorial: How to use the Grafana® API"
description: "Learn how to configure Grafana® to use the API and how to make calls to the exposed API."
url: https://docs.us.ovhcloud.com/en/public-cloud/data-analytics/dashboards-tutorial-use-grafana-api
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# Dashboards - Tutorial: How to use the Grafana® API

**Learn how to configure Grafana® to use the API and how to make calls to the exposed API.**

 

## Requirements

- A [Public Cloud project](https://us.ovhcloud.com/public-cloud/) in your OVHcloud account
- Access to the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/)
- A Dashboards service running on your OVHcloud Public Cloud project (see [this guide](https://docs.us.ovhcloud.com/en/public-cloud/databases/getting-started.md))1

 

## Instructions

### Create a Grafana[®](#go-further) service account

From the Grafana® home screen, select `Administration`, `Users and access`, then `Service` Accounts.

Click `Add Service Account`.

Create a new service account `sa-editor` with the role `Editor`.

Click `Create`.

Click on `Add service account token`:

Enter the name of the desired token, `grafana-sa-token-editor`, and click on `Generate token`:

Copy the generated token.

**Warning:**

**NOTE:** After closing the pop-up, you will no longer be able to display the token!

The created token appears in the tokens list:

 

### Create a folder

Before using the Grafana® API, you must have at least one folder on your Dashboard. To create one, click `Dashboards` in the left-hand navigation menu. Then click `New` and select `New folder`.

Give your folder a name, then click `Create`.

You are ready to use this token with the Grafana® API.

 

### Use the Grafana® API

**Note:**

Detailed instructions on how to use the API and the possible actions can be found in the [official documentation](https://grafana.com/docs/grafana/latest/developers/http_api/).

**Warning:**

**NOTE:** Don't forget to set the `Authorized IP addresses` in the Grafana® configuration. See our [Configure your Dashboards instance to accept incoming connections](https://docs.us.ovhcloud.com/en/public-cloud/data-analytics/dashboards-configure-instance-accept-incoming-connections.md) guide for more details.

To send a request to the API, you must use the previously created token and set it in the request header as a "Bearer token":

```bash
export GRAFANA_API_TOKEN=042footoken420

curl -H "Authorization: Bearer $GRAFANA_API_TOKEN" https://grafana-xxxxxxxxx-yyyyyyyyy.database.cloud.ovh.us/api/folders    
[
    {
        "id":11,
        "uid":"HnDCAp-4k",
        "title":"foo 1"
    },
    {
        "id":5,
        "uid":"cb_S6Pb4k",
        "title":"foo 2"
    },
    {
        "id":9,
        "uid":"Xav55taVk",
        "title":"foo 3"
    },
    {
        "id":10,
        "uid":"AH8sApaVz",
        "title":"foo 4"
    }
]
```

**Tip:**

**Congratulations!** You can now use all the power of the Grafana® API.

 

## Go further

Browse all the [Analytics guides](https://docs.us.ovhcloud.com/en/public-cloud/data-analytics/landing-page-data-analytics.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [Cloud Analytics](https://us.ovhcloud.com/public-cloud/cloud-analytics/) on the OVHcloud US website.

OVHcloud Managed Databases and Analytics:

- Grafana® is a registered trademark of Grafana Labs and is used with the permission of Grafana Labs. OVH SAS and its subsidiaries are not affiliated with or endorsed by Grafana Labs.
- Kafka® is a registered trademark of The Apache Software Foundation and has been licensed for use by OVHcloud, who has no affiliation with and is not endorsed by The Apache Software Foundation.
- MongoDB® is a registered trademark of MongoDB, Inc.
- MySQL® is a registered trademark of Oracle and/or its affiliates.
- PostgreSQL® is a registered trademark of the PostgreSQL Community Association of Canada.
