# Server-to-Server app. type. Randomly getting Code 124, “Invalid access token.”

**URL:** <https://devforum.zoom.us/t/server-to-server-app-type-randomly-getting-code-124-invalid-access-token/87297>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [April 25, 2023, 6:24am UTC](https://devforum.zoom.us/t/server-to-server-app-type-randomly-getting-code-124-invalid-access-token/87297 "2023-04-25T06:24:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev-zoom-api](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@dev-zoom-api](https://devforum.zoom.us/u/dev-zoom-api)\
**Post date:** [April 25, 2023, 6:24am UTC](https://devforum.zoom.us/t/server-to-server-app-type-randomly-getting-code-124-invalid-access-token/87297/1 "2023-04-25T06:24:48Z")

</div>

Hi, Support! I have an issue with an **Invalid access token** after a few API calls with the same bearer token.  
I’ve heard of some indexes for the token. Can you provide information on how I can fix it or maybe you have a manual for implementing the last one?  
Thanks in advance for your help!

I’m using this request for getting access\_token:

```auto
curl -X POST https://zoom.us/oauth/token -d 'grant_type=account_credentials' -d 'account_id={accountID}' -H 'Host: zoom.us' -H 'Authorization: Basic Base64Encoded(clientId:clientSecret)'

```

---

<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:** [April 25, 2023, 7:13pm UTC](https://devforum.zoom.us/t/server-to-server-app-type-randomly-getting-code-124-invalid-access-token/87297/2 "2023-04-25T19:13:33Z")

</div>

HI @dev-zoom-api  
Thanks for reaching out to us!  
The issue you are facing could be caused by the generation of new tokens and these new tokens are invalidating the previous one.  
So, when using our Server to Server OAuth app, by design you can only have one token working and if you generate a new one, this will invalidate the previous one.

You can either have multiple Server to Server OAuth apps in your account for different services or you can increase the token\_index tolerance to your application if you do not want to create different aplications.

---

<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:** [April 28, 2024, 10:50am UTC](https://devforum.zoom.us/t/server-to-server-app-type-randomly-getting-code-124-invalid-access-token/87297/3 "2024-04-28T10:50:08Z")

</div>

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