Slack.Web.Admin.Conversations.RestrictAccess (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

Add an allowlist of IDP groups for accessing a channel

List all IDP Groups linked to a channel

Remove a linked IDP group linked from a private channel

Functions

add_group(channel_id, group_id, optional_params \\ %{})

Add an allowlist of IDP groups for accessing a channel

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel_id - The channel to link this group to.
  • group_id - The IDP Group ID to be an allowlist for the private channel.

Optional Params

  • team_id - The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.

Errors the API can return:

  • cannot_add_more_channels_to_group - The maximum number of channels have already been linked to the group.
  • cannot_add_more_groups_to_channel - The maximum number of groups have already been linked to the channel.
  • channel_is_not_private - The channel is a public channel, a multi-party direct message, a direct message, or is externally-shared.
  • channel_not_found - channel_id can’t be found.
  • default_channel_restricted - The channel is a default channel on the workspace.
  • feature_not_enabled - Feature not enabled
  • group_already_linked_to_channel - The IDP group is already linked to the channel
  • group_must_not_be_empty - The IDP group is currently empty.
  • group_not_found - group_id can’t be found.
  • invalid_channel - The channel can’t be linked to an IDP group (i.e., it's a public channel or external shared channel).
  • invalid_channel_type - The channel is a public channel, a multi-party direct message, a direct message, or is externally-shared.
  • no_channel_memberships - The channel has no members.
  • not_an_admin - This token does not belong to an Org Admin or Owner.
  • team_not_found - team_id can’t be found.
  • unable_to_link_idp_group_and_channel - The IDP group and the channel cannot be linked.

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

list_groups(channel_id, optional_params \\ %{})

List all IDP Groups linked to a channel

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel_id -

Optional Params

  • team_id - The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.

Errors the API can return:

  • channel_not_found - channel_id wasn't found.
  • feature_not_enabled - Feature not enabled
  • invalid_channel - The requested channel couldn’t be linked to an IDP group. It might be a public channel or an externally-shared channel.
  • not_an_admin - This token doesn't belong to an Org Admin or Owner.
  • team_not_found - team_id wasn't found.

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

remove_group(channel_id, group_id, team_id, optional_params \\ %{})

Remove a linked IDP group linked from a private channel

API reference

Rate limit: Tier 1: 1+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel_id - The channel to remove the linked group from.
  • group_id - The IDP Group ID to remove from the private channel.
  • team_id - The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.

Errors the API can return:

  • channel_not_found - channel_id can’t be found.
  • failed_to_remove_group_users - Returned when could not remove the users in the channel of the group being removed
  • failed_to_unlink_channel - Removing the link in the database failed. Please retry.
  • feature_not_enabled - Feature not enabled
  • group_not_found - group_id can’t be found.
  • invalid_channel - The channel could not be linked to an IDP group (i.e., it's a public channel or external shared channel).
  • link_not_found - There was no link found between the specified channel and the IDP group.
  • not_an_admin - This token does not belong to an Org Admin or Owner.
  • team_not_found - team_id can’t be found.
  • unable_to_unlink_idp_group_and_channel - The IDP group and channel cannot be unlinked.

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