# How to restrict number of users in a session?

**URL:** <https://devforum.zoom.us/t/how-to-restrict-number-of-users-in-a-session/50100>\
**Category:** Web\
**Created:** [May 12, 2021, 8:54am UTC](https://devforum.zoom.us/t/how-to-restrict-number-of-users-in-a-session/50100 "2021-05-12T08:54:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rinurinshac](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rinurinshac/32/26084_2.png) [@rinurinshac](https://devforum.zoom.us/u/rinurinshac)\
**Post date:** [May 12, 2021, 8:54am UTC](https://devforum.zoom.us/t/how-to-restrict-number-of-users-in-a-session/50100/1 "2021-05-12T08:54:51Z")

</div>

We need to limit the number of participants to 2 in a session. if a third participant tries to join in the same session, it should not be allowed. How to achieve this?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [May 13, 2021, 6:50pm UTC](https://devforum.zoom.us/t/how-to-restrict-number-of-users-in-a-session/50100/2 "2021-05-13T18:50:38Z")

</div>

Hey @rinurinshac ,

This logic will need to be implemented on your end. Perhaps you can keep track of how many users are in a session, and then if there are 2, hide your Join UI for additional users.

-Tommy

---

<div class="post-metadata">

**Author:** ![rinurinshac](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rinurinshac/32/26084_2.png) [@rinurinshac](https://devforum.zoom.us/u/rinurinshac)\
**Post date:** [May 14, 2021, 8:29am UTC](https://devforum.zoom.us/t/how-to-restrict-number-of-users-in-a-session/50100/3 "2021-05-14T08:29:27Z")

</div>

@tommy

Is there any api available to get list of users joined in a session?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [May 14, 2021, 9:13am UTC](https://devforum.zoom.us/t/how-to-restrict-number-of-users-in-a-session/50100/4 "2021-05-14T09:13:24Z")

</div>

Hey @rinurinshac

You can listen to the `user-added` and `user-removed` events, and `client.getAllUser()` to obtain the users.

Thanks  
Vic

---

<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 13, 2021, 7:13pm UTC](https://devforum.zoom.us/t/how-to-restrict-number-of-users-in-a-session/50100/5 "2021-06-13T19:13:57Z")

</div>

Closed on June 13, 2021, 7:13pm UTC

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