Keys / Grafana

GRAFANA_SERVICE_ACCOUNT_TOKEN

A Grafana service account token that tools call the Grafana HTTP API with. It replaces the deprecated API keys and GRAFANA_API_KEY.

Starts with
glsa_
Expires
never by default; or a date you set
API
create, list and delete, with the service account API

Get it

Create one on grafana.com/docs/grafana/latest/administration/service-accounts. The steps aren't recorded yet.

Set it

GRAFANA_SERVICE_ACCOUNT_TOKEN=glsa_...

Grafana's MCP server reads it on its own, with GRAFANA_URL. It still reads GRAFANA_API_KEY, with a deprecation warning. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. In Administration > Users and access > Service accounts, open the same service account and add a new token. It gets the service account's permissions.
  2. Deploy it everywhere that reads GRAFANA_SERVICE_ACCOUNT_TOKEN.
  3. Check that nothing still uses the old token, then delete it from the service account.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16