Cannot add a User to a Division

Hello team,

I am trying to add a user to a Division using the Platform API and Python SDK. All I want to do is just assign a user to a Division, I don't want to add them to a role as those are already set up to be inherited through groups and they span across Divisions. Even if it is possible to do while creating a user, that would be helpful as well.

Currently I am creating a user using the PureCloudPlatformClientV2.CreateUser() and then sending that user through the PureCloudPlatformClientV2.UsersApi(apiclient).post_user() essentially like this:

user = PureCloudPlatformClientV2.CreateUser()
user.name = name
user.email = email
etc.
PureCloudPlatformClientV2.UsersApi(apiclient_info).post_user(user)

And it works perfectly. However, when I try to add the line:

user.division_id = division_id

I get an error saying I am

"missing the following permission(s): [directory:user:add:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]"

I confess, when I attempted this approach, I did not have high hopes because I could not find anywhere in the API documentation about solely assigning a User to a Division. I could find places where you could add a Role and Division to a User but not just the Division.

If anyone could provide guidance on how to go about this, the location of the documentation pertaining to this action, or even confirmation that this is currently not possible via the API, that would be wonderful. Thank you so much!

This isn't an error about your code, this is an error about the configuration of the entity making the request (user or client credentials). That redacted guid is the division id, right? The most likely cause is that the requester does not have access to that division. Documentation on divisions can be found here: Divisions overview - Genesys Cloud Resource Center

Hi Tim,

Thank you for responding rapidly again. The redacted guid is the division id.

You are correct, I had all the admin permissions assigned for the token, but only had it set for the Home Division. Once I set it to All Divisions it worked!

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