# Refreshing Token Daily

**URL:** <https://community.grafana.com/t/refreshing-token-daily/146990>\
**Category:** Grafana\
**Tags:** api\
**Created:** [March 24, 2025, 9:39am UTC](https://community.grafana.com/t/refreshing-token-daily/146990 "2025-03-24T09:39:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kieranmoloney](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@kieranmoloney](https://community.grafana.com/u/kieranmoloney)\
**Post date:** [March 24, 2025, 9:39am UTC](https://community.grafana.com/t/refreshing-token-daily/146990/1 "2025-03-24T09:39:02Z")

</div>

I created a Grafana dashboard that pulls ITSM data from BMC Remedy (change requests, incidents, tasks). It does this by making a GET request. The token used to make these calls is stored as a variable, which I then reference in the HTTP Headers. However, this token expires daily. Each day, I need to create a new token using Postman and copy-paste this value into the Grafana variables. This process is repetitive and cumbersome. Therefore, I am seeking an automated way to refresh this token. We are running Grafana Cloud, so I cannot store this on the server within the environment variables (against org policy). I will need to refresh the token via API. Any suggestions?

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [March 24, 2025, 11:42am UTC](https://community.grafana.com/t/refreshing-token-daily/146990/2 "2025-03-24T11:42:29Z")

</div>

Is this token used for infinity datasource?

---

<div class="post-metadata">

**Author:** ![kieranmoloney](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@kieranmoloney](https://community.grafana.com/u/kieranmoloney)\
**Post date:** [March 24, 2025, 11:54am UTC](https://community.grafana.com/t/refreshing-token-daily/146990/3 "2025-03-24T11:54:36Z")

</div>

Yes, it is.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [March 24, 2025, 3:09pm UTC](https://community.grafana.com/t/refreshing-token-daily/146990/4 "2025-03-24T15:09:25Z")

</div>

It does yet implement token refresh so I would do the creation of the token, the datasource and the dashboard via script maybe?

---

<div class="post-metadata">

**Author:** ![kieranmoloney](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@kieranmoloney](https://community.grafana.com/u/kieranmoloney)\
**Post date:** [March 24, 2025, 4:04pm UTC](https://community.grafana.com/t/refreshing-token-daily/146990/5 "2025-03-24T16:04:03Z")

</div>

Yes, agreed. I have a script that generates a token. But, how do I update the variable within Grafana Cloud locally, from my computer? Is there an Grafana API that I can interact with?

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [March 24, 2025, 4:21pm UTC](https://community.grafana.com/t/refreshing-token-daily/146990/6 "2025-03-24T16:21:19Z")

</div>

> **[HTTP API | Grafana documentation](https://grafana.com/docs/grafana/latest/developers/http_api/)**
>
> Grafana HTTP API

---

<div class="post-metadata">

**Author:** ![kieranmoloney](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@kieranmoloney](https://community.grafana.com/u/kieranmoloney)\
**Post date:** [March 25, 2025, 12:58pm UTC](https://community.grafana.com/t/refreshing-token-daily/146990/7 "2025-03-25T12:58:47Z")

</div>

from where can I find the right URL for the API call?

```auto
GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1
Accept: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

```
