# Unauthorized error in Server-to-Server App

**URL:** <https://devforum.zoom.us/t/unauthorized-error-in-server-to-server-app/122270>\
**Category:** Authentication\
**Created:** [December 11, 2024, 7:43am UTC](https://devforum.zoom.us/t/unauthorized-error-in-server-to-server-app/122270 "2024-12-11T07:43:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shikhalev](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shikhalev/32/65547_2.png) [@shikhalev](https://devforum.zoom.us/u/shikhalev)\
**Post date:** [December 11, 2024, 7:43am UTC](https://devforum.zoom.us/t/unauthorized-error-in-server-to-server-app/122270/1 "2024-12-11T07:43:39Z")

</div>

I’m having trouble understanding authorization/permissions.

I’ve created a Server-to-Server OAuth app and am trying to manage chat channels in it via the REST API (`POST /v2/chat/users/{userId}/channels`), using my `account_id` in the App Marketplace as the `userId`. I get a `401 Unauthorized` error.

I first get a token via a `POST /oauth/token` call — this call succeeds and returns some token that looks normal…

---

<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:** [December 12, 2024, 9:35pm UTC](https://devforum.zoom.us/t/unauthorized-error-in-server-to-server-app/122270/2 "2024-12-12T21:35:33Z")

</div>

Hi @shikhalev  
Thanks for reaching out to us and welcome to the Zoom developer Forum!  
For user ID you should not pass your account ID but your userID.  
You can get a list of all user IDs in your account using the Get users endpoint

> **[Users APIs - Zoom Developers](https://developers.zoom.us/docs/api/users/#tag/users/GET/users)**
>
> API reference for: Users

---

<div class="post-metadata">

**Author:** ![shikhalev](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shikhalev/32/65547_2.png) [@shikhalev](https://devforum.zoom.us/u/shikhalev)\
**Post date:** [December 13, 2024, 7:45am UTC](https://devforum.zoom.us/t/unauthorized-error-in-server-to-server-app/122270/3 "2024-12-13T07:45:50Z")

</div>

A request to the `https://api.zoom.us/users` endpoint returns 401, and to the `https://api.zoom.us/chat/users` endpoint — 404…

---

<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:** [December 13, 2024, 2:52pm UTC](https://devforum.zoom.us/t/unauthorized-error-in-server-to-server-app/122270/4 "2024-12-13T14:52:52Z")

</div>

Hi @shikhalev  
The `https://api.zoom.us/v2/` URL is the request base URL, the one you are using is incorrect. Please review our Docs here:

> **[Using Zoom APIs - Zoom Developers](https://developers.zoom.us/docs/api/using-zoom-apis/#api-requests)**
>
> 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.
