Menu
Grafana Cloud

Create Grafana Cloud API keys

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

Note

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

Create a Grafana Cloud Access Policy

To interact programmatically with the Grafana Cloud API, you need an access policy.

Note

Only Grafana.com admins can create or delete access policies in the Cloud Portal. 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 access policy to, by selecting from the dropdown in top left.
  3. Click Access Policies from the SECURITY section on the left.
  4. Click Create access policy.
  5. In Display name, enter a name for your access policy.
  6. In Realm, select either your entire organization, or individual stack. See Realms for more information.
  7. In Scopes, select which permissions the access policy should have. See Scopes for more information.
  8. Click Create.
  9. Locate the access policy, and click Add token.
  10. In Token name, enter a name for you token.
  11. Click Create.
  12. A token is created and displayed. Copy the token and store it in a safe place, because it will not be displayed again.
  13. Click Close when finished.

To learn more, see Grafana Cloud Access Policies and Grafana Cloud API documentation.

Create a Grafana HTTP API key

Create a Grafana HTTP API key to manage your Grafana Cloud instance resources.

To create a Grafana HTTP API key:

  1. Log into your Grafana Cloud instance.
  2. Click Administration in the left-side menu and select API keys.
  3. Click Add API Key.
  4. In Key Name, enter a name for your API key.
  5. In the Role dropdown, select Admin or Editor to associate with this API key.

To learn more, see the Grafana HTTP API documentation.