# Issue using sub-accounts 401 'Invalid Token'

**URL:** <https://devforum.zoom.us/t/issue-using-sub-accounts-401-invalid-token/2648>\
**Category:** API and Webhooks\
**Created:** [December 4, 2018, 5:43pm UTC](https://devforum.zoom.us/t/issue-using-sub-accounts-401-invalid-token/2648 "2018-12-04T17:43:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andresforde](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@andresforde](https://devforum.zoom.us/u/andresforde)\
**Post date:** [December 4, 2018, 5:43pm UTC](https://devforum.zoom.us/t/issue-using-sub-accounts-401-invalid-token/2648/1 "2018-12-04T17:43:44Z")

</div>

Hello guys,

I’m developing a web application using the Zoom v2 API.

Everything is working fine in ‘normal’ mode.

This application needs to create sub-accounts or users under a master account…  
Zoom staff indicated my account is set as a master account.

But when I try the endpoints with /accounts/\<account\_id\>/rest\_of\_url I get the following response:

status\_code: 401  
reason: Unauthorized  
text: ‘{“code”:124,“message”:“Invalid access token.”}’

I’m also not sure what value goes in the account\_id URL field (/accounts/\<account\_id\>/rest\_of\_url)  
The documentation is not very clear on this… BTW, actual code sample snippets would be a nice addition to the API documentation.

Not sure which is this master account\_id,  
Is it the Account no: 500xxxxx  
or 583-XXX-XXXX  
or U7yDatUeY5skkJ7nLiV5z-g’ \<- not actual key of course 😉

I have tried using each of these values with no luck:  
[https://api.zoom.us/v2/accounts/500xxxxx/users](https://api.zoom.us/v2/accounts/500xxxxx/users)  
[https://api.zoom.us/v2/accounts/583XXXXXXX/users](https://api.zoom.us/v2/accounts/583XXXXXXX/users)  
[https://api.zoom.us/v2/accounts/U7yDatUeY5skkJ7nLiV5z-g/users](https://api.zoom.us/v2/accounts/U7yDatUeY5skkJ7nLiV5z-g/users)

It looks to me like either:  
1- My account is not set as master account.  
2- I’m using the wrong {account\_id} in the endpoint URL or  
3- the API is having issues with the authentication JWT token, not sure.  
4- or a combination of the above

Please let me know if you need any additional information about this issue.

Thanks in advance,  
Carlos Perez, S.E.

---

<div class="post-metadata">

**Author:** ![michael\_p.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_p.zoom/32/18105_2.png) [@michael\_p.zoom](https://devforum.zoom.us/u/michael_p.zoom)\
**Post date:** [December 4, 2018, 6:16pm UTC](https://devforum.zoom.us/t/issue-using-sub-accounts-401-invalid-token/2648/2 "2018-12-04T18:16:22Z")

</div>

Hi @andresforde,

To check to see if you have a master account you can check [Zoom.us](http://zoom.us/) portal page and see if you have this tab for sub accounts. If you don’t see if then you will need to make a request with our sales/support team to have a master account.

 ![EeVLrSt4u7bhRj48nZgyhA](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/1X/fda98c9bfea948d60f2e27ded40bccfe217140e8.png)

The correct account ID would be something like wtwAq4fGQRmGBGLEMG1FTQ.  
Have you tried using the JWT token for another API such as GET [https://api.zoom.us/v2/accounts](https://api.zoom.us/v2/accounts) to see if the toke works?

Thanks

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 6:00pm UTC](https://devforum.zoom.us/t/issue-using-sub-accounts-401-invalid-token/2648/3 "2020-08-21T18:00:13Z")

</div>


