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

View Source

Summary

Functions

Accepts an invitation to a Slack Connect channel.

Approves an invitation to a Slack Connect channel

Archives a conversation.

Closes a direct message or multi-person direct message.

Initiates a public or private channel-based conversation

Declines a Slack Connect channel invite.

Fetches a conversation's history of messages and events.

Retrieve information about a conversation.

Sends an invitation to a Slack Connect channel

Joins an existing conversation.

Removes a user from a conversation.

Lists all channels in a Slack team.

Lists shared channel invites that have been generated or received but have not been approved by all parties

Sets the read cursor in a channel.

Retrieve members of a conversation.

Opens or resumes a direct message or multi-person direct message.

Retrieve a thread of messages posted to a conversation

Sets the topic for a conversation.

Reverses conversation archival.

Functions

accept_shared_invite(channel_name, optional_params \\ %{})

Accepts an invitation to a Slack Connect channel.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel_name - Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take. ex: puppies-r-us

Optional Params

  • channel_id - ID of the channel that you'd like to accept. Must provide either invite_id or channel_id.
  • free_trial_accepted - Whether you'd like to use your workspace's free trial to begin using Slack Connect.
  • invite_id - ID of the invite that you’d like to accept. Must provide either invite_id or channel_id. See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.
  • is_private - Whether the channel should be private. ex: true
  • team_id - The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the team_id argument is required.

Errors the API can return:

  • channel_conversion_in_progress - Unable to create a channel connection while a channel conversion is in progress
  • connection_limit_exceeded - This channel has hit the limit of external connections.
  • email_does_not_match - User's email does not match the email in the invite.
  • failed_to_start_trial - Unable to initiate a trial on shared invite acceptance
  • has_already_connected_to_org - A team on the workspace of the org is already in the channel.
  • invalid_emoji_not_allowed - The desired name contains emoji.
  • invalid_host_team - The host workspace is invalid.
  • invalid_link - We couldn't find an invite associated with the ID provided.
  • invalid_name - The value passed for channel_name was invalid.
  • invalid_name_maxlength - The value passed for channel_name exceeded the maximum length.
  • invalid_name_punctuation - The value passed for channel_name contained only punctuation.
  • invalid_name_required - The value passed for channel_name was empty.
  • invalid_name_specials - The value passed for channel_name contained unallowed special characters or upper case characters.
  • invalid_privacy - An invalid channel privacy was provided.
  • invalid_recipient_team - The accepting team does not match the expected recipient team.
  • invalid_target_team - The target workspace is invalid.
  • invite_from_same_org - You can't accept an invite from the same org or workspace.
  • invite_not_found - We couldn't find a Slack Connect channel invite with the ID provided.
  • invite_used - This invite has already been accepted.
  • is_pending_connected_to_org - A team pending to join the channel is on the org of the team trying to accept.
  • legacy_connection_invalid_org - Teams not previously connected to this legacy channel can't connect.
  • legacy_connection_limit_exceeded - You cannot share a legacy ESC channel with a third team
  • name_taken - The desired channel name is already taken in your workspace.
  • not_allowed_for_grid_workspace - Acceptance is not allowed for this workspace.
  • not_paid - This workspace doesn't have access to this feature.
  • restricted_action - A team preference prevents the authenticated user from creating private channels.
  • team_not_found - The team provided in the team_id argument does not exits.
  • user_cannot_create_channel - This user is not allowed to create a channel.
  • user_is_restricted - This user is restricted and cannot accept the invite.
  • user_not_found - The user accepting the invite is not a member of the team provided in the team_id argument.
  • user_required_to_accept_as_private_but_cannot - This uer cannot accept a private channel invitation.

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

approve_shared_invite(invite_id, optional_params \\ %{})

Approves an invitation to a Slack Connect channel

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • invite_id - ID of the shared channel invite to approve

Optional Params

  • target_team - The team or enterprise ID of the receiving party involved in the invitation you are approving

