# Invalid\_grant exception while refreshing a token

**URL:** <https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154>\
**Category:** API and Webhooks\
**Created:** [March 3, 2022, 6:37am UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154 "2022-03-03T06:37:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![agoel3](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@agoel3](https://devforum.zoom.us/u/agoel3)\
**Post date:** [March 3, 2022, 6:37am UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154/1 "2022-03-03T06:37:20Z")

</div>

I’m getting {error: ‘invalid\_grant’, reason: ‘Invalid Token!’} as a response to the /oauth/token?grant\_type=refresh\_token&refresh\_token=\<refresh\_token\> request.

we use refresh token api in our code to generate a new token whenever a token gets expired for a user, it gave me this error only in one request so I wants to know the possible reason behind that because grant\_type is similar in all the requests which is ‘refresh\_token’ so in what case this api can give ‘invalid\_grant’ error?

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [March 30, 2022, 5:27am UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154/2 "2022-03-30T05:27:47Z")

</div>

Welcome, @agoel3,

Thank you for posting in the Developer Forum. Generally, the “Invalid Token” error happens when the latest refresh token is not used when generating a new Access token. Before diving further, can tell us if this only happening to one particular user or more ? Also, how frequently are you seeing this behavior?

Regards,  
Donte

---

<div class="post-metadata">

**Author:** ![zac1](https://avatars.discourse-cdn.com/v4/letter/z/a3d4f5/32.png) [@zac1](https://devforum.zoom.us/u/zac1)\
**Post date:** [April 1, 2022, 1:03am UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154/3 "2022-04-01T01:03:21Z")

</div>

This error is breaking all application for our clients as well, so I guess it’s not specific to an application. It is also seen here: [Invalid Token! (invalid\_grant) when trying to renew a token on our app - #4 by basic](https://devforum.zoom.us/t/invalid-token-invalid-grant-when-trying-to-renew-a-token-on-our-app/63392/4)

Is there a proposed fix for this issue?

---

<div class="post-metadata">

**Author:** ![zac1](https://avatars.discourse-cdn.com/v4/letter/z/a3d4f5/32.png) [@zac1](https://devforum.zoom.us/u/zac1)\
**Post date:** [April 1, 2022, 2:21pm UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154/4 "2022-04-01T14:21:42Z")

</div>

Figured it out, the refresh token is one time use, after using it to fetch access token once, the refresh token will be returned as well as the new refresh token.

> [@"Invalid Token!" error message when trying to refresh oauth token](https://devforum.zoom.us/t/invalid-token-error-message-when-trying-to-refresh-oauth-token/13363/108):
>
> Hi @kkoellner, These types of errors could happen for a few different reasons. Can you see my post here and let me know if any of these might be the case? Thanks! Will

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [April 21, 2022, 9:26am UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154/5 "2022-04-21T09:26:43Z")

</div>

Glad to hear you were able to resolve this and you found that [post](https://devforum.zoom.us/t/invalid-token-error-message-when-trying-to-refresh-oauth-token/13363/108) useful. You are correct! While a refresh token is valid for 15 years, it can only be used once. I’ve linked our help documentation below for reference:

## [Refreshing an Access Token](https://marketplace.zoom.us/docs/guides/auth/oauth/#refreshing-an-access-token)

 ![Screen Shot 2022-04-21 at 5.25.27 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/2/12e729d0a7724204df34d7b626d2f3dee312cc80.png)

---

<div class="post-metadata">

**Author:** ![agoel3](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@agoel3](https://devforum.zoom.us/u/agoel3)\
**Post date:** [May 9, 2022, 8:12am UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154/6 "2022-05-09T08:12:49Z")

</div>

So Iet’s say one of fetch access token api gets timeout due to some network issues, Is there a way to get the new access token (using rest apis only without manual reauthorisation) because in that case we won’t have the new refresh token.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 8, 2022, 6:13pm UTC](https://devforum.zoom.us/t/invalid-grant-exception-while-refreshing-a-token/65154/7 "2022-06-08T18:13:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
