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

# Connecting Slack to your app

> Connect Slack to your app to send messages as a person or a bot.

Connect your app to [Slack](https://base44.com/integrations/connectors/slack) to send messages, respond to events, and trigger workflows, either as the person who connected Slack or as a bot you name and style.

***

## What you can do

Keep your team informed with messages and updates from your app.

> [card] Post to channels
>
> Send updates or announcements to a channel when something happens in your app.

> [card] Notify teammates
>
> Send an alert the moment a ticket, deadline, or threshold is hit.

> [card] Automate updates
>
> Send recurring digests, reminders, and summaries from your app on a schedule.

**Example prompts for Slack User**

Describe the channel, the message, what triggers it, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Post a message to the #support channel when a new ticket is created.
```

```text wrap theme={null}
Send a daily summary of completed tasks to my team's Slack channel.
```

```text wrap theme={null}
Show which channels I can post to so I can choose where updates go.
```

```text wrap theme={null}
Notify me in Slack when a sale is made in my app.
```

```text wrap theme={null}
Share important updates in the #announcements channel when a document is approved.
```

**Example prompts for Slack Bot**

Describe the channel, the bot's message, what triggers it, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Post a message to #deployments when a new release is published.
```

```text wrap theme={null}
Send a reminder to a channel when a task deadline is approaching.
```

```text wrap theme={null}
Post an alert to a channel with a custom bot name and icon.
```

```text wrap theme={null}
Notify a channel when a new order is placed.
```

```text wrap theme={null}
Post a daily standup summary to the team channel.
```

***

## Connecting Slack User

Connect Slack User so your app can post as the person who connected it.

> [tab] Shared connector
>
> You connect one account once, and everyone who uses your app shares that connection and its data.
>
> **To add a shared Slack User connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
> 2. Click **Add connector**.
> 3. Search for **Slack User** and click it.
> 4. Select **Shared connector**, then click **Next**.
> 5. Enter a **Connection name**. For Slack, **Who can access** is always **Apps only**.
> 6. Choose the [scopes](#slack-user-scopes) your app needs under **Permissions**:
>    * **Read-only:** Your app can view data. This is the default.
>    * **Read & write:** Your app can also send, create or change data. To post messages, choose this.
>    * **Custom:** Select the optional permissions your app needs. Required permissions stay selected.
> 7. Click **Add connector**, then authorize the Slack workspace you want to post to.

> [tab] App user connector
>
> Each person connects their own Slack account, so your app can act on their behalf.
>
> > [!WARNING]
> >
> > Only workspace owners and admins can set up an app user connector.
>
> > [!TIP]
> >
> > **Before you set up an app user connector:** You need your own OAuth client. See [Using your own OAuth client](https://docs.base44.com/Integrations/Connectors.md#using-your-own-oauth-client).
>
> **To add an app user Slack User connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
> 2. Click **Add connector**.
> 3. Search for **Slack User** and click it.
> 4. Select **App user connector**, then click **Next**.
> 5. Copy the **Callback URL** and add it to your Slack app's allowed redirect URIs.
> 6. Enter a **Connector name**.
> 7. Enter the **Client ID** and **Client Secret** from your Slack app.
> 8. Review the [scopes](#slack-user-scopes) selected by default under **Scopes** and remove any your app doesn't need.
> 9. Click **Add Connector**.
> 10. Open your app in the app editor.
> 11. Ask the AI chat to add a way for people to connect their own Slack account.

***

## Connecting Slack Bot

Connect Slack Bot so your app can post as a bot you name and style.

> [tab] Shared connector
>
> You connect one account once, and everyone who uses your app shares that connection and its data.
>
> **To add a shared Slack Bot connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
> 2. Click **Add connector**.
> 3. Search for **Slack Bot** and click it.
> 4. Select **Shared connector**, then click **Next**.
> 5. Enter a **Connection name**. For Slack, **Who can access** is always **Apps only**.
> 6. (Optional) Select the [scopes](#slack-bot-scopes) your app needs under **Permissions**.
> 7. Click **Add connector**, then authorize the Slack workspace you want the bot to post to.

> [tab] App user connector
>
> Each person connects their own Slack account, so your app's bot can post in their workspace.
>
> > [!WARNING]
> >
> > Only workspace owners and admins can set up an app user connector.
>
> > [!TIP]
> >
> > **Before you set up an app user connector:** You need your own OAuth client. See [Using your own OAuth client](https://docs.base44.com/Integrations/Connectors.md#using-your-own-oauth-client).
>
> **To add an app user Slack Bot connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
> 2. Click **Add connector**.
> 3. Search for **Slack Bot** and click it.
> 4. Select **App user connector**, then click **Next**.
> 5. Copy the **Callback URL** and add it to your Slack app's allowed redirect URIs.
> 6. Enter a **Connector name**.
> 7. Enter the **Client ID** and **Client Secret** from the Slack app your bot posts under.
> 8. Review the [scopes](#slack-bot-scopes) selected by default under **Scopes** and remove any your app doesn't need.
> 9. Click **Add Connector**.
> 10. Open your app in the app editor.
> 11. Ask the AI chat to add a way for people to connect their own Slack account.

> [!NOTE]
>
> To post in a private channel, invite the bot first.

### Customizing the bot identity

You can set the bot's name and icon for each message. Ask the AI chat for the ones you want.

```text wrap theme={null}
Send messages as "Deploy Bot" with a rocket icon.
```

***

## Scopes and permissions

Each connector uses its own scopes, and the 2 sets aren't interchangeable. Selecting a Slack User scope for Slack Bot, or the reverse, causes the connection to fail.

### Slack User scopes

These permissions let your app post as the connected person.

> [card]
>
> **1. Base44 adds**
>
> * `users:read`: View people in the workspace
> * `users:read.email`: View email addresses
>
> **2. You configure**
>
> * For a shared connector, choose **Read-only** (the default), **Read & write** or **Custom** under **Permissions**. To post messages, choose **Read & write**.
> * For an app user connector, `chat:write` is selected by default under **Scopes** to send messages.
> * `channels:read` is selected by default under **Permissions** for a shared connector and **Scopes** for an app user connector, so your app can list public channels, for example to find a channel by name.
>
> **Access:** Messages post as the connected person, with that person's Slack permissions.

### Slack Bot scopes

These permissions let your app post as your bot.

> [card]
>
> **1. Base44 adds**
>
> * `chat:write.customize`: Set the bot's name and icon per message
> * `chat:write.public`: Post to public channels without joining
>
> **2. You configure**
>
> * For a shared connector, select the scopes your app needs under **Permissions**.
> * For an app user connector, `chat:write` is selected by default under **Scopes** to send messages as the bot.
>
> **Access:** Messages post as your bot, with the permissions granted to your Slack app.

***

## Using Slack in a backend function

Once Slack is connected, your backend functions can retrieve an access token and call the Slack API directly. Base44 handles the OAuth flow and token storage.

* For a shared connection, use `getConnection()` to retrieve the token.
* For an app user connection, use `getCurrentAppUserConnection()` so each request uses the signed-in person's token.

```javascript theme={null}
// Slack User: posts as the connected person
const userConn = await base44.asServiceRole.connectors.getConnection("slack");

// Slack Bot: posts as the bot
const botConn = await base44.asServiceRole.connectors.getConnection("slackbot");
```

> [card] [Shared connectors](https://docs.base44.com/developers/backend/resources/connectors/shared-connectors.md)
>
> Configure, deploy, and call a shared connection from a backend function.

> [card] [App user connectors](https://docs.base44.com/developers/backend/resources/connectors/app-user-connectors.md)
>
> Retrieve a per-user token and call the API as the signed-in person.

***

## Troubleshooting

Check scopes and workspace access if Slack can't connect or post messages.

> [accordion] The connection fails with an invalid scope error
>
> Slack User and Slack Bot use different scope sets and can't be mixed. Check that you selected only the scopes listed for the connector you're setting up, and that your Slack app requests those same scopes.

> [accordion] Some people can't connect their Slack User account
>
> If your Slack app isn't distributed, only people in your own Slack workspace can connect. Enable public distribution in your Slack app settings.

***

## FAQs

> [accordion] Can I use Slack User and Slack Bot in the same app?
>
> Yes. They are separate connectors, so add each one you need.

> [accordion] Can I customize what the Slack connector sends?
>
> Yes. Describe the format, content, and timing you want in the AI chat. You can also go to your app's dashboard, click **Code**, and open the generated backend function under `base44` > `functions` to fine-tune the message payload, for example using blocks for more complex layouts.

> [accordion] Can my app still post to Slack with an incoming webhook?
>
> Yes. If your app already posts with a Slack incoming webhook URL saved as a secret, it keeps working. To use a new webhook URL, click **Dashboard** in your app editor, click **Secrets**, update the secret that holds it (usually `SLACK_WEBHOOK_URL`), and [publish your app again](https://docs.base44.com/Integrations/managing-app-secrets.md#applying-your-changes).
>
> To do more with Slack, connect [Slack User](#connecting-slack-user) or [Slack Bot](#connecting-slack-bot). Your app can then post to the channels that person or bot can post in, and respond to events in Slack, such as new messages or mentions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.