Slack. Web. Admin. Conversations
(SlackKit v1.0.0-alpha.0)
View Source
Summary
Functions
Archive a public or private channel.
Archive public or private channels in bulk.
Delete public or private channels in bulk
Move public or private channels in bulk.
Exclude channels from Slack AI in bulk
Convert a public channel to a private channel.
Convert a private channel to a public channel.
Create a public or private channel-based conversation.
Create a Salesforce channel for the corresponding object provided.
Delete a public or private channel.
Disconnect a connected channel from one or more workspaces.
Get conversation preferences for a public or private channel.
This API endpoint can be used by any admin to get a conversation's retention policy.
Get all the workspaces a given public or private channel is connected to within this Enterprise org.
Invite a user to a public or private channel.
Link a Salesforce record to a channel
Returns channels on the given team using the filters.
This API endpoint can be used by any admin to remove a conversation's retention policy.
Rename a public or private channel.
Search for public or private channels in an Enterprise organization.
Set the posting permissions for a public or private channel.
This API endpoint can be used by any admin to set a conversation's retention policy.
Set the workspaces in an Enterprise org that connect to a public or private channel.
Unarchive a public or private channel.
Unlink a Salesforce record from a channel
Functions
Archive a public or private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel to archive. ex:C12345
Errors the API can return:
already_archived- This channel has already been archived.cant_archive_general- You cannot archive the 'general' channel.channel_not_found- The value passed forchannelwas invalid.channel_type_not_supported- The value passed forchannelwas an MPDM, DM, or the 'general' channel.could_not_archive_channel- The provided channel could not be archived.default_org_wide_channel- The default org-wide channel cannot be archived.feature_not_enabled- The token provided does not have access to this method.restricted_action- A workspace preference prevents the authenticated user from archiving this channel.
See the Common Errors guide for errors returned by every Web API method.
Archive public or private channels in bulk.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_ids- An array of channel IDs to archive. No more than 100 items are allowed.
Errors the API can return:
action_already_in_progress- Another bulk action request is currently in progressinvalid_enterprise- Enterprise does not existno_valid_channels- All input channels are invalidrestricted_action- User does not have permission to perform this actionteam_not_found- Team ID provided does not exist
See the Common Errors guide for errors returned by every Web API method.
Delete public or private channels in bulk
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_ids- An array of channel IDs.
Errors the API can return:
action_already_in_progress- Another bulk action request is currently in progressno_valid_channels- All input channels are invalidrestricted_action- User does not have permission to perform this action
See the Common Errors guide for errors returned by every Web API method.
Move public or private channels in bulk.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_ids- An array of channel IDs.target_team_id- Target team ID
Errors the API can return:
action_already_in_progress- Another bulk action request is currently in progressno_valid_channels- All input channels are invalidrestricted_action- User does not have permission to perform this actiontarget_team_not_found- Target team ID provided does not existteam_not_found- Target team cannot be found
See the Common Errors guide for errors returned by every Web API method.
Exclude channels from Slack AI in bulk
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_ids- An array of channel IDs to exclude from Slack AI. ex:["C12345", "C98765"]exclude- Whether the channels should be excluded from Slack AI. ex:true
Errors the API can return:
action_already_in_progress- Another bulk action request is currently in progressfeature_not_enabled- The feature is not enabledno_valid_channels- All input channels are invalidrestricted_action- User does not have permission to perform this action
See the Common Errors guide for errors returned by every Web API method.
Convert a public channel to a private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel to convert to private. ex:C12345
Optional Params
name- Name of private channel to create. Only respected when converting an MPIM. ex:new_private_channel_name
Errors the API can return:
channel_not_found- The value passed forchannelwas invalid.channel_type_not_supported- The value passed forchannelwas a DM, MPDM, private, or the 'general' channel.could_not_convert_channel- This channel could not be converted to private.default_org_wide_channel- The default org-wide channel cannot be converted to private.external_channel_migrating- This external channel is migrating, so it can't be converted to private.feature_not_enabled- The provided token doesn't have access to this method.method_not_supported_for_channel_type- This type of conversation cannot be used with this method.name_taken- A private channel cannot be created with the given name.restricted_action- A workspace preference prevents the authenticated user from creating private channels.
See the Common Errors guide for errors returned by every Web API method.
Convert a private channel to a public channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel to convert to public. ex:C12345
Errors the API can return:
channel_not_found- The channel requested for conversion to public could not be found.channel_owner_restriction- away-side SC conversion fails due to home-side being privatecould_not_convert_channel- This channel could not be converted to public.external_limited_restriction- away-side SC conversion fails due to being under Limited Access (“external_limited” aka “can only post”)feature_not_enabled- The feature has not been enabled for this Organizationinvalid_user- Value passed foruser_idwas not validis_idp_managed- The channel cannot be converted because it is IDP Managednot_an_enterprise- Only enterprises can convert channel to public.not_supported- Conversion to public channel is not supported for this channel.restricted_action- This user is not able to convert this channel to public.
See the Common Errors guide for errors returned by every Web API method.
Create a public or private channel-based conversation.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
is_private- Whentrue, creates a private channel instead of a public channel ex:truename- Name of the public or private channel to create. ex:mychannel
Optional Params
description- Description of the public or private channel to create. ex:It's a good channel, Bront.org_wide- Whentrue, the channel will be available org-wide. Note: if the channel is notorg_wide=true, you must specify ateam_idfor this channel ex:trueteam_id- The workspace to create the channel in. Note: this argument is required unless you setorg_wide=true.
Errors the API can return:
could_not_create_channel- The channel could not be created.feature_not_enabled- The token provided doesn't have access to this method.invalid_name- The value passed fornamewas invalid.invalid_team- The provided workspace is invalid.name_taken- A channel cannot be created with the given name.no_local_user_on_team- The workspace provided had no users.restricted_action- A workspace preference prevents the authenticated user from creating channels.team_id_or_org_required- You must provide ateam_idor setorg_widetotrue.team_not_found- No workspace was found for theteam_idprovided.
See the Common Errors guide for errors returned by every Web API method.
Create a Salesforce channel for the corresponding object provided.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:manage_objects
Required Params
object_id- Object / Record ID (15 or 18 digit accepted). See here for how to look up an ID. ex:0019000000DmehKAARsalesforce_org_id- Salesforce org ID (15 or 18 digit accepted). See here for how to look up Salesforce org ID. ex:00DGC00000024hsuWY
Optional Params
invite_object_team- Optional flag to add all team members related to the object to the newly created Salesforce channel. When true, adds a maximum of 100 team members to the channel. ex:true
Errors the API can return:
channel_already_exists- Object is linked to a different channel.feature_not_enabled- Feature not enabled.invalid_org_id- Value passed forsalesforce_org_idis invalid.missing_record_channel_config- Record Channels are not enabled for the given object type.record_not_found- Value passed forobject_idis invalid.restricted_action- User does not have access to perform this action.
See the Common Errors guide for errors returned by every Web API method.
Delete a public or private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel to delete. ex:C12345
Errors the API can return:
channel_not_found- The value passed forchannel_idwas invalid.channel_type_not_supported- The providedchannel_idwas a DM, MPDM, or the 'general' channel.could_not_delete_channel- The channel could not be deleted.default_org_wide_channel- The default org-wide channel cannot be deleted.feature_not_enabled- The token provided doesn't have access to this method.not_an_admin- The token provided is not associated with an Org Owner or Admin.restricted_action- A workspace preference prevents the authenticated user from deleting this channel.
See the Common Errors guide for errors returned by every Web API method.
Get conversation preferences for a public or private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:read
Required Params
channel_id- The channel to get preferences for. ex:C12345
Errors the API can return:
channel_not_found- The value passed forchannel_idwas invalid.channel_type_not_supported- The providedchannel_idwas a DM, MPDM, or the 'general' channel.could_not_get_conversation_prefs- There was an error getting the conversation preferences for this channel.feature_not_enabled- The token provided does not have access to this method.not_an_admin- The token provided is not associated with an Org Admin or Owner.not_an_enterprise- This endpoint can only be called by an Enterprise organization.restricted_action- A workspace preference prevents the authenticated user from listing preferences.
See the Common Errors guide for errors returned by every Web API method.
This API endpoint can be used by any admin to get a conversation's retention policy.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:read
Required Params
channel_id- The conversation to get the retention policy for. ex:C12345678
Errors the API can return:
channel_not_found- Value given forchannel_idwas invalid.channel_type_not_supported- Value given forchannel_idwas a #general channel.could_not_get_retention- The retention policy could not be retrieved.default_org_wide_channel- The channel given is a default org-wide channel.feature_not_enabled- The Admin APIs feature is not enabled for this team.not_an_admin- The token provided is not associated with an org admin.restricted_action- A team preference prevents the authenticated user from modifying the retention policy of this channel.retention_override_not_allowed- The current org retention policy disallows modifying the retention policy of this channel.
See the Common Errors guide for errors returned by every Web API method.
Get all the workspaces a given public or private channel is connected to within this Enterprise org.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- User token:
admin.conversations:read
Required Params
channel_id- The channel to determine connected workspaces within the organization for. ex:C12345
Optional Params
cursor- Setcursortonext_cursorreturned by the previous call to list items in the next page ex:5c3e53d5limit- The maximum number of items to return. Must be between 1 - 1000 both inclusive. ex:100
Errors the API can return:
channel_not_found- The channel wasn't found or isn't connected to multiple workspaces.channel_type_not_supported- Thechannel_idprovided was a DM, MPDM, or the 'general' channel.could_not_get_teams- Could not fetch the workspaces that the channel is shared with in this organization.external_channel_migrating- The channel is actively being migratedfeature_not_enabled- The token provided doesn't have access to this method.invalid_cursor- The provided cursor wasn't valid.invalid_limit- The value passed forlimitwasn't valid.restricted_action- A workspace preference prevents the authenticated user from listing the workspaces connected to a channel.unsupported_team_type- This endpoint can only called by Enterprise organizations.
See the Common Errors guide for errors returned by every Web API method.
Invite a user to a public or private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel that the users will be invited to. ex:C12345user_ids- The users to invite. ex:U1234,U2345,U3456
Errors the API can return:
channel_not_found- The value passed forchannel_idwas invalid.channel_type_not_supported- The providedchannel_idwas a DM, MPDM, or the 'general' channel.default_org_wide_channel- Users may not be invited to the default org-wide channel.failed_for_some_users- The method failed for a subset of the users passed.feature_not_enabled- The token provided doesn't have access to this method.restricted_action- A workspace preference prevents the authenticated user from inviting.user_must_be_admin- The token provided must be associated with an Org Admin or Owner.
See the Common Errors guide for errors returned by every Web API method.
Link a Salesforce record to a channel
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:manage_objects
Required Params
channel- Channel ID for Slack channel that will be linked to a Salesforce record.record_id- Salesforce record ID (15 or 18 digit accepted). See here for how to look up record ID. ex:0019000000DmehKAARsalesforce_org_id- Salesforce org ID (15 or 18 digit accepted). See here for how to look up Salesforce org ID. ex:00DGC00000024hsuWY
Errors the API can return:
channel_already_exists- Object is linked to a different channel.channel_conversion_incomplete- An active channel conversion is preventing linking.channel_is_archived- Channel is archived.channel_not_found- Value passed forchannelis invalid.channel_not_org_wide_shared- Channel is not Org-wide shared.channel_shared_with_nonapproved_team- Channel is shared with a non-approved external team.invalid_channel_type- Channel type cannot be linked.name_taken- A channel cannot be created with the given name.not_allowed_for_grid_workspace- Channel type is not allowed for this Enterprise org workspace.record_channel_already_exists- Record is linked to a different channel.record_not_found- Value passed forrecord_idis invalid.restricted_action- User does not have access to perform this action.
See the Common Errors guide for errors returned by every Web API method.
Returns channels on the given team using the filters.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:read
Required Params
last_message_activity_before- Filter by public channels where the most recent message was sent before last_message_activityteam_ids- Array of team IDs to filter by
Optional Params
cursor- Setcursortonext_cursorreturned in the previous call, to fetch the next page.limit- Maximum number of resultsmax_member_count- Filter by public channels with member count equal to or less than the specified number
Errors the API can return:
feature_not_enabled- The feature is not enabledinvalid_cursor- Value passed forcursorwas not valid or is no longer valid.no_valid_teams- The team_ids argument doesn't contain any valid teams
See the Common Errors guide for errors returned by every Web API method.
This API endpoint can be used by any admin to remove a conversation's retention policy.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The conversation to set the retention policy for. ex:C12345678
Errors the API can return:
channel_not_found- Value given forchannel_idwas invalid.channel_type_not_supported- Value given forchannel_idwas a #general channel.could_not_remove_retention- The retention policy could not be removed.default_org_wide_channel- The channel given is a default org-wide channel.feature_not_enabled- The Admin APIs feature is not enabled for this team.not_an_admin- The token provided is not associated with an admin.restricted_action- A team preference prevents the authenticated user from modifying the retention policy of this channel.retention_override_not_allowed- The current retention policy disallows modifying the retention policy of this channel.
See the Common Errors guide for errors returned by every Web API method.
Rename a public or private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel to rename. ex:C12345name-
Errors the API can return:
channel_not_found- The value passed forchannel_idwas invalid.channel_type_not_supported- The providedchannel_idwas a DM, MPDM, or the 'general' channel.could_not_rename_channel- The channel could not be renamed.default_org_wide_channel- The default org-wide channel can't be renamed.feature_not_enabled- The token provided doesn't have access to this method.invalid_name_maxlength- The channel name exceeds the maximum allowed length.name_taken- The channel's name is already being used elsewhere.restricted_action- A workspace preference prevents the authenticated user from renaming a channel.
See the Common Errors guide for errors returned by every Web API method.
Search for public or private channels in an Enterprise organization.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:read
Optional Params
connected_team_ids- Array of encoded team IDs, signifying the external orgs to search through. ex:['T00000000','T00000001']cursor- Setcursortonext_cursorreturned by the previous call to list items in the next page. ex:dXNlcjpVMEc5V0ZYTlo=limit- Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10. ex:20query- Name of the the channel to query by. ex:announcementsearch_channel_types- The type of channel to include or exclude in the search. For exampleprivatewill search private channels, whileprivate_excludewill exclude them. For a full list of types, check the Types section. ex:private,archivedsort- Possible values arerelevant(search ranking based on what we think is closest),name(alphabetical),member_count(number of users in the channel), andcreated(date channel was created). You can optionally pair this with thesort_dirarg to change how it is sorted ex:namesort_dir- Sort direction. Possible values areascfor ascending order like (1, 2, 3) or (a, b, c), anddescfor descending order like (3, 2, 1) or (c, b, a) ex:ascteam_ids- Comma separated string of team IDs, signifying the internal workspaces to search through. ex:T00000000,T00000001total_count_only- Only return the total_count of channels. Omits channel data and allows access for admins without channel manager permissions.
Errors the API can return:
connected_team_passed_in_is_not_top_level_team- One of the orgs provided in the external connected teams filter is not a top level team.external_team_not_connected_to_this_org- One of the teams provided in the external connected teams filter is not connected to the org.feature_not_enabled- The token provided doesn't have access to this method.invalid_cursor- The provided cursor is not valid, often due to not urlencoding query parameters.invalid_search_channel_type- An invalidsearch_channel_typesarg was passed. Make sure there are no spaces between your args and that each is one of the enumerated options listed above.invalid_sort- The providedsortargument wasn't valid.invalid_sort_dir- The providedsort_dirargument wasn't valid.not_allowed- The authenticated user does not have the permission to call this method.not_an_admin- The token provided is not associated with an Org Admin or Owner.not_an_enterprise- This endpoint can only be called by an Enterprise organization.team_not_found- One of the workspaces provided in the list wasn't found.
See the Common Errors guide for errors returned by every Web API method.
Set the posting permissions for a public or private channel.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel to set the prefs for ex:C1234prefs- The prefs for this channel in a stringified JSON format. ex:{'who_can_post':'type:admin,user:U1234'}
Errors the API can return:
channel_mention_sync_required- If setting channel mention restriction prefs, both mention prefs must be passed and they must be the same value.channel_not_found- Value passed forchannelwas invalid.channel_type_not_supported- Value given forchannel_idwas a #general channel.could_not_set_channel_pref- Setting the preference or permission failed.default_org_wide_channel- Returned when you try to modify a default org wide channel.feature_not_enabled- The Admin APIs feature is not enabled for this team.invalid_value- Value passed for the preferences are invalidnot_an_admin- The token provided is not associated with an org admin.restricted_action- A workspace preference prevents the authenticated user from archiving.
See the Common Errors guide for errors returned by every Web API method.
This API endpoint can be used by any admin to set a conversation's retention policy.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The conversation to set the retention policy for. ex:C12345678duration_days- The message retention duration in days to set for this conversation ex:500
Errors the API can return:
channel_not_found- Value given forchannel_idwas invalid.channel_type_not_supported- Value given forchannel_idwas a group dm, direct message, or #general channel.could_not_set_retention- The retention policy could not be set.default_org_wide_channel- The channel given is a default org-wide channel.feature_not_enabled- The Admin APIs feature is not enabled for this team.invalid_duration- Retentionduration_daysmust be an integer greater than 0 days and less than 36500 days (100 years).not_an_admin- The token provided is not associated with an admin.restricted_action- A team preference prevents the authenticated user from modifying the retention policy of this channel.retention_override_not_allowed- The current retention policy disallows modifying the retention policy of this channel.
See the Common Errors guide for errors returned by every Web API method.
Set the workspaces in an Enterprise org that connect to a public or private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The encodedchannel_idto add or remove to workspaces. When used with theteam_idparameter, this method sets the requestedchannel_idas a regular channel on theteam_idworkspace. When used with thetarget_team_idsparameter, this method sets the requestedchannel_idas a cross-workspace shared channel.
Optional Params
org_channel- True if channel has to be converted to an org channel ex:truetarget_team_ids- A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide. When used with thetarget_team_idsparameter, this method sets the requestedchannel_idas a cross-workspace shared channel. ex:T1234,T5678,T9012,T3456team_id- The workspace to which the channel belongs if the channel is a local workspace channel. Omit this argument if the channel is a cross-workspace or org-wide shared channel. When used with theteam_idparameter, this method sets the requestedchannel_idas a regular channel on theteam_idworkspace.
Errors the API can return:
cannot_add_legacy_disconnected_channel_to_workspaces- Cannot add legacy disconnected channel to workspacescannot_move_local_channel- This API cannot be used to move a local channel from one workspace to another.channel_cannot_be_unshared- Channel cannot be unshared from this workspace.channel_not_found- The channel wasn't found or isn't shared to this workspace.channel_type_not_supported- The requestedchannel_idis not a supported type of channel.could_not_set_teams_for_channel- The requestedchannel_idhas not been shared with the target workspace.default_org_wide_channel- Default org wide channel cannot be unshared from a workspace.externally_shared_or_disconnected_channel- The channel is or was externally shared.invalid_channel_id-channel_idwas invalid.invalid_target_team- Target workspace is invalid.managed_channel_not_supported- Cannot unshare a managed channelname_taken- The proposed new name for the channel is already in use within your organization.not_allowed_for_grid_workspace- Slack Connect is not allowed for this Enterprise org workspacenot_enabled- The API endpoint is not enabled for your team.restricted_action- The caller of this API is not allowed to perform this operation.too_many_target_teams- Too manytarget_team_idswere provided.unsupported_arguments- The provided method arguments are not supported.
See the Common Errors guide for errors returned by every Web API method.
Unarchive a public or private channel.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:write
Required Params
channel_id- The channel to unarchive. ex:C12345
Errors the API can return:
channel_not_archived- The passed channel is not currently archived.channel_not_found- The value passed forchannel_idwas invalid.channel_type_not_supported- The value passed forchannelwas a DM, MPDM, or the 'general' channelcould_not_unarchive_channel- The channel could not be unarchived.default_org_wide_channel- You can't unarchive a default org-wide channel.feature_not_enabled- The token provided doesn't have access to this method.restricted_action- A workspace preference prevents the authenticated user from unarchiving.
See the Common Errors guide for errors returned by every Web API method.
Unlink a Salesforce record from a channel
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
admin.conversations:manage_objects
Required Params
channel- Channel ID for Slack channel that will be unlinked from the Salesforce record.new_name- Channel name you would like to give to the channel that is being unlinked from the Salesforce record.
Errors the API can return:
channel_not_found- Value passed forchannelis invalid.invalid_name_specials- Value passed fornamecontained unallowed special characters or upper case characters.name_taken- A channel cannot be created with the given name.restricted_action- User does not have access to perform this action.
See the Common Errors guide for errors returned by every Web API method.