Slack. Web. Usergroups
(SlackKit v1.0.0-alpha.0)
View Source
Summary
Functions
Create a User Group.
Disable an existing User Group.
Enable a User Group.
List all User Groups for a team.
Update an existing User Group.
Functions
Create a User Group.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
usergroups:write - User token:
usergroups:write
Required Params
name- A name for the User Group. Must be unique among User Groups. ex:My Test Team
Optional Params
additional_channels- A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.channels- A comma separated string of encoded channel IDs for which the User Group uses as a default.description- A short description of the User Group.enable_section- Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added. ex:truehandle- A mention handle. Must be unique among channels, users and User Groups.include_count- Include the number of users in each User Group. ex:trueteam_id- Encoded team id where the user group has to be created, required if org token is used.
Errors the API can return:
bad_handle- Handle is invaliddescription_too_long- Given usergroup description is too longforbidden_handle- Handle is invalidhandle_already_exists- Handle is already in use on this workspaceinvalid_channel_provided- An invalid channel ID was providedinvalid_group_provided- An invalid group ID was providedmissing_argument- A required argument is missing.missing_subteam_name- Subteam name is requiredname_already_exists- Name is already in use on this workspacename_too_long- Name too long.paid_teams_only- Usergroups can only be used on paid Slack teamspermission_denied- The user does not have permission to create a User Group.plan_upgrade_required- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans.target_team_must_be_specified_in_org_context- No target team was specified but the team in context is an orgtarget_team_not_on_org- Target team specified is not on the org in context
See the Common Errors guide for errors returned by every Web API method.
Disable an existing User Group.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
usergroups:write - User token:
usergroups:write
Required Params
usergroup- The encoded ID of the User Group to disable. ex:S0604QSJC
Optional Params
include_count- Include the number of users in the User Group. ex:trueteam_id- Encoded target team id where the user group is, required if org token is used.
Errors the API can return:
missing_argument- A required argument is missing.permission_denied- The user does not have permission to disable the User Group.plan_upgrade_required- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans.target_team_must_be_specified_in_org_context- No target team was specified but the team in context is an orgtarget_team_not_on_org- Target team specified is not on the org in context
See the Common Errors guide for errors returned by every Web API method.
Enable a User Group.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
usergroups:write - User token:
usergroups:write
Required Params
usergroup- The encoded ID of the User Group to enable. ex:S0604QSJC
Optional Params
include_count- Include the number of users in the User Group. ex:trueteam_id- Encoded team id where the user group is, required if org token is used.
Errors the API can return:
missing_argument- A required argument is missing.permission_denied- The user does not have permission to enables the User Group.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.
List all User Groups for a team.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
usergroups:read - User token:
usergroups:read
Optional Params
include_count- Include the number of users in each User Group. ex:trueinclude_disabled- Include results for disabled User Groups. ex:trueinclude_users- Include the list of users for each User Group. ex:trueteam_id- The user group's encoded team ID. Required if org token is used.
Errors the API can return:
invalid_cursor- Value passed forcursorwas not valid or is no longer valid.invalid_team- Cannot find subteam team.missing_argument- A required argument is missing.plan_upgrade_required- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans.users_not_found- Cannot find users on subteam.
See the Common Errors guide for errors returned by every Web API method.
Update an existing User Group.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
usergroups:write - User token:
usergroups:write
Required Params
usergroup- The encoded ID of the User Group to update. ex:S0604QSJC
Optional Params
additional_channels- A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.channels- A comma separated string of encoded channel IDs for which the User Group uses as a default.description- A short description of the User Group.enable_section- Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added. ex:truehandle- A mention handle. Must be unique among channels, users and User Groups.include_count- Include the number of users in the User Group. ex:truename- A name for the User Group. Must be unique among User Groups. ex:My Test Teamteam_id- encoded team id where the user group exists, required if org token is used
Errors the API can return:
missing_argument- A required argument is missing.paid_teams_only- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans.permission_denied- The user does not have permission to update the User Group.too_many_linked_channels- This request exceeds the number of channels we supporting linking to a single usergroup.
See the Common Errors guide for errors returned by every Web API method.