# When exactly should we mark a Zoom refresh token as expired or invalid?

**URL:** <https://devforum.zoom.us/t/when-exactly-should-we-mark-a-zoom-refresh-token-as-expired-or-invalid/135459>\
**Category:** API and Webhooks\
**Created:** [July 20, 2025, 11:05am UTC](https://devforum.zoom.us/t/when-exactly-should-we-mark-a-zoom-refresh-token-as-expired-or-invalid/135459 "2025-07-20T11:05:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahammad](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mahammad/32/51763_2.png) [@Mahammad](https://devforum.zoom.us/u/Mahammad)\
**Post date:** [July 20, 2025, 11:05am UTC](https://devforum.zoom.us/t/when-exactly-should-we-mark-a-zoom-refresh-token-as-expired-or-invalid/135459/1 "2025-07-20T11:05:44Z")

</div>

We are integrating Zoom OAuth and using the refresh token to get a new access token when it expires.

However, I recently received a `400` response during the refresh process, and I’m not sure why. In my function, I currently assume that any `400` response means the refresh token is expired or invalid. So, I mark the Zoom account accordingly.

Later, I found out that everything seemed fine:

- The client had connected their Zoom account just a day before.
- They didn’t remove or revoke our OAuth app.

So I’m confused why Zoom still returned a `400` response.

My questions:

1. Is it correct to assume that any `400` response during token refresh means the refresh token is expired or invalid?
2. Are there other cases where Zoom might return `400` even if the refresh token is valid?
3. Did my function is correct or please suggest any more in detail

Here’s the function I’m using:

```auto
def refresh_zoom_token(zoom_account):
    data = {"grant_type": "refresh_token", "refresh_token": zoom_account.refresh_token}

    auth = (settings.ZOOM_CLIENT_ID, settings.ZOOM_CLIENT_SECRET)
    try:
        response = requests.post(
            "https://zoom.us/oauth/token",
            data=data,
            auth=auth,
            timeout=ZOOM_API_TIMEOUT,
            verify=True,
        )
        response.raise_for_status()
    except requests.exceptions.HTTPError as e:
        if e.response.status_code == 400:
            # Zoom says refresh_token is invalid/expired
            zoom_account.mark_refresh_token_expired()
            raise ZoomOAuthError("Zoom session expired. Please reconnect.")
        raise

    tokens = response.json()
    zoom_account.update_tokens(
        access_token=tokens["access_token"],
        refresh_token=tokens["refresh_token"],
        expires_in_seconds=tokens["expires_in"],
    )

```

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [July 21, 2025, 2:52pm UTC](https://devforum.zoom.us/t/when-exactly-should-we-mark-a-zoom-refresh-token-as-expired-or-invalid/135459/2 "2025-07-21T14:52:26Z")

</div>

Hi @Mahammad  
Thanks for reaching out to us and welcome to the Zoom Developer Forum!  
Your function looks correct, I doubled it with our docs here:

> **[OAuth for user authorized apps](https://developers.zoom.us/docs/integrations/oauth/#refresh-an-access-token)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

Is this a recurrent issue that you see on your end? or was this an isolated case?

---

<div class="post-metadata">

**Author:** ![Mahammad](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mahammad/32/51763_2.png) [@Mahammad](https://devforum.zoom.us/u/Mahammad)\
**Post date:** [July 24, 2025, 6:29am UTC](https://devforum.zoom.us/t/when-exactly-should-we-mark-a-zoom-refresh-token-as-expired-or-invalid/135459/3 "2025-07-24T06:29:37Z")

</div>

This issue does not occur regularly — it only happens occasionally.

Also, I wanted to confirm: in my function, if I receive a 400 status code response from Zoom, I am marking the refresh token as expired or invalid in my database and informing my users to reconnect Zoom. Is that the correct approach?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [July 28, 2025, 2:39pm UTC](https://devforum.zoom.us/t/when-exactly-should-we-mark-a-zoom-refresh-token-as-expired-or-invalid/135459/4 "2025-07-28T14:39:46Z")

</div>

Thanks @Mahammad  
The refresh token expires after its use or after 90 days.  
So if you use it, you will get a new access token, along with a 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:** [July 29, 2025, 2:40pm UTC](https://devforum.zoom.us/t/when-exactly-should-we-mark-a-zoom-refresh-token-as-expired-or-invalid/135459/5 "2025-07-29T14:40:37Z")

</div>

Closed on July 29, 2025, 2:40pm UTC

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