usergroups.users.update
method
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Usage info
This method updates the list of users that belong to a user group. It replaces all users in a user group with the list of users provided in the users
parameter.
permission_denied
error.To update this setting, navigate to Tools & settings > Workspace settings > Permissions > User Groups within your workspace and update who can create, disable, or modify user groups from the drop-down menus.
If user group permissions cannot be changed and are restricted to admins only, use the user token from a user with the correct permissions. A bot token can be used only if permissions are set to everyone
.
You cannot use this method to remove all members from a user group. Instead, use the usergroups.disable
method. If you need to reactivate the user group later, use the usergroups.enable
method.
Guests or bot users cannot be added to user groups; attempting to do so will result in an invalid_user
error (or in the case of single channel guests, a single_channel_guests_cannot_be_added
error).
The team_id
is only relevant when using an org-level token. This field will be ignored if the API call is sent using a workspace-level token.
POST Bodies
As outlined in Using the Slack Web API, you may present your arguments as either standard POST parameters, or you may use JSON. This can be confusing in terms of the array argument type (users
), so let's clarify: to call the method with a URL-encoded string, it may look something like this:
users=U0130R122E8%2C%20U0133AHT0M8
while calling it with a JSON body should be formatted as follows:
"users": [
"U0130R122E8",
"U0133AHT0M8"
]
Both will yield the same result, so it's potato, po-tah-to as far as we're concerned.