Errors the API can return:

  • already_approved - This invite was already approved by this team.
  • approval_inactive - The approval associated with the invite ID is not active.
  • approval_not_found - We could not find an approval associated with the invite ID provided.
  • channel_conversion_in_progress - A channel conversion is in progress
  • channel_not_found - The channel associated with this invite wasn't found.
  • invalid_action - This action is no longer valid, e.g., trying to approve an invite that has already been approved.
  • invalid_link - The link provided was invalid.
  • invite_not_found - The invite specified wasn't found.
  • missing_target_team - The target_team parameter is required for this request. The inviting team must provide this argument.
  • not_paid - The team attempting to approve this invite is not paid and therefore not eligible.
  • restricted_action - A team preference prevents the authenticated user from creating private channels.

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

archive(channel, optional_params \\ %{})

Archives a conversation.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - ID of conversation to archive

Errors the API can return:

  • already_archived - Channel has already been archived.
  • cant_archive_general - You cannot archive the general channel
  • cant_archive_required - You cannot archive a required channel
  • channel_not_found - Value passed for channel was invalid.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • not_in_channel - The token can not be found in channel.
  • restricted_action - A team preference prevents the authenticated user from archiving.

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

close(channel, optional_params \\ %{})

Closes a direct message or multi-person direct message.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - Conversation to close.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • external_channel_migrating - External channel migrating.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • not_permitted - Not permitted.
  • user_does_not_own_channel - Calling user does not own this DM channel.

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

create(name, optional_params \\ %{})

Initiates a public or private channel-based conversation

API reference

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

View on docs.slack.dev ↗

Required Params

  • name - Name of the public or private channel to create ex: mychannel

Optional Params

  • is_private - Create a private channel instead of a public one ex: true
  • team_id - encoded team id to create the channel in, required if org token is used

Errors the API can return:

  • cannot_create_channel - This channel is unable to be created.
  • canvas_disabled_user_team - Canvas is disabled on user's team
  • invalid_name - Value passed for name was invalid.
  • invalid_name_maxlength - Value passed for name exceeded max length.
  • invalid_name_punctuation - Value passed for name contained only punctuation.
  • invalid_name_required - Value passed for name was empty.
  • invalid_name_specials - Value passed for name contained unallowed special characters or upper case characters.
  • missing_argument - A required argument is missing.
  • name_taken - A channel cannot be created with the given name.
  • no_channel - Value passed for name was empty.
  • restricted_action - A team (workspace) preference prevents the authenticated user from creating channels.

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

decline_shared_invite(invite_id, optional_params \\ %{})

Declines a Slack Connect channel invite.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • invite_id - ID of the Slack Connect invite to decline. Subscribe to the shared_channel_invite_accepted event to receive IDs of Slack Connect channel invites that have been accepted and are awaiting approval.

Optional Params

  • target_team - The team or enterprise id of the other party involved in the invitation you are declining

Errors the API can return:

  • approval_inactive - This approval is no longer active, it may have expired or been declined.
  • approval_not_found - We could not find a Slack Connect approval for the invite provided.
  • inactive_invite - This invitation is no longer active, it may have expired or been revoked.
  • invite_not_found - We could not find a Slack Connect invite associated with the ID provided.
  • missing_target_team - The target_team parameter is required for this request.
  • not_paid - The workspace is not eligible to use Slack Connect.
  • restricted_action - A team preference prevents the authenticated user from declining Slack Connect invites..

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

history(channel, optional_params \\ %{})

Fetches a conversation's history of messages and events.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - Conversation ID to fetch history for.

Optional Params

  • cursor - Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. ex: dXNlcjpVMDYxTkZUVDI=
  • include_all_metadata - Return all metadata associated with this message. 0 ex: true
  • inclusive - Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified. 0 ex: true
  • latest - Only messages before this Unix timestamp will be included in results. Default is the current time. Call the method with no oldest or latest arguments to read the entire history for a conversation.
  • limit - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the conversation history hasn't been reached. Maximum of 999. ex: 20
  • oldest - Only messages after this Unix timestamp will be included in results. Call the method with no oldest or latest arguments to read the entire history for a conversation.

