Go to Slack

Deep linking into Slack clients

Your application might live outside of Slack. Perhaps it includes a website, or a mobile application.

Ever wish you could send a user back to a meaningful location in Slack?

Deep linking into your Slack app

Swiftly send users back to work during the installation process by redirecting them to a conversation with your app or bot using app_redirect.

Opening a direct message with your app or bot

Slack apps with bot users or workspace token-based apps can send users right into a conversation with your app.

Combine this feature with channel creation or installation and provide a guided onboarding experience.

Whether you want to send users to a conversation directly after you receive an access token using OAuth or you simply want to link from your website or from within a message, send them to a URL like this:

https://slack.com/app_redirect?app=A1BES823B

When linking to a direct message, the app_redirect URL accepts two parameters:

  • app - your application's unique ID, such as A1BES823B. If invalid, users will be sent to the App Directory instead. Find your Slack app's ID by preserving the app_id field received when using oauth.access or oauth.token. It can also be found while managing your app by inspecting the URL and looking for the alphanumeric ID beginning with A, like A123456.
  • team - the team ID belonging to a target workspace. Useful when you know which workspace the user should be sent to. When no team is provided or the user is not signed in, users will be sent to their default team or asked to sign in.

If your app is marked for distribution but not installed yet, users will be directed to your app's profile in the App Directory.

If your app is not marked for distribution and not yet installed, users will be sent to the app directory.

If your app is installed, users will be sent directly to a conversation with your bot user or workspace token app.

Opening a channel by name or ID

Send users to a specific channel or conversation , whether you know it only by name or have its authentic ID.

We'll handle addressing permissions however you present the request. When a channel is private or otherwise privileged, the logged in user must be a member of that conversation.

If the user does not have access to the channel or the channel does not exist, users will be presented with a HTTP 404 page.

Sending users to a known channel by ID:

https://slack.com/app_redirect?channel=C0VD1QBZB

Sending users to a channel by name:

https://slack.com/app_redirect?channel=release-notes

When linking to a direct message, the app_redirect URL accepts two parameters:

  • channel - The destination channel ID or channel name to send a user to. If invalid or inaccessible, users will receive a 404.
  • team - the team ID belonging to a target workspace. Useful when you know which workspace the user should be sent to. When no team is provided or the user is not signed in, users will be sent to their default team or asked to sign in.

Deep linking with slack://

Use the slack:// URI scheme to deep link into a user's native Slack client on the following operating systems:

Desktop clients

  • Macintosh
  • Windows

Mobile clients

  • iPhone
  • Android

Supported URIs

Sending a user to Slack can be as easy as linking users to these simple URI templates.

To make the best use of these URL patterns, make sure you're keeping tabs on team IDs, channel IDs, user IDs, and file IDs — these schemes do not support workspace subdomains, channel names, or user names. Not even filenames.

For best results, properly URL-encode your query parameters. Unrecognized paths will fall back to slack://open.

Open Slack

slack://open

Open the native Slack client on behalf of the user's default workspace.

slack://open?team={TEAM_ID}

Open Slack and switch workspaces to the specified team. The provided TEAM_ID should be a string, like T12345.

Open a channel

slack://channel?team={TEAM_ID}&id={CHANNEL_ID}

Open the channel specified by the CHANNEL_ID provided in the id field, like C024BE91L. You must also specify the team with a TEAM_ID.

There's another Another way to accomplish this without needing the team ID.

Open a direct message

slack://user?team={TEAM_ID}&id={USER_ID}

Open a direct message with the presented USER_ID value of the id field. You must also specify a team with a TEAM_ID.

Open a file

slack://file?team={TEAM_ID}&id={FILE_ID}

Open the file specified by FILE_ID value of the id field. Don't forget to also specify a team with a TEAM_ID.

Search

You can even send the user directly to a specific search query from your application.

Find information on how to build your queries in this guide on search queries as well as our super advanced search guide.

Simple queries

Open the specified team (by TEAM_ID) and search for the given query (STRING_QUERY).

slack://search?team={TEAM_ID}&query={STRING_QUERY}

Suppose we wanted to know the location of the stolen microfilm, we might simply open the following URL:

slack://search?team=T12345&query=microfilm%20found
Advanced search

On some platforms, you may also deep link to a more advanced form of search, offering control over pagination and sorting.

slack://search?team={TEAM_ID}&query={STRING_QUERY}&sort={STRING_TIMESTAMP}&highlight={BOOL}&count={INT}&page={INT}`

You already know about the team and query parameters previously introduced. To perform an advanced search, you can also provide:

  • sort - specify an epoch time value or message timestamp and we'll narrow the history to around that time.
  • highlight - specify 0 (false) or 1 (true) to control whether matching terms should be highlighted.
  • count - paginate results this many results at a time
  • page - navigate to this specific page of results

Sorry, performing advanced searches with slack://search is not yet available on Android.

Link to messages

Easily generate a permalink URL for any message using chat.getPermalink. All you need is the channel/conversation ID and the message's ts.

Example workflows

  • Your company's internal wiki includes a "getting started" guide for new employees. Encourage them to easily join the right channels with slack://channel and find canonical discussions with slack://search.
  • Your app highlights topical content and includes a link to slack://search for discussions about a percolative article or emergent internet sensation.
  • Your app's conversational UI lives in Slack, so you use slack://user to open your ongoing direct message correspondence with your user.
  • Send users directly back to Slack after app installation, by sending them to a conversation with your app.