# Refresh token no longer works after POST https://zoom.us/oauth/token API returned a 504

**URL:** <https://devforum.zoom.us/t/refresh-token-no-longer-works-after-post-https-zoom-us-oauth-token-api-returned-a-504/76547>\
**Category:** Authentication\
**Created:** [September 27, 2022, 12:43am UTC](https://devforum.zoom.us/t/refresh-token-no-longer-works-after-post-https-zoom-us-oauth-token-api-returned-a-504/76547 "2022-09-27T00:43:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoom\_dev\_sandbox](https://avatars.discourse-cdn.com/v4/letter/z/bb73d2/32.png) [@zoom\_dev\_sandbox](https://devforum.zoom.us/u/zoom_dev_sandbox)\
**Post date:** [September 27, 2022, 12:43am UTC](https://devforum.zoom.us/t/refresh-token-no-longer-works-after-post-https-zoom-us-oauth-token-api-returned-a-504/76547/1 "2022-09-27T00:43:09Z")

</div>

**POST [https://zoom.us/oauth/token](https://zoom.us/oauth/token) API**

**Description**

- Hi. Currently our app received next error

```auto
{
	statusCode=504
	headers=
		Date: Thu, 15 Sep 2022 15:18:03 GMT
		Content-Type: text/html
		Content-Length: 132
		Connection: keep-alive
	body=
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>

}

and further 

{
	statusCode=502
	headers=
		Date: Thu, 15 Sep 2022 15:18:07 GMT
		Content-Type: text/html
		Content-Length: 497
		Connection: keep-alive
		ETag: "613fcce0-1f1"
	body=
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the error log for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
</body>
</html>

}

```

while, using stored refresh\_token, calling POST `https://zoom.us/oauth/token` API to refresh an expired access\_token. And now, we get `{ "reason": "Invalid Token!", "error": "invalid_grant" }` when we try to use our stored refresh token. Usually this flow works correct for our app, but sometimes (once per 2.5 - 3 months) zoom api responds with this error. And for now, we have only one way to fix this → ask client to regenerate their refresh\_token (which is so annoying). Can you please help us with this problem? Why zoom api sometimes responds with this error?

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [September 27, 2022, 6:53am UTC](https://devforum.zoom.us/t/refresh-token-no-longer-works-after-post-https-zoom-us-oauth-token-api-returned-a-504/76547/2 "2022-09-27T06:53:30Z")

</div>

Hi @zoom_dev_sandbox ,

Thank you for bringing this to our attention. Yes this does happen on occasion and can be fixed with the customer regenerating their refresh\_token as you’ve been doing. Unfortunately, we do not have a perfect configuration to 100% prevent the 504 gateway error at this time, but we are always making improvements to our developer experience 🙂

---

<div class="post-metadata">

**Author:** ![zoom\_dev\_sandbox](https://avatars.discourse-cdn.com/v4/letter/z/bb73d2/32.png) [@zoom\_dev\_sandbox](https://devforum.zoom.us/u/zoom_dev_sandbox)\
**Post date:** [September 27, 2022, 8:41am UTC](https://devforum.zoom.us/t/refresh-token-no-longer-works-after-post-https-zoom-us-oauth-token-api-returned-a-504/76547/3 "2022-09-27T08:41:16Z")

</div>

Hi @gianni.zoom . So you mean that there is no way to prevent this issue happens?

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [September 27, 2022, 2:39pm UTC](https://devforum.zoom.us/t/refresh-token-no-longer-works-after-post-https-zoom-us-oauth-token-api-returned-a-504/76547/4 "2022-09-27T14:39:22Z")

</div>

Hi @zoom_dev_sandbox ,

There’s no absolute permanent way at this time that I can recommend, but we are working to reduce any sort of issues and errors like this.