Errors the API can return:

  • channel_is_limited_access - The user has no access to the channel. This is only applicable to private Salesforce record channels.
  • channel_not_found - Value passed for channel was invalid.
  • invalid_cursor - Value passed for cursor was not valid or is no longer valid.
  • invalid_metadata_filter_keys - Value passed for metadata_keys_to_include was invalid. Must be valid json array of strings.
  • invalid_ts_latest - Value passed for latest was invalid
  • invalid_ts_oldest - Value passed for oldest was invalid
  • not_in_channel - The token used does not have access to the proper channel. Only user tokens can access public channels they are not in.

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

info(channel, optional_params \\ %{})

Retrieve information about a conversation.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - Conversation ID to learn more about

Optional Params

  • include_locale - Set this to true to receive the locale for this conversation. Defaults to false
  • include_num_members - Set to true to include the member count for the specified conversation. Defaults to false ex: true

Errors the API can return:

  • channel_is_limited_access - The user has no access to the channel. Only applicable to Salesforce limited access channels.
  • channel_not_found - Value passed for channel was invalid.

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

invite(channel, users, optional_params \\ %{})

Invites users to a channel.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - The ID of the public or private channel to invite user(s) to.
  • users - A comma separated list of user IDs. Up to 100 users may be listed.

Optional Params

  • force - When set to true and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to false. ex: true

Errors the API can return:

  • already_in_channel - Invited user is already in the channel.
  • cant_invite - User cannot be invited to this channel.
  • cant_invite_self - Authenticated user cannot invite themselves to a channel.
  • channel_not_found - Value passed for channel was invalid.
  • external_channel_migrating - External channel migrating.
  • invitee_cant_see_channel - The Enterprise org multi-workspace channel you are inviting a user to is not shared with any workspaces the user is currently a member of.
  • is_archived - Channel has been archived.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • no_external_invite_permission - User does not have permission to invite that external user to the channel
  • no_user - No value was passed for users.
  • not_in_channel - Authenticated user is not in the channel.
  • org_user_not_in_team - One or more members invited are part of the Enterprise organization but not the specific workspace you're interfacing with.
  • ura_max_channels - An invited user is a single-channel guest user ('ultra restricted access') that is already in the maximum number of conversations.
  • user_is_restricted - An invited user is a guest user that is restricted from accessing this conversation.
  • user_not_found - Value passed for users was invalid.

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

invite_shared(channel, optional_params \\ %{})

Sends an invitation to a Slack Connect channel

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - ID of the channel on your team that you'd like to share

Optional Params

  • emails - Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.
  • external_limited - Optional boolean on whether invite is to an external limited member. Defaults to true.
  • user_ids - Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.

Errors the API can return:

  • already_in_channel - User is already in the channel.
  • cannot_share_cross_workspace_channel - You cannot share a cross-workspace or org-wide channel.
  • cannot_share_mandatory_channel - You cannot share #general or mandatory channels.
  • channel_archived - You cannot share an archived channel.
  • channel_not_found - The channel provided was not found.
  • connection_limit_exceeded - This channel has hit the limit of external connections.
  • connection_limit_exceeded_pending - This channel already has a pending invite.
  • invalid_channel_type - You cannot share MPDMs or DMs.
  • invalid_email - At least one email address provided is invalid.
  • invite_lookup_error - An error occurred while attempting to look for existing invites.
  • invite_not_found - An error occurred while inviting users.
  • legacy_connection_limit_exceeded - You cannot share a legacy ESC channel with a third team
  • member_limit_exceeded - This channel that has hit the limit of members
  • message_too_long - The provided message was longer than 560 characters.
  • no_external_invite_permission - User does not have permission to invite an external user.
  • not_allowed_for_grid_workspace - This workspace does not have Slack Connect enabled.
  • not_in_channel - The app is not a member of the channel to invite.
  • not_owner - Only the host organization for a channel can request to share it.
  • not_paid - This feature is only available to paid teams.
  • not_supported - This channel cannot be shared.
  • ratelimit - The rate-limit for this method has been reached. The ratelimit is applied on a per-user basis when you pass the emails parameter.
  • recipients_not_specified - Bots are required to specify which users to invite.
  • restricted_action - A team preference does not allow this authorization to send invites.
  • too_many_emails - Too many email recipients were passed in the emails parameter.
  • url_in_message - The message contained a URL.
  • user_not_found - User lookup failed.

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

