# Zoom Server-to-Server OAuth in multi-threaded environment

**URL:** <https://devforum.zoom.us/t/zoom-server-to-server-oauth-in-multi-threaded-environment/87982>\
**Category:** Authentication\
**Created:** [May 8, 2023, 7:43am UTC](https://devforum.zoom.us/t/zoom-server-to-server-oauth-in-multi-threaded-environment/87982 "2023-05-08T07:43:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![connectivity](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@connectivity](https://devforum.zoom.us/u/connectivity)\
**Post date:** [May 8, 2023, 7:43am UTC](https://devforum.zoom.us/t/zoom-server-to-server-oauth-in-multi-threaded-environment/87982/1 "2023-05-08T07:43:09Z")

</div>

**Description**  
I am using zoom server-to-server OAuth with grant type account\_credentials to consume Zoom REST API’s.  
I have noticed that the existing access token immediately invalidates as soon as we request a new access token from zoom.  
This is causing problem in multi-threaded environment in which one thread is gets new access token and going to use it to call a REST api, at same time another thread also request a new access token which make the access token hold by first thread invalided and the rest api of thread 1 is failed with invalid access token.

Is there any way to set invalidity interval for access token in zoom?
