Credentials
Slack credentials

Slack credentials

You can use these credentials to authenticate the following nodes:

Supported authentication methods

  • API access token:
  • OAuth2:

Related resources

Refer to Slack's API documentation (opens in a new tab) for more information about the service.

Using API access token

To configure this credential, you'll need a Slack (opens in a new tab) account and:

  • An Access Token

To generate an access token, create a Slack app:

  1. Open your Slack API Apps (opens in a new tab) page.
  2. Select Create New App > From scratch.
  3. Enter an App Name.
  4. Select the Workspace where you'll be developing your app.
  5. Select Create App. The app details open.
  6. In the left menu under Features, select OAuth & Permissions.
  7. In the Scopes section, select appropriate scopes for your app. Refer to Scopes for a list of recommended scopes.
  8. After you've added scopes, go up to the OAuth Tokens section and select Install to Workspace. You must be a Slack workspace admin to complete this action.
  9. Select Allow.
  10. Copy the Bot User OAuth Token and enter it as the Access Token in your n8n credential.
  11. If you're using this credential for the Slack Trigger, follow the steps in Slack Trigger configuration to finish setting up your app.

Refer to the Slack API Quickstart (opens in a new tab) for more information.

Slack Trigger configuration

To use your Slack app with the Slack Trigger node:

  1. Go to Your Apps (opens in a new tab) in Slack and select the app you want to use.
  2. Go to Features > Event Subscriptions.
  3. Turn on the Enable Events control.
  4. In n8n, copy the Webhook URL and enter it as the Request URL in your Slack app.

Request URL: Slack only allows one request URL per app. If you want to test your workflow, you'll need to do one of the following:

  • Test with your Test URL first, then change your Slack app to use the Production URL once you've verified everything's working
  • Use the Production URL with execution logging.
  1. Once verified, select the bot events to subscribe to. Use the Trigger on field in n8n to filter these requests.
    • To use an event not in the list, add it as a bot event and select Any Event in the n8n node.

Refer to Quickstart | Configuring the app for event listening (opens in a new tab) for more information.

n8n recommends enabling request signature verification for your Slack Trigger for additional security:

  1. Go to Your Apps (opens in a new tab) in Slack and select the app you want to use.
  2. Go to Settings > Basic Information.
  3. Copy the value of Signing.
  4. In n8n, Paste this value into the Signature Secret field for the credential.

Using OAuth2

If you're self-hosting n8n and need to configure OAuth2 from scratch, you'll need a Slack (opens in a new tab) account and:

  • A Client ID
  • A Client Secret

To get both, create a Slack app:

  1. Open your Slack API Apps (opens in a new tab) page.
  2. Select Create New App > From scratch.
  3. Enter an App Name.
  4. Select the Workspace where you'll be developing your app.
  5. Select Create App. The app details open.
  6. In Settings > Basic Information, open the App Credentials section.
  7. Copy the Client ID and Client Secret. Paste these into the corresponding fields in n8n.
  8. In the left menu under Features, select OAuth & Permissions.
  9. In the Redirect URLs section, select Add New Redirect URL.
  10. Copy the OAuth Callback URL from n8n and enter it as the new Redirect URL in Slack.
  11. Select Add.
  12. Select Save URLs.
  13. In the Scopes section, select appropriate scopes for your app. Refer to Scopes for a list of scopes.
  14. After you've added scopes, go up to the OAuth Tokens section and select Install to Workspace. You must be a Slack workspace admin to complete this action.
  15. Select Allow.
  16. At this point, you should be able to select the OAuth button in your n8n credential to connect.

Refer to the Slack API Quickstart (opens in a new tab) for more information. Refer to the Slack Installing with OAuth (opens in a new tab) documentation for more details on the OAuth flow itself.

Scopes

Scopes determine what permissions an app has.

  • 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.

Here's the list of scopes the OAuth credential requires, which are a good starting point:

Scope nameNotes
channels:read
channels:writeNot available as a bot token scope
channels:history
chat:write
files:read
files:write
groups:read
groups:history
im:read
im:history
mpim:read
mpim:history
reactions:read
reactions:write
stars:readNot available as a bot token scope
stars:writeNot available as a bot token scope
usergroups:read
usergroups:write
users.profile:read
users.profile:writeNot available as a bot token scope
users:read
search:read

Common issues

Token expired