Update User Role via PATCH API - Is it possible?

hello, we are trying to update use role via API using the PATCH /users/{userId} – the call is returning a successful 204. However, when I check the user, they aren’t in the updated role. The body I am passing for the updated role is {“role_name”:“Member”}

You can do this with the API, but looks like your body might be malformed, and it’s a POST call, rather than a PATCH.

Here’s the documentation specifically to this use case:

I’ve had success doing this - the roleID is included in the URI, rather than in the Body

Hi @philip.ross I tried the post you recommended with this body

{
“members”: “[{“email”:”$user_email",“id”:“$user_id”}]"
}

and I am receiving INVALID_INPUT 400 bad request error. Thoughts?

@philip.ross I fixed it but have another error.

},
“body”: {
“code”: 4711,
“message”: “Invalid access token, does not contain scopes:[role:write:admin].”
},

I assume the account I am making the API call from doesn’t have permission to change an admin’s role? If this is the case, what would I need to do to grant that access?

Nice work!

That error suggests to me that the OAuth app that you’re using doesn’t have the permission granted that’s required to make that call successfully.

This is done within your OAuth app directly.
More specific info here on the scopes:

To amend the app, go to marketplace.zoom.us/ Sign in, and then to go Manage (top right) and select the OAuth app that you created to facilitate your API calls.
Select it and under scopes, ensure that it’s got the relevant permissions for Role changes:

Thanks @phillip.wright is there a reason why I don’t see role in the “add scopes” sections? I am an admin with OAuth permissions.

Perhaps you’ve created your app since the transition to Granular scopes was made.

Try this doc: