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

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.

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

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

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.

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!

Hi @elisa.zoom

I am using API to create users in zoom account
Endpoint POST: https://api.zoom.us/v2/accounts/{accountId}/users.

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

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

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.

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:

Hope this helps,

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?

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