# Invalid token when connecting On Call with Grafana Cloud

**URL:** <https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525>\
**Category:** Configuration\
**Tags:** grafana-on-call, oncall\
**Created:** [February 24, 2023, 3:24pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525 "2023-02-24T15:24:05Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdeltell](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tdeltell](https://community.grafana.com/u/tdeltell)\
**Post date:** [February 24, 2023, 3:24pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/1 "2023-02-24T15:24:05Z")

</div>

- What Grafana version and what operating system are you using?

Grafana v8.4.5 and Ubuntu 18.04.5 LTS

- **What** are you trying to achieve?

Connect grafana On Call on-premise installation with Grafana Cloud (free account)

- **How** are you trying to achieve it?

I’ve created an API Key from [https://my-instance.grafana.net/a/grafana-oncall-app/settings](https://my-instance.grafana.net/a/grafana-oncall-app/settings)

- What happened?

When I paste that key on https://,y-grafana/a/grafana-oncall-app/cloud I got an “Invalid token” error"

- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.

On the oncall container I see this log entries:

```auto
 2023-02-24 15:03:56 source=engine:app google_trace_id=none logger=apps.oss_installation.models.cloud_connector Unable to sync with cloud. GRAFANA_CLOUD_ONCALL_TOKEN is invalid
 2023-02-24 15:03:56 source=engine:app google_trace_id=none logger=apps.oss_installation.models.cloud_connector Unable to sync with cloud. GRAFANA_CLOUD_ONCALL_TOKEN is invalid

```

Thank you in advance for your help

---

<div class="post-metadata">

**Author:** ![tdeltell](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tdeltell](https://community.grafana.com/u/tdeltell)\
**Post date:** [March 27, 2023, 3:49pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/2 "2023-03-27T15:49:03Z")

</div>

this topic can be closed

---

<div class="post-metadata">

**Author:** ![mbi](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mbi](https://community.grafana.com/u/mbi)\
**Post date:** [April 10, 2023, 12:44pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/3 "2023-04-10T12:44:27Z")

</div>

Could you inform as to how you resolved the issue?

---

<div class="post-metadata">

**Author:** ![lulib94](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lulib94](https://community.grafana.com/u/lulib94)\
**Post date:** [April 24, 2023, 2:20pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/4 "2023-04-24T14:20:11Z")

</div>

what was the fix here?

---

<div class="post-metadata">

**Author:** ![tdeltell](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tdeltell](https://community.grafana.com/u/tdeltell)\
**Post date:** [April 25, 2023, 10:51am UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/5 "2023-04-25T10:51:11Z")

</div>

The token between my grafana on premise and the grafana cloud was set wrong

---

<div class="post-metadata">

**Author:** ![DUGi](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@DUGi](https://community.grafana.com/u/DUGi)\
**Post date:** [May 12, 2023, 7:58am UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/6 "2023-05-12T07:58:19Z")

</div>

“The token between my grafana on premise and the grafana cloud was set wrong”  
Can you explain please? I have exactly the same problem.  
my token looks like b2b67cefd63c54efd6ecfe016a3745a4a2dc455cec000ca73d5b9b84facac242  
(32 rand hex)

curl -H “Authorization: ” [https://oncall-prod-eu-west-0.grafana.net/oncall/api/v1/integrations](https://oncall-prod-eu-west-0.grafana.net/oncall/api/v1/integrations)  
is working

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://community.grafana.com/u/Marius)\
**Post date:** [June 12, 2023, 6:56am UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/7 "2023-06-12T06:56:13Z")

</div>

I had the same problem and fixed it by setting the API URL manually through the environment variable GRAFANA\_CLOUD\_ONCALL\_API\_URL. The URL can be found on the Grafana Cloud OnCall settings page.

---

<div class="post-metadata">

**Author:** ![tomohrad](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tomohrad](https://community.grafana.com/u/tomohrad)\
**Post date:** [December 7, 2023, 3:43pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/8 "2023-12-07T15:43:00Z")

</div>

have you set this env for grafana or for oncall ? still cant to make it work.  
@DUGi any progress with it ?

---

<div class="post-metadata">

**Author:** ![tomohrad](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tomohrad](https://community.grafana.com/u/tomohrad)\
**Post date:** [December 8, 2023, 3:45pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/9 "2023-12-08T15:45:55Z")

</div>

if anyone need it. I’ve solved it by add env for grafana,

```auto
ONCALL_CLOUD_API_URL: "https://oncall-prod-eu-west-0.grafana.net/oncall/api/v1/integrations"

```

---

<div class="post-metadata">

**Author:** ![wiesemannmo](https://avatars.discourse-cdn.com/v4/letter/w/2acd7d/32.png) [@wiesemannmo](https://community.grafana.com/u/wiesemannmo)\
**Post date:** [March 7, 2024, 4:08pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/10 "2024-03-07T16:08:18Z")

</div>

I can’t get it to work. Can anyone help me? What infos do I need to provide?

---

<div class="post-metadata">

**Author:** ![DUGi](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@DUGi](https://community.grafana.com/u/DUGi)\
**Post date:** [April 24, 2024, 8:02am UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/11 "2024-04-24T08:02:28Z")

</div>

No luck I added to docker compose:

```
  ONCALL_CLOUD_API_URL: https://oncall-prod-eu-west-0.grafana.net/oncall/api/v1/integrations
  GRAFANA_CLOUD_ONCALL_API_URL: https://oncall-prod-eu-west-0.grafana.net/oncall
  GRAFANA_CLOUD_ONCALL_TOKEN: ****************

```

but it is sstill saying invalid token.  
I also tied to add that token via GUI but result is the same.

---

<div class="post-metadata">

**Author:** ![gecohelp](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gecohelp](https://community.grafana.com/u/gecohelp)\
**Post date:** [June 6, 2024, 2:47pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/12 "2024-06-06T14:47:32Z")

</div>

Same problem.  
I don’t understand why there’s no documentation about this.

---

<div class="post-metadata">

**Author:** ![djerk](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/djerk/32/46266_2.png) [@djerk](https://community.grafana.com/u/djerk)\
**Post date:** [June 20, 2024, 1:28pm UTC](https://community.grafana.com/t/invalid-token-when-connecting-on-call-with-grafana-cloud/82525/13 "2024-06-20T13:28:42Z")

</div>

How does one set this value for non-Docker Grafana deployments? I’m running Grafana from a deb repository and OnCall on a different machine using Docker, as it was a later addition and it has served us well.

But Grafana won’t connect to the cloud instance at all, I checked with tcpdump. So missing this setting seems relevant.
