> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> Connect your AI Agents to Slack for team communication and workflow automation.

Connect your AI Agents to Slack for team communication and workflow automation.

## Connect Slack to Auth0

**1. Slack setup**

<ol>
  <li>
    Sign up for a [Slack Developer account](https://slack.com/signin).
  </li>

  <li>
    If you haven't already, create a [Slack
    App](https://api.slack.com/apps?new_app=1). Choose the **From scratch**
    option, give it a name and choose a workspace.
  </li>

  <li>
    Once your app is created, copy the **Client ID** and **Client Secret**.
  </li>

  <li>
    In the **OAuth & Permissions** section on the left side navigation, do
    the following:

    <ol>
      <li>
        Under **OAuth Tokens**, select **Token Rotation** to opt in so that the app
        supports refresh tokens.
      </li>

      <li>
        Under **Redirect URLs**, add
        `https://YOUR_AUTH0_DOMAIN/login/callback` as a new Redirect URL.

        You can find the **Auth0 domain** in the [Auth0 Dashboard](https://manage.auth0.com/).

        You can find this under **Applications > \[Your Application] > Settings > Basic Information > Domain**.

        If you are using the [custom domains](https://auth0.com/docs/customize/custom-domains.md) feature, your Auth0 domain is the custom domain. You can find this under **Branding > Custom Domains**.
      </li>

      <li>
        Under **Scopes**, add the necessary OAuth scopes your app needs to
        function.
      </li>
    </ol>
  </li>
</ol>

**2. Auth0 setup**

<ol>
  <li>
    In the [Auth0 Dashboard](https://manage.auth0.com/), navigate to
    **Authentication > Social**. Select **Create Connection** and then
    **Sign in with Slack**. Select **Continue**.
  </li>

  <li>
    In **General**, enter the **Client ID** and **Client Secret** from the
    Slack OAuth app you created.
  </li>

  <li>
    In **Purpose**, toggle on **Connected Accounts for Token Vault**. This allows the
    connection to retrieve and securely store access tokens for external APIs. To learn more, read [Configure Connected Accounts for Token Vault](https://auth0.com/docs/secure/call-apis-on-users-behalf/token-vault/connected-accounts-for-token-vault.md).
  </li>

  <li>Select **Create**.</li>

  <li>
    After saving, go to the **Applications** tab and select the applications
    that should use this connection.
  </li>
</ol>

If your application uses [Organizations](https://auth0.com/docs/manage-users/organizations.md), authenticate the user with the target organization before initiating the Connected Accounts flow. Token Vault still stores the Slack connected account on the user's Auth0 profile, so each organization member authorizes their own Slack account.

This guide walks you through setting up the **Slack** connection in Auth0.
For an end-to-end example that shows how to set up your app to call third-party APIs on the user's behalf
using a connection like this, read the
[Call third-party APIs on user's behalf quickstart](https://auth0.com/ai/docs/get-started/call-third-party-apis-on-users-behalf.md).

## Token Vault configuration example

To configure the Token Vault for your Slack connection, you can use the following code snippet in your application:

**JavaScript**

**Python**

## Next steps

* To learn how to configure applications to access Token Vault, read [Configure Token Vault](https://auth0.com/docs/secure/call-apis-on-users-behalf/token-vault/configure-token-vault.md).
* If your application uses [Organizations](https://auth0.com/docs/manage-users/organizations.md), authenticate the user with the target organization before initiating the Connected Accounts flow. Connected accounts remain linked to the individual user profile.
* To learn how to get an access token to make a tool call, complete the [Call third-party APIs on user's behalf Quickstart](https://auth0.com/ai/docs/get-started/call-third-party-apis-on-users-behalf.md).
