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.
Invites users to a channel.
Sends an invitation to a Slack Connect channel
Joins an existing conversation.
Removes a user from a conversation.
Leaves 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.
Renames a conversation.
Retrieve a thread of messages posted to a conversation
Sets the channel description.
Sets the topic for a conversation.
Reverses conversation archival.
Functions
Archives a conversation.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
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 channelcant_archive_required- You cannot archive a required channelchannel_not_found- Value passed forchannelwas 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.
Closes a direct message or multi-person direct message.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
Required Params
channel- Conversation to close.
Errors the API can return:
channel_not_found- Value passed forchannelwas 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.
Initiates a public or private channel-based conversation
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
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:trueteam_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 teaminvalid_name- Value passed fornamewas invalid.invalid_name_maxlength- Value passed fornameexceeded max length.invalid_name_punctuation- Value passed fornamecontained only punctuation.invalid_name_required- Value passed fornamewas empty.invalid_name_specials- Value passed fornamecontained 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 fornamewas 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.
Fetches a conversation's history of messages and events.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:history,groups:history,im:history,mpim:history - User token:
channels:history,groups:history,im:history,mpim:history
Required Params
channel- Conversation ID to fetch history for.
Optional Params
cursor- Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request'sresponse_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:trueinclusive- Include messages witholdestorlatesttimestamps in results. Ignored unless either timestamp is specified. 0 ex:truelatest- Only messages before this Unix timestamp will be included in results. Default is the current time. Call the method with nooldestorlatestarguments 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:20oldest- Only messages after this Unix timestamp will be included in results. Call the method with nooldestorlatestarguments 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 forchannelwas invalid.invalid_cursor- Value passed forcursorwas not valid or is no longer valid.invalid_metadata_filter_keys- Value passed formetadata_keys_to_includewas invalid. Must be valid json array of strings.invalid_ts_latest- Value passed forlatestwas invalidinvalid_ts_oldest- Value passed foroldestwas invalidnot_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.
Retrieve information about a conversation.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:read,groups:read,im:read,mpim:read - User token:
channels:read,groups:read,im:read,mpim:read
Required Params
channel- Conversation ID to learn more about
Optional Params
include_locale- Set this totrueto receive the locale for this conversation. Defaults tofalseinclude_num_members- Set totrueto include the member count for the specified conversation. Defaults tofalseex: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 forchannelwas invalid.
See the Common Errors guide for errors returned by every Web API method.
Invites users to a channel.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
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 totrueand multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults tofalse. 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 forchannelwas 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 channelno_user- No value was passed forusers.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 foruserswas invalid.
See the Common Errors guide for errors returned by every Web API method.
Joins an existing conversation.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:join - User token:
channels:write
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 forchannelwas 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.
Removes a user from a conversation.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
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 forchannelwas 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 foruserwas invalid.
See the Common Errors guide for errors returned by every Web API method.
Leaves a conversation.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
Required Params
channel- Conversation to leave
Errors the API can return:
cant_leave_general- Authenticated user cannot leave the general channelchannel_not_found- Value passed forchannelwas 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.
Lists all channels in a Slack team.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
channels:read,groups:read,im:read,mpim:read - User token:
channels:read,groups:read,im:read,mpim:read
Optional Params
cursor- Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request'sresponse_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. ex:dXNlcjpVMDYxTkZUVDI=exclude_archived- Set totrueto exclude archived channels from the list. ex:truelimit- 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:20team_id- encoded team id to list channels in, required if token belongs to org-wide apptypes- Mix and match channel types by providing a comma-separated list of any combination ofpublic_channel,private_channel,mpim,imex:public_channel,private_channel
Errors the API can return:
invalid_cursor- Value passed forcursorwas not valid or is no longer valid.invalid_limit- Value passed forlimitis not understood.invalid_types- Value passed fortypecould 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.
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:
- Bot token:
conversations.connect:manage
Optional Params
count- Maximum number of invites to returncursor- Set tonext_cursorreturned by previous call to list items in subsequent page ex:5c3e53d5team_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.
Sets the read cursor in a channel.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
Required Params
channel- Channel or conversation to set the read cursor for. ex:C012345678ts- 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 forchannelwas invalid.invalid_timestamp- Value passed fortimestampwas 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.
Retrieve members of a conversation.
API reference
Rate limit: Tier 4: 100+ per minute
Scopes:
- Bot token:
channels:read,groups:read,im:read,mpim:read - User token:
channels:read,groups:read,im:read,mpim:read
Required Params
channel- ID of the conversation to retrieve members for
Optional Params
cursor- Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request'sresponse_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 forchannelwas invalid.fetch_members_failed- Failed to fetch members for the conversation.invalid_cursor- Value passed forcursorwas invalid.invalid_limit- Value passed forlimitwas 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.
Opens or resumes a direct message or multi-person direct message.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:manage,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
Optional Params
channel- Resume a conversation by supplying animormpim's ID. Or provide theusersfield 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 achannelwhen not supplyingusers.
Errors the API can return:
channel_not_found- Value passed forchannelwas 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 opentoo_many_users- Needs at most 8 users to openuser_disabled- A specifieduserhas been disabled.user_not_found- Value(s) passed foruserswas invalid.user_not_visible- The calling user is restricted from seeing the requested user.users_list_not_supplied- Missingusersin request
See the Common Errors guide for errors returned by every Web API method.
Renames a conversation.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
Required Params
channel- ID of conversation to renamename- New name for conversation.
Errors the API can return:
channel_not_found- Value passed forchannelwas invalid.invalid_name- Value passed fornamewas invalid.invalid_name_maxlength- Value passed fornameexceeded max length.invalid_name_punctuation- Value passed fornamecontained only punctuation.invalid_name_required- Value passed fornamewas empty.invalid_name_specials- Value passed fornamecontained 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.
Retrieve a thread of messages posted to a conversation
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:history,groups:history,im:history,mpim:history - User token:
channels:history,groups:history,im:history,mpim:history
Required Params
channel- Conversation ID to fetch thread from. Thechannelandtsarguments are always required.tsmust be the timestamp of an existing message.ts- Unique identifier of either a thread’s parent message or a message in the thread.tsmust be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced bytswill return - it is just an ordinary, unthreaded message. Thechannelandtsarguments are always required.tsmust be the timestamp of an existing message.
Optional Params
cursor- Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request'sresponse_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:trueinclusive- Include messages witholdestorlatesttimestamps in results. Ignored unless either timestamp is specified. 0 ex:truelatest- 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:20oldest- Only messages after this Unix timestamp will be included in results.
Errors the API can return:
channel_not_found- Value forchannelwas missing or invalid.invalid_cursor- Value passed forcursorwas not valid or is no longer valid.invalid_metadata_filter_keys- Value passed formetadata_keys_to_includewas invalid. Must be valid json array of strings.invalid_ts_latest- Value passed forlatestwas invalidinvalid_ts_oldest- Value passed foroldestwas invalidlist_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 fortswas missing or invalid.
See the Common Errors guide for errors returned by every Web API method.
Sets the channel description.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
Required Params
channel- Channel to set the description ofpurpose- The description ex:This is the random channel, anything goes!
Errors the API can return:
channel_not_found- Value passed forchannelwas 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.
Sets the topic for a conversation.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
Required Params
channel- Conversation to set the topic oftopic- 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 forchannelwas 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.
Reverses conversation archival.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
channels:manage,channels:write,groups:write,im:write,mpim:write - User token:
channels:write,groups:write,im:write,mpim:write
Required Params
channel- ID of conversation to unarchive
Errors the API can return:
channel_not_found- Value passed forchannelwas 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.