4.5 KiB
| title | description | contentType |
|---|---|---|
| Slack credentials | Documentation for Slack credentials. Use these credentials to authenticate Slack in n8n, a workflow automation platform. | integration |
Slack credentials
You can use these credentials to authenticate the following nodes:
Prerequisites
- Create a Slack{:target=_blank .external-link} account.
- Create a Slack app. Refer to the Slack API Quickstart{:target=_blank .external-link} for more information.
Supported authentication methods
- API access token
- OAuth2
Related resources
Refer to Slack's API documentation{:target=_blank .external-link} for more information about the service.
Using API access token
To configure this credential, you'll need:
- An Access Token
To generate an access token, create a Slack app:
-
Open your Slack API Apps{:target=_blank .external-link} page.
-
Select Create New App > From scratch.
-
Enter an App Name.
-
Select the Workspace where you'll be developing your app.
-
Select Create App.
-
In Basic Information > Building Apps for Slack, select Add features and functionality.
-
Select Permissions.
-
In the Scopes section:
- If you want your app to act on behalf of users who authorize the app, add the required scopes under the User Token Scopes section.
- If you're building a bot, add the required scopes under the Bot Token Scopes section.
/// note | Scopes Scopes determine what permissions an app has. Refer to Slack's Permission scopes{:target=_blank .external-link} documentation for a list of scopes. ///
-
After you've added scopes, go up to the OAuth Tokens for Your Workspace section and select Install to Workspace. You must be a Slack workspace admin to complete this action.
-
Select Allow.
-
You'll return to the OAuth Tokens for your Workspace section, which now displays a Bot User OAuth Token.
-
Copy that token and enter it into the n8n credential.
Refer to the Slack API Quickstart{:target=_blank .external-link} for more information.
Using OAuth2
--8<-- "_snippets/integrations/builtin/credentials/cloud-oauth-button.md"
If you need to configure OAuth2 from scratch, you'll need:
- A Client ID
- A Client Secret
To get both, create a Slack app:
-
Open your Slack API Apps{:target=_blank .external-link} page.
-
Select Create New App > From scratch.
-
Enter an App Name.
-
Select the Workspace where you'll be developing your app.
-
Select Create App.
-
In Basic Information, open the App Credentials section.
-
Copy the Client ID and Client Secret. Paste these into the corresponding fields in n8n.
-
In Basic Information > Building Apps for Slack, select Add features and functionality.
-
Select Permissions.
-
In the Redirect URLs section, select Add New Redirect URL.
-
Copy the OAuth Callback URL from n8n and enter it as the new Redirect URL in Slack.
-
Select Add.
-
Select Save URLs.
-
In the Scopes section:
- If you want your app to act on behalf of users who authorize the app, add the required scopes under the User Token Scopes section.
- If you're building a bot, add the required scopes under the Bot Token Scopes section.
/// note | Scopes Scopes determine what permissions an app has. Refer to Slack's Permission scopes{:target=_blank .external-link} documentation for a list of scopes. ///
-
After you've added scopes, go up to the OAuth Tokens for Your Workspace section and select Install to Workspace. You must be a Slack workspace admin to complete this action.
-
Select Allow.
-
At this point, you should be able select the OAuth button in your n8n credential to connect.
Refer to the Slack API Quickstart{:target=_blank .external-link} for more information. Refer to the Slack Installing with OAuth{:target=_blank .external-link} documentation for more details on the OAuth flow itself.