# {"code":"124","message":"Invalid access token"} error for User creation API using working OAuth access token

**URL:** <https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806>\
**Category:** API and Webhooks\
**Created:** [February 4, 2022, 4:17pm UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806 "2022-02-04T16:17:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![navin](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@navin](https://devforum.zoom.us/u/navin)\
**Post date:** [February 4, 2022, 4:17pm UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/1 "2022-02-04T16:17:09Z")

</div>

**Description**  
We are looking to create users in the application to use Chat API, as from the document it was confirmed that there should be OAuth for both account level and user level app for Chat Api. While requesting the create user api for account level OAuth app the response was - code 124, message : Invalid access token.  
Using OAuth we have generated the token and it was successfully giving the result for Chat API’s and the same working Authentication Bearer token(access token : OAuth) was not working for create user.

**Error**  
{“code”:“124”,“message”:“Invalid access token”}

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
OAuth

**Which Endpoint/s?**  
POST: v2/accounts/{accountId}/users

_Additional Queries_  
There is AccountId field in user creation can i pass me in there or do i need to use owner’s id value.  
Can we bulk upload user in one go ?  
Any api to send media/attachment in Chat API.

---

<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:** [February 11, 2022, 1:44am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/2 "2022-02-11T01:44:35Z")

</div>

Hi @navin

Thank you for reaching out to the Zoom Developer Forum and Welcome to our community!  
Could you please share with me the link to the endpoint that you are referring to so I can understand your use case and what you are referring to better?

Thanks a lot!  
Elisa

---

<div class="post-metadata">

**Author:** ![navin](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@navin](https://devforum.zoom.us/u/navin)\
**Post date:** [February 11, 2022, 4:57am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/3 "2022-02-11T04:57:00Z")

</div>

Hi @elisa.zoom

I am using API to create users in zoom account  
Endpoint POST: [https://api.zoom.us/v2/accounts/{accountId}/users](https://api.zoom.us/v2/accounts/%7BaccountId%7D/users).

API reference : [https://marketplace.zoom.us/docs/api-reference/zoom-api/ma#operation/userCreate](https://marketplace.zoom.us/docs/api-reference/zoom-api/ma#operation/userCreate)

---

<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:** [February 11, 2022, 10:48pm UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/4 "2022-02-11T22:48:10Z")

</div>

Hi @navin  
Can you please confirm that you have the **Scopes:** `user:write:admin` , `user:write` added in your app?

---

<div class="post-metadata">

**Author:** ![navin](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@navin](https://devforum.zoom.us/u/navin)\
**Post date:** [February 13, 2022, 6:33am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/5 "2022-02-13T06:33:27Z")

</div>

Hi @elisa.zoom

Yes in the OAuth app i have added the required scope. Also when creating the users i have used autocreate type for the user where some of the users have email Id from gmail.

My aim is to auto create the users in my account so i can get the userid and can be used for chat Api in my application.

---

<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:** [February 16, 2022, 1:22am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/6 "2022-02-16T01:22:09Z")

</div>

Hi @navin

Are you using the code that you get appended in the URL to make the request to the API? If so, that is why you are getting the error. With the code appended to the redirect URL that you get when you activate or approve the app you are suppose to make a call to get a bearer token:

Here is the link to our Docs:  
[https://marketplace.zoom.us/docs/guides/auth/oauth](https://marketplace.zoom.us/docs/guides/auth/oauth)

Hope this helps,  
Elisa

---

<div class="post-metadata">

**Author:** ![navin](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@navin](https://devforum.zoom.us/u/navin)\
**Post date:** [February 16, 2022, 4:55am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/7 "2022-02-16T04:55:56Z")

</div>

Hi @elisa.zoom ,

I have successfully added OAuth and I can use chat api with my current user, but when I try to add new user with create User API with the Bearer token I get error for autoCreate with code 124. I want user of gmail, or other domain to create the account without confirmation in Account Managed OAuth App as I am creating app for organization (not every user will have email on our own domain so we need gmail/other domain id to create user automatically without confirmation) .

Can this be achieved. if yes, then how to add user of other domain without account confirmation where they can use Chat API?

---

<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:** [March 18, 2022, 2:56pm UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token-error-for-user-creation-api-using-working-oauth-access-token/63806/8 "2022-03-18T14:56:37Z")

</div>

Closed on March 18, 2022, 2:56pm UTC

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