Slack.Web.Usergroups.Users (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

List all users in a User Group.

Update the list of users for a user group.

Functions

list(usergroup, optional_params \\ %{})

List all users in a User Group.

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • usergroup - The encoded ID of the User Group. ex: S0604QSJC

Optional Params

  • include_disabled - Include results for disabled User Groups. ex: true
  • team_id - The user group's encoded team ID. Required if org token is used.

Errors the API can return:

  • invalid_cursor - Value passed for cursor was not valid or is no longer valid.
  • no_such_subteam - No usergroup found with the given ID.
  • plan_upgrade_required - This workspace does not have access to User Groups, as that feature is only available on Standard and above plans.

See the Common Errors guide for errors returned by every Web API method.

update(usergroup, users, optional_params \\ %{})

Update the list of users for a user group.

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • usergroup - The encoded ID of the user group to update. ex: S0604QSJC
  • users - A comma separated string of encoded user IDs that represent the entire list of users for the user group. ex: U060R4BJ4,U060RNRCZ

Optional Params

  • additional_channels - A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.
  • include_count - Include the number of users in the user group. ex: true
  • is_shared - Boolean to identify if the API is getting called when a shared section is getting shared
  • team_id - encoded team id where the user group exists, required if org token is used

Errors the API can return:

  • failed_for_some_users - User(s) are not in the workspace where this usergroup exists
  • invalid_users - Value passed for users was empty or invalid.
  • missing_argument - A required argument is missing.
  • no_users_provided - Either the users field wasn't provided or an empty value was passed.
  • permission_denied - The user does not have permission to update the list of users for a user group. Check workspace settings to confirm whether the calling user has permission.
  • plan_upgrade_required - This workspace does not have access to user groups, as that feature is only available on Standard and above plans.
  • subteam_max_users_exceeded - Exceeds maximum supported number of users per subteam.

See the Common Errors guide for errors returned by every Web API method.