Slack.Web.Usergroups (SlackKit v0.25.0-alpha.0)

View Source

Summary

Functions

Disable an existing User Group.

List all User Groups for a team.

Update an existing User Group.

Functions

create(name, optional_params \\ %{})

Create a User Group.

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: true
  • handle - A mention handle. Must be unique among channels, users and User Groups.
  • include_count - Include the number of users in each User Group. ex: true
  • team_id - Encoded team id where the user group has to be created, required if org token is used.

Errors the API can return:

  • name_too_long - Name too long.
  • name_already_exists - Name is already in use on this workspace
  • description_too_long - Given usergroup description is too long
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • bad_handle - Handle is invalid
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • target_team_not_on_org - Target team specified is not on the org in context
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • invalid_channel_provided - An invalid channel ID was provided
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • permission_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.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • missing_subteam_name - Subteam name is required
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • target_team_must_be_specified_in_org_context - No target team was specified but the team in context is an org
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • paid_teams_only - Usergroups can only be used on paid Slack teams
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • handle_already_exists - Handle is already in use on this workspace
  • missing_argument - A required argument is missing.
  • forbidden_handle - Handle is invalid
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.
  • invalid_group_provided - An invalid group ID was provided

disable(usergroup, optional_params \\ %{})

Disable an existing User Group.

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: true
  • team_id - Encoded target team id where the user group is, required if org token is used.

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • target_team_not_on_org - Target team specified is not on the org in context
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • 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.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • target_team_must_be_specified_in_org_context - No target team was specified but the team in context is an org
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • missing_argument - A required argument is missing.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.

enable(usergroup, optional_params \\ %{})

Enable a User Group.

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: true
  • team_id - Encoded team id where the user group is, required if org token is used.

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • 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.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • missing_argument - A required argument is missing.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.

list(optional_params \\ %{})

List all User Groups for a team.

Optional Params

  • include_count - Include the number of users in each User Group. ex: true
  • include_disabled - Include results for disabled User Groups. ex: true
  • include_users - Include the list of users for each User Group. 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.
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • plan_upgrade_required - This workspace does not have access to User Groups, as that feature is only available on Standard and above plans.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • invalid_team - Cannot find subteam team.
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • missing_argument - A required argument is missing.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.
  • users_not_found - Cannot find users on subteam.

update(usergroup, optional_params \\ %{})

Update an existing User Group.

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: true
  • handle - A mention handle. Must be unique among channels, users and User Groups.
  • include_count - Include the number of users in the User Group. ex: true
  • name - A name for the User Group. Must be unique among User Groups. ex: My Test Team
  • team_id - encoded team id where the user group exists, required if org token is used

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • permission_denied - The user does not have permission to update the User Group.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • paid_teams_only - This workspace does not have access to User Groups, as that feature is only available on Standard and above plans.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • too_many_linked_channels - This request exceeds the number of channels we supporting linking to a single usergroup.
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • missing_argument - A required argument is missing.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.