join(channel, optional_params \\ %{})

Joins an existing conversation.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - ID of conversation to join

Errors the API can return:

  • channel_is_limited_access - The user has no access to the channel. This is only applicable to private Salesforce record channels.
  • channel_not_found - Value passed for channel was invalid.
  • is_archived - Channel has been archived.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • too_many_members - The membership in the channel has exceeded our maximum member limit. No more users can join the channel.

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

kick(channel, optional_params \\ %{})

Removes a user from a conversation.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - ID of conversation to remove user from.

Optional Params

  • user - User ID to be removed.

Errors the API can return:

  • cant_kick_from_general - User cannot be removed from #general.
  • cant_kick_self - Authenticated user can't kick themselves from a channel.
  • channel_not_found - Value passed for channel was invalid.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • not_in_channel - User was not in the channel.
  • not_supported - This is not supported for this channel and user combination.
  • restricted_action - A team preference prevents the authenticated user from kicking.
  • user_not_found - Value passed for user was invalid.

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

leave(channel, optional_params \\ %{})

Leaves a conversation.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - Conversation to leave

Errors the API can return:

  • cant_leave_general - Authenticated user cannot leave the general channel
  • channel_not_found - Value passed for channel was invalid.
  • is_archived - Channel has been archived.
  • last_member - The last member party to a channel cannot leave the channel. Someone else must join the channel before this user is permitted to exit.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • user_is_restricted - Restricted and guest users cannot leave channel

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

list(optional_params \\ %{})

Lists all channels in a Slack team.

API reference

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

View on docs.slack.dev ↗

Optional Params

  • cursor - Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. ex: dXNlcjpVMDYxTkZUVDI=
  • exclude_archived - Set to true to exclude archived channels from the list. ex: true
  • limit - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer under 1000. ex: 20
  • team_id - encoded team id to list channels in, required if token belongs to org-wide app
  • types - Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im ex: public_channel,private_channel

Errors the API can return:

  • invalid_cursor - Value passed for cursor was not valid or is no longer valid.
  • invalid_limit - Value passed for limit is not understood.
  • invalid_types - Value passed for type could not be used based on the method's capabilities or the permission scopes granted to the used token.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • missing_argument - A required argument is missing.

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

list_connect_invites(optional_params \\ %{})

Lists shared channel invites that have been generated or received but have not been approved by all parties

API reference

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

View on docs.slack.dev ↗

Optional Params

  • count - Maximum number of invites to return
  • cursor - Set to next_cursor returned by previous call to list items in subsequent page ex: 5c3e53d5
  • team_id - Encoded team id for the workspace to retrieve invites for, required if org token is used

Errors the API can return:

  • restricted_action - A team preference prevents the authenticated user from viewing shared channel invites.

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

mark(channel, ts, optional_params \\ %{})

Sets the read cursor in a channel.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - Channel or conversation to set the read cursor for. ex: C012345678
  • ts - Unique identifier of message you want marked as most recently seen in this conversation. ex: 1593473566.000200

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • invalid_timestamp - Value passed for timestamp was invalid.
  • not_in_channel - Caller is not a member of the channel.

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

members(channel, optional_params \\ %{})

Retrieve members of a conversation.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - ID of the conversation to retrieve members for

Optional Params

  • cursor - Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. ex: dXNlcjpVMDYxTkZUVDI=
  • limit - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. ex: 20

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • fetch_members_failed - Failed to fetch members for the conversation.
  • invalid_cursor - Value passed for cursor was invalid.
  • invalid_limit - Value passed for limit was invalid.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.

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

