# Slack

> Ask the AY Inbox assistant from Slack, work inbox replies in a Slack channel, and route notifications to the right channels.

Source: https://docs.ayinbox.com/guides/slack/

AY Inbox for Slack brings the AI assistant, your inbox replies and AY Inbox notifications into the Slack workspace your team already uses.

Connect Slack [#connect-slack]

<Steps>
  <Step>
    Open **Integrations > Slack** and select **Connect**.
  </Step>

  <Step>
    Pick the Slack workspace and approve the app's permissions.
  </Step>

  <Step>
    Mention `@ayinbox` or message it to link your Slack account. When your Slack email matches your AY Inbox account, it links you automatically.
  </Step>

  <Step>
    Under **Integrations > Slack**, pick a **Default channel** for notifications and, if you want, an **Inbox channel**.
  </Step>
</Steps>

Good to know [#good-to-know]

* Connecting and changing Slack settings need the **Manage settings** permission.
* The assistant acts as you, with your permissions, and asks before changing anything. In a DM, an action your workspace has set to **Always allow** can go ahead without asking again.
* Anything that sends mail to a real recipient needs your approval every time.
* Every member of the inbox channel can read the mail posted there.
* On a self-hosted instance, the operator has to create a Slack app first.

<Fold>
  What AY Inbox for Slack does [#what-ay-inbox-for-slack-does]

  AY Inbox for Slack brings three things into the Slack workspace your team already lives in:

  * **The assistant.** Ask the same [AI assistant](/guides/ai-assistant/) you use in the dashboard by mentioning `@ayinbox` or messaging it, the way you would ask a teammate. It is the same assistant, with the same tools and the same answers, and it acts as you, with your permissions, and asks before changing anything.
  * **Inbox in Slack.** Replies from the [Unibox](/guides/unibox/) land in a channel of your choice, one thread per conversation, where the team can discuss, label, draft and reply.
  * **Notifications.** Post AY Inbox [notifications](/guides/notifications/) to a default channel, route each category to its own channel, and optionally get your own as DMs.

  The app's **Home** tab shows whether your Slack account is linked, with buttons to link or unlink, ask AY Inbox, and open AY Inbox.
</Fold>

<Fold>
  Connect Slack [#connect-slack-1]

  Open **Integrations > Slack** and select **Connect**. Slack asks you to pick the Slack workspace and approve the app's permissions, then returns you to AY Inbox. Connecting and changing Slack settings need the **Manage settings** permission.

  When the connection was made before AY Inbox asked for a permission it now uses, the Slack panel lists the missing permissions and a **Reconnect** button. Reconnecting grants them and keeps your settings and linked accounts.

  <Callout type="info" title="Self-hosted instances need a Slack app first">
    On a self-hosted instance the Slack card stays unavailable until the operator creates the instance's own Slack app. See [Slack app](/development/slack-app/).
  </Callout>
</Fold>

<Fold>
  Link your Slack account [#link-your-slack-account]

  The assistant and the inbox buttons do things in AY Inbox on your behalf, so AY Inbox has to know which AY Inbox member you are. Linking ties your Slack account to your AY Inbox account in this workspace. Until you link, the bot can post notifications and inbox replies but will not act for you.

  Most members never see a link step. When the email on your Slack profile is the email of an AY Inbox account that is a member of the connected workspace, AY Inbox links the two the first time you mention `@ayinbox`, message it, press one of its buttons or open its Home tab. It answers straight away and sends you a DM saying it linked you. The member who connects Slack is linked the same way to the Slack account that approved the install.

  When the emails differ, or Slack does not share yours, you link once:

  1. Ask the bot something: mention `@ayinbox` or message it. The bot sends you a **Link your AY Inbox account** button in a DM. In a channel it also replies in the thread to say it is waiting for you, and the button itself is only ever sent to you.
  2. The button opens AY Inbox. Sign in if you need to, and check the Slack account and the AY Inbox account it shows.
  3. Select **Continue with Slack**. Slack asks you to sign in to the Slack account the button was made for, which proves the account is yours whatever email it uses. When your Slack and AY Inbox emails already match, the button is **Connect account** instead and needs no Slack sign-in.
  4. The bot confirms in that account's DM and answers the question you asked, where you asked it. You do not have to ask again.

  The link button works once and expires after 15 minutes; ask the bot for a new one if it lapses. A question waiting for the link is dropped with it. You can only link to an AY Inbox workspace you are a member of.

  A link button only ever links the Slack account it was made for: either its Slack email is your AY Inbox email (capitalization does not matter), or you signed in to that Slack account with **Continue with Slack**. Signing in to a different Slack account is refused.

  <Callout type="info" title="Automatic linking needs Slack emails">
    Matching by email needs the `users:read` and `users:read.email` permissions. A connection made before AY Inbox asked for them lists them as missing under **Integrations > Slack**. Until someone with **Manage settings** selects **Reconnect**, members link with **Continue with Slack**. Links made before then keep working.
  </Callout>

  A Slack account links to one AY Inbox account at a time. Linking again replaces the previous link. Unlink from the app's Home tab or from **Integrations > Slack** in AY Inbox. If your membership in the workspace ends, the link stops working and the bot asks you to link again.
</Fold>

<Fold>
  The assistant [#the-assistant]

  Where to ask [#where-to-ask]

  | Where          | How                                                                                                                                               |
  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Direct message | Open the AY Inbox app in Slack and write in its **Messages** tab                                                                                  |
  | Assistant pane | Open AY Inbox from Slack's AI apps entry to chat in a side pane next to whatever you are reading. It offers a few suggested prompts to start from |
  | A channel      | Mention `@ayinbox` with your question. It answers in a thread, and you continue by replying in that thread                                        |
  | On a message   | Choose **Ask AY Inbox about this** from the message's **More actions** menu. The assistant starts a thread with that message as context           |

  To use it in a channel, the bot has to be a member: invite it with `/invite @ayinbox`. Slack offers to add it when you mention it in a channel it is not in.

  Each Slack thread is one conversation. Follow-ups in the thread continue it, with everything said before, and you do not need to mention the bot again. When you mention it inside an existing thread, it reads the thread first, so you can ask about a discussion that is already under way.

  The bot reacts with 👀 to the message it is working on and swaps it for ✅ when the answer is done. A workspace connected before AY Inbox asked for the reactions permission shows no reactions until it is reconnected.

  Working a thread together [#working-a-thread-together]

  A thread belongs to whoever is talking to the assistant in it, and only they continue it without a mention. A teammate who mentions `@ayinbox` in that thread takes it over: from then on the assistant acts as them, with their permissions, and starts from what the thread already says. Anyone outside your AY Inbox workspace who mentions it is turned away.

  What it can do [#what-it-can-do]

  Everything the dashboard assistant can: find and edit contacts, read campaign stats, pause a campaign, turn warmup off on a mailbox, draft replies, and the rest of the list in [What you can ask](/guides/ai-assistant/#what-you-can-ask-aya). The reply appears as one message that updates while the assistant works, with a line for each step it takes.

  It can also set up Slack itself. Ask `@ayinbox send reply notifications here` or `@ayinbox use this channel for the inbox` in the channel you mean, or `@ayinbox only answer in DMs`. For an integration that is not connected yet, it gives you a link that opens the connect window in AY Inbox, because connecting needs you signed in to the other service.

  It can do exactly what your role can do in the dashboard and nothing more: changing Slack setup needs **Manage settings**, as it does under **Integrations > Slack**.

  It runs as your linked AY Inbox account with the permissions your role has at that moment. If your role cannot do something in the dashboard, the assistant cannot do it from Slack either, and a permission removed from your role takes effect on the next message.

  Approvals [#approvals]

  Reading runs straight away. A change shows an approval card in the thread with the action, every argument the assistant passed, and these buttons:

  * **Approve** runs that one action.
  * **Deny** skips it.
  * **Always allow** approves it and every later action of that kind, as in the dashboard. It is offered only to a member with **Manage settings**, and never for the actions that [always ask](/guides/ai-assistant/#approvals).

  In a channel, every change asks, even one your workspace always allows, because anyone in the channel can post there. The same holds in a DM when the assistant is reading text someone else wrote (a thread, a message you asked about, or an email), and for changes that follow an approval in the same request. **Always allow** applies in a DM with only your own messages, and in the dashboard.

  Only the person whose conversation it is can press them. Anyone else in the channel sees the card but cannot act on it. Each card decides the one action it shows: once it is decided, here or in the dashboard, its buttons do nothing. A teammate who takes the thread over skips any card still waiting.

  When the details do not fit in a Slack message, the card says so and carries **Open in AY Inbox**, so you can read all of it before you decide. Secrets a step returns, such as a webhook signing secret, are never shown in Slack.

  <Callout type="warn" title="Sending always asks">
    Anything that sends mail to a real recipient needs your approval every time, and **Always allow** is never offered for it. The card shows the sending mailbox, the recipient, the subject and the message, and only that exact message goes out.
  </Callout>

  Credits and history [#credits-and-history]

  A conversation in Slack costs [AI credits](/guides/ai-credits/) exactly like the same conversation in the dashboard, and needs the same things: a paid plan and the **Use AI** permission.

  Every Slack conversation is also in your assistant history in the dashboard, and the bot's reply carries an **Open in AY Inbox** link to it. It follows the same privacy rules as any other conversation: private to you unless the workspace turned on shared history.

  Where it does not answer [#where-it-does-not-answer]

  * **Slack Connect channels.** In a channel shared with another organization the assistant declines, because people outside your company would read what it says about your workspace.
  * **When the workspace limits it.** Under **Integrations > Slack**, a member with **Manage settings** can set the assistant to **On**, **DMs only** (it answers in DMs and the assistant pane, never in channels) or **Off**.
</Fold>

<Fold>
  Inbox in Slack [#inbox-in-slack]

  Pick an **Inbox channel** under **Integrations > Slack** and incoming mail from the [Unibox](/guides/unibox/) is posted there, so the team can work replies without leaving Slack. Leave it empty and nothing is posted.

  <Callout type="warn" title="Everyone in the channel reads these emails">
    Every member of the inbox channel can read the mail posted there, including people who have no AY Inbox account or no inbox access. Pick a channel whose members you would let read your inbox.
  </Callout>

  | Setting           | What it does                                                                                                                                                                                                                                                                                                                                               |
  | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | **Inbox channel** | The channel conversations are posted to, picked from the list. Empty turns the inbox off                                                                                                                                                                                                                                                                   |
  | **What to post**  | **Replies** (the default) posts human replies only: messages that answer something and are not bounces or auto-replies such as out-of-office notices. **All** posts every inbound message. With [inbox tagging](/guides/inbox-tagging/) on, a reply is judged as the inbox judged it, and its card's Positive, Negative or Unsubscribe tag is that verdict |

  The inbox channel cannot be a Slack Connect channel. For a private channel, invite the AY Inbox app to it first, then pick it.

  One thread per conversation [#one-thread-per-conversation]

  Each conversation gets one Slack thread. The first message opens it with the sender, subject and, when it answers a campaign, the campaign's name. Later messages in the same conversation land in that thread, and so do replies a teammate sends from AY Inbox, shown as **Sent by** (or **Scheduled by** for a scheduled send) with their name.

  The posted text has quoted history removed and is cut at 1,500 characters. **Open in AY Inbox** shows the whole message.

  Buttons [#buttons]

  | Button                             | What it does                                                                                                                                                                                                                                                             |
  | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | **Reply**                          | Opens a form with the recipient and subject fixed and the body editable, filled with the latest draft for the conversation. Sending goes out from the conversation's mailbox, as you, with the same permission, plan and suppression checks as replying in the dashboard |
  | **Draft with AI**                  | The assistant writes a draft in the thread, as you. Review it, then use **Review and send** to send it through the reply form                                                                                                                                            |
  | **Interested**, **Not interested** | Apply the inbox labels of those names to the conversation                                                                                                                                                                                                                |
  | **Assign to me**                   | Marks the Slack card **Handled by** you, so teammates know who has it. It shows on the Slack card only; the inbox itself has no assignee                                                                                                                                 |
  | **Open in AY Inbox**               | Opens the conversation in the Unibox                                                                                                                                                                                                                                     |

  Every button except **Open in AY Inbox** needs a linked Slack account and the **Use unified inbox** permission.

  Talking in the thread [#talking-in-the-thread]

  Typing in a conversation's thread is team discussion. It never sends email, and the assistant does not read it. Mention `@ayinbox` in the thread to ask the assistant about the conversation: it starts with that conversation as context, and still asks before sending anything.
</Fold>

<Fold>
  Notifications [#notifications]

  AY Inbox posts a notification to Slack when the category is enabled for Slack in the recipient's **Settings > Notifications**. A notification meant for several teammates is posted once, not once per person.

  | Setting                   | What it does                                                                                                   |
  | ------------------------- | -------------------------------------------------------------------------------------------------------------- |
  | **Default channel**       | Where every notification goes unless its category has its own channel                                          |
  | **Per-category channels** | Send a category to a different channel, for example replies to `#sales` and health alerts to `#deliverability` |
  | **Personal DMs**          | Each member can also get their own notifications as DMs from the bot                                           |

  The channel picker lists public channels and the private channels the bot has been invited to. To post to a private channel, invite the bot there first.

  Each post carries an **Open in AY Inbox** button. A **Reply received** notification also has **Draft a reply**, which starts the assistant in a thread on that post, for whoever pressed it, with the reply already in front of it. The draft is never sent without your approval. Pressing it needs a linked account.

  **Personal DMs** are off until you turn them on, from **Integrations > Slack** in AY Inbox (they need a linked account). You then get a DM for every category you have enabled for Slack in **Settings > Notifications**.

  To work every reply in Slack rather than be pinged about it, use the [inbox channel](#inbox-in-slack) instead.
</Fold>

<Fold>
  Permissions [#permissions]

  | Action                                                                              | Who                                          |
  | ----------------------------------------------------------------------------------- | -------------------------------------------- |
  | Connect, reconnect or disconnect Slack                                              | **Manage settings**                          |
  | Choose channels, per-category routing, the inbox channel, and the assistant setting | **Manage settings**                          |
  | See the Slack connection, its settings and any missing permissions                  | **Manage settings** or **Use integrations**  |
  | See every member's linked Slack account, and remove anyone's link                   | **Manage settings**                          |
  | Link or unlink your own Slack account, and turn your personal DMs on or off         | Any member                                   |
  | Use the assistant from Slack                                                        | Any linked member with **Use AI**            |
  | Reply, draft, label or assign from the inbox channel                                | Any linked member with **Use unified inbox** |

  Removing a member from the workspace ends what their Slack account can do here, because everything runs as their AY Inbox membership at the time.
</Fold>

<Fold>
  What the bot reads [#what-the-bot-reads]

  The bot acts only on messages addressed to it:

  * direct messages to the bot and messages in its assistant pane
  * messages that mention `@ayinbox`
  * replies in a thread the assistant is answering for you
  * a message you run **Ask AY Inbox about this** on

  Slack delivers other messages from channels the bot is in, including the team's discussion in inbox threads, and AY Inbox ignores them. When you mention the bot inside an existing thread, or use the message shortcut, it also reads that thread's earlier messages so it knows what you are asking about. Those messages are passed to the assistant as quoted material, never as instructions, so text in a thread cannot tell the assistant to do something. The same holds for email text in the inbox channel.
</Fold>

<Fold>
  Troubleshooting [#troubleshooting]

  | What you see                                                                             | What to do                                                                                                                                                                                                                  |
  | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | The Slack card says Slack is not available                                               | The instance has no Slack app. On a self-hosted instance, ask the operator to follow [Slack app](/development/slack-app/)                                                                                                   |
  | Notifications post, but the bot never answers and buttons do nothing                     | The Slack app is only partly configured: posting works but Slack cannot reach AY Inbox. On a self-hosted instance the operator needs to set the signing secret ([Slack app](/development/slack-app/#environment-variables)) |
  | The Slack panel lists missing permissions                                                | Select **Reconnect**. A feature needing a permission the connection lacks stays off until then                                                                                                                              |
  | The bot says it sent you a link, or replies with a **Link your AY Inbox account** button | Your Slack account is not linked yet, or the link was removed. Follow the button in your DM with AY Inbox; the bot then answers what you asked                                                                              |
  | AY Inbox did not link you automatically                                                  | Your Slack email is not the email of an AY Inbox member of the workspace, or the connection predates email matching. Follow the link button and select **Continue with Slack**                                              |
  | **Continue with Slack** says you signed in as someone else                               | Slack signed you in to a different account than the one the button was made for. Sign in to Slack with that account, or ask the bot for a new link from the account you want to link                                        |
  | The bot says the thread is someone else's conversation                                   | The thread belongs to a member of a different AY Inbox workspace. Start a new thread                                                                                                                                        |
  | The bot does not answer in a channel                                                     | Check that it is a member of the channel, that the channel is not a Slack Connect channel, and that the assistant is not set to **DMs only** or **Off**                                                                     |
  | An inbox button says you need inbox access                                               | Your role lacks **Use unified inbox**. Ask a workspace admin                                                                                                                                                                |
  | The inbox channel cannot be saved                                                        | Pick it from the list. A private channel needs the AY Inbox app invited first, and a Slack Connect channel is refused                                                                                                       |
  | A reply you expected is not in the inbox channel                                         | With **Replies** selected, auto-replies, bounces and mail that answers nothing are left out. Switch to **All** to post every inbound message                                                                                |
  | The bot answers without the thread's earlier messages                                    | Slack limited how often the app may read message history, so it answered with only your message. Paste the relevant text into your question, or try again in a minute                                                       |
  | A notification did not reach a private channel                                           | Invite the bot to that channel                                                                                                                                                                                              |
</Fold>

<Fold>
  API [#api]

  A key with `INTEGRATIONS` reads the Slack status, lists channels, replaces the workspace's Slack settings and removes a member's link, under the same member permissions as the panel. Linking a Slack account binds it to a signed-in person, so it stays with that person's session. See [Slack settings](/api/endpoints/#slack-settings).
</Fold>
