ReferenceCreate Grafana Cloud API keys

Grafana Cloud APIs

There are two API systems you can use to work with your Grafana Cloud environment. The Grafana Cloud API allows you to manage resources at the organizational level, such as creating a stack and restarting a Grafana instance. The Grafana HTTP API allows you to manage resources for a Grafana Cloud stack, such as creating a dashboard or setting folder permissions. To work with either API, you must create API keys. Only users with the Admin role can create and provision API keys.

Note: Always create API keys for specific tasks, according to the principle of least privilege. It is better to create multiple API keys for a human user account to use, each for specific tasks, than to create and always use an API key with the abilities needed for the most privileged task. In other words, don’t just create an Admin key and use it for everything.

Create a Grafana Cloud API key

To interact programmatically with the Grafana Cloud API, you need an API key with proper permissions.

Note: Only Grafana.com administrators can create or delete API keys. See Grafana Cloud roles and permissions for more information.

  1. Log into your Grafana Cloud account to access the Cloud Portal.

  2. Select the organization that you want to add an API key to, by selecting from the dropdown in top left.

  3. Click API Keys from the SECURITY section on the left.

  4. Click +Add API Key.

  5. In API Key Name, enter a name for your API key.

  6. In Role, select the user role to associate with this API key. For example, if you want people or software using this key to only have Viewer role permissions, then select Viewer. The roles and permissions available match the Grafana Cloud roles and permissions, with a couple additions:

    • MetricsPublisher is only given permission to send log and metric data to Grafana Cloud
    • PluginPublisher is only given permission to create and publish plugins
  7. Click Create API Key.

  8. A token is created and displayed. Copy the token and store it in a safe place, because it will not be displayed again.

  9. Click Close when finished.

To learn more, see the Grafana Cloud API documentation.

Create a Grafana HTTP API key

Create a Grafana HTTP API key to manage stack resources.

To create a Grafana HTTP API key:

  1. Log into your Grafana Cloud instance.
  2. Open settings (Gear icon) and select the API Keys option.
  3. Click Add API Key.
  4. In Key Name, enter a name for your API key.
  5. In Role, select the Admin or Editor role to associate with this API key.

To learn more, see the Grafana HTTP API documentation.