open(optional_params \\ %{})

Opens or resumes a direct message or multi-person direct message.

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Optional Params

  • channel - Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
  • prevent_creation - Do not create a direct message or multi-person direct message. This is used to see if there is an existing dm or mpdm.
  • return_im - Boolean, indicates you want the full IM channel definition in the response.
  • users - Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • invalid_user_combination - All external people must already be in at least one channel together to send a message.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • not_enough_users - Needs at least 2 users to open
  • too_many_users - Needs at most 8 users to open
  • user_disabled - A specified user has been disabled.
  • user_not_found - Value(s) passed for users was invalid.
  • user_not_visible - The calling user is restricted from seeing the requested user.
  • users_list_not_supplied - Missing users in request

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

rename(channel, name, optional_params \\ %{})

Renames a conversation.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - ID of conversation to rename
  • name - New name for conversation.

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • invalid_name - Value passed for name was invalid.
  • invalid_name_maxlength - Value passed for name exceeded max length.
  • invalid_name_punctuation - Value passed for name contained only punctuation.
  • invalid_name_required - Value passed for name was empty.
  • invalid_name_specials - Value passed for name contained unallowed special characters or upper case characters.
  • is_archived - Cannot rename archived channel.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • name_taken - New channel name is taken.
  • not_authorized - Caller cannot rename this channel.
  • not_in_channel - Caller is not a member of the channel.

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

replies(channel, ts, optional_params \\ %{})

Retrieve a thread of messages posted to a conversation

API reference

Rate limit: Tier 3: 50+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • channel - Conversation ID to fetch thread from. The channel and ts arguments are always required. ts must be the timestamp of an existing message.
  • ts - Unique identifier of either a thread’s parent message or a message in the thread. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message. The channel and ts arguments are always required. ts must be the timestamp of an existing message.

Optional Params

  • cursor - Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. ex: dXNlcjpVMDYxTkZUVDI=
  • include_all_metadata - Return all metadata associated with this message. 0 ex: true
  • inclusive - Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified. 0 ex: true
  • latest - Only messages before this Unix timestamp will be included in results.
  • limit - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. ex: 20
  • oldest - Only messages after this Unix timestamp will be included in results.

Errors the API can return:

  • channel_not_found - Value for channel was missing or invalid.
  • invalid_cursor - Value passed for cursor was not valid or is no longer valid.
  • invalid_metadata_filter_keys - Value passed for metadata_keys_to_include was invalid. Must be valid json array of strings.
  • invalid_ts_latest - Value passed for latest was invalid
  • invalid_ts_oldest - Value passed for oldest was invalid
  • list_record_comment_fetch_failed - Failed to fetch list record comments.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • thread_not_found - Value for ts was missing or invalid.

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

set_purpose(channel, purpose, optional_params \\ %{})

Sets the channel description.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - Channel to set the description of
  • purpose - The description ex: This is the random channel, anything goes!

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • is_archived - Channel has been archived.
  • method_not_supported_for_channel_type - This conversation type cannot be used with this method.
  • not_in_channel - Authenticated user is not in the channel.
  • too_long - Description was longer than 250 characters.
  • user_is_restricted - Setting the channel description is a restricted action.

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

set_topic(channel, topic, optional_params \\ %{})

Sets the topic for a conversation.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - Conversation to set the topic of
  • topic - The new topic string. Does not support formatting or linkification. ex: Apply topically for best effects

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • is_archived - Channel has been archived.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • not_in_channel - Authenticated user is not in the channel.
  • too_long - Topic was longer than 250 characters.
  • user_is_restricted - Setting the topic is a restricted action.

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

unarchive(channel, optional_params \\ %{})

Reverses conversation archival.

API reference

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

View on docs.slack.dev ↗

Required Params

  • channel - ID of conversation to unarchive

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • method_not_supported_for_channel_type - This type of conversation cannot be used with this method.
  • not_archived - Channel is not archived.

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