Skip to main content

Generate a service account token

A service account token gives programmatic access to your Grafana instance without signing in as a person.

1

Create the service account

Sign in to your Grafana Cloud account. On the Grafana Cloud portal, find your stack and click Launch on its Grafana tile. In the left sidebar of your stack, click Administration > Users and access > Service accounts.

  • Click Add service account.
  • Display name: any name, for example StackOne Integration
  • Click Create.
The Create service account form with the Display name field and the Create button highlighted
2

Assign a role

Enables actions: Add Organization User, Add Team Member, Create Alert Rule, Create Annotation, Create Contact Point, Create Correlation, Create Dashboard, Create Data Source, Create Folder, Create Library Element, Create Mute Timing, Create Playlist, Create Service Account, Create Service Account Token, Create Snapshot, Create Team, Delete Alert Rule, Delete Annotation, Delete Contact Point, Delete Correlation, Delete Dashboard, Delete Data Source, Delete Folder, Delete Library Element, Delete Mute Timing, Delete Playlist, Delete Service Account, Delete Service Account Token, Delete Snapshot, Delete Team, Get Alert Rule, Get Dashboard, Get Dashboard Permissions, Get Dashboard Version, Get Data Source, Get Folder, Get Folder Permissions, Get Home Dashboard, Get Library Element, Get Mute Timing, Get Notification Policies, Get Organization, Get Organization Preferences, Get Playlist, Get Service Account, Get Snapshot, Get Team, Get Unified Group, Get Unified Organization, Get Unified Role, Get Unified User, List Alert Rules, List Annotation Tags, List Annotations, List Contact Points, List Correlations, List Dashboard Tags, List Dashboard Versions, List Data Sources, List Folders, List Library Elements, List Mute Timings, List Organization Users, List Playlists, List Service Account Tokens, List Service Accounts, List Snapshots, List Team Members, List Teams, List Unified Groups, List Unified Organizations, List Unified Resource Types, List Unified Resource Users, List Unified Roles, List Unified Users, Remove Organization User, Remove Team Member, Search Dashboards, Star Dashboard, Unstar Dashboard, Update Alert Rule, Update Annotation, Update Contact Point, Update Dashboard Permissions, Update Data Source, Update Folder, Update Folder Permissions, Update Library Element, Update Mute Timing, Update Notification Policies, Update Organization, Update Organization Preferences, Update Organization User Role, Update Playlist, Update Service Account, Update Team

Assign the role on the service account’s page.

  • Click the Roles field.
  • Full access: Under Basic roles, select Admin, then click Update.
  • Limited access: Keep No basic role. Under Fixed roles, hover over each of these resources and tick Writer (or Reader for read-only access): Dashboards, Dashboard permissions, Folders, Folder permissions, Annotations, Alerting, Alerting provisioning, Data sources, Organization, Organization users, Teams, Service accounts and Library panels. Then click Update.
  • Playlists and snapshots have no fixed roles. To use them, select the Editor basic role instead.
The role picker with Admin under Basic roles and the Update button highlighted
3

Generate the token

Create the token in the Tokens section of the service account’s page.

  • Click Add service account token.
  • Display name: any name, for example StackOne Integration
  • Expiration: No expiration, or Set expiration date to make the token expire
  • Click Generate token.
The Add service account token dialog with the Display name field and the Generate token button highlighted
4

Copy the token

Copy the Token across. Grafana shows it only once, and it cannot be retrieved later.

  • Click Copy to clipboard.
The Service account token created dialog with the token hidden and the Copy to clipboard button highlighted

Find your instance URL

Your instance URL is the address of your Grafana stack, including the trailing slash.

  • Format: https://{your-stack}.grafana.net/
  • Example: if your URL is https://acme.grafana.net/dashboards, your Instance URL is https://acme.grafana.net/
  • Self-hosted Grafana: use your server’s address, such as https://grafana.yourcompany.com/
1

Connect

  • Click Connect.
  • If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider’s authorization flow.
  • Once authorization is successful, you will see a confirmation popup.
2

Use Actions

Connect an AI platform to the linked account’s actions. See AI Platforms.Other ways to call actions are listed in Protocols & SDKs.

Next Steps

Webhooks setup

Configure receiving Events for Grafana into StackOne.