# Mirror conversations into Slack

Mirror every conversation into a Slack channel and reply to customers from the thread.

Slack is for your team. Customers cannot start a conversation from Slack. The
same app runs the [assistant](/articles/ask-the-assistant) and the
[team commands](/articles/reply-and-approve-from-slack-or-discord).

## Add to Slack

1. **Install the app**

   On **Channels → Slack**, select **Add to Slack**. Only admins and owners
   see the button. See [Roles and permissions](/articles/roles-and-permissions).

2. **Approve it in Slack**

   Pick the workspace and allow the permissions. Finish within 15 minutes.

3. **Pick a channel**

   Under **Channel**, pick the channel for conversation threads. New
   conversations start appearing there.

- One workspace per organization, and one organization per workspace.
- The picker lists up to 5,000 public channels that are not archived. Private
  channels cannot be picked.
- Median joins the channel itself when it opens the first thread.
- The **Slack mirror** switch pauses the mirror. While it is off,
  conversation threads get no new posts and replies in threads are not read.
  Tool approvals and attention pings still post in the channel, see
  [Reply and approve from Slack or Discord](/articles/reply-and-approve-from-slack-or-discord).
- **Disconnect** returns the app's token to Slack, which removes the app from
  the workspace. Removing the app in Slack disconnects it in Median the next time Median posts there. The mirror channel is cleared, and
  the page offers **Add to Slack** again.

The workspace row says where things stand:

| Row reads | Means |
| --- | --- |
| Choose a channel to start syncing conversations. | No channel is picked yet |
| New conversations appear as channel threads. | The mirror is on |
| Conversation sync is disabled. | The **Slack mirror** switch is off |
| **Bot online** | Median's bot checked in within 2.5 minutes and is connected to Slack |
| **Bot offline** | Median's bot is not connected. The channel picker fails until it returns |

### Permissions

| Slack asks to | Used for |
| --- | --- |
| View and join public channels | The channel picker, and joining the mirror channel |
| Read messages in public channels | Replies in mirror threads |
| Send messages | Threads, tool approvals and attention pings |
| View people and their email addresses | Matching a Slack account to a Median member |
| Read direct messages and mentions, act as an assistant | The [assistant](/articles/ask-the-assistant) |
| Add slash commands | `/median`, `/note`, `/c` and `/t` |

## How mirror threads work

Every conversation, from the widget, email, a Discord ticket or your help center, gets one thread
in the mirror channel.

| What happens | In the channel |
| --- | --- |
| A conversation's first message after the mirror is on | A new thread. The first post shows the subject in bold, then the conversation's id like `W-12`, the customer's name, the way they came in, and **Open in Median** |
| A customer, agent or team message | A line in the thread. The author's name in bold, then the text. A file shows as "Sent a file" |
| A status change or a handoff | A line in italics. A handoff with a reason adds the reason below it in plain text |
| A question the agent asks the team | A line in italics naming the question, then "Answer with /note. A reply in this thread goes to the customer." |
| Any other note, or a system line | Nothing. Notes stay in Median |

- Customers with no name show as `Customer #12`.
- A conversation that started before the mirror was on gets a thread on its
  next message.
- A [tool approval or attention ping](/articles/reply-and-approve-from-slack-or-discord) also opens a thread
  when the conversation has none.
- With both the Slack and the [Discord](/articles/set-up-discord-support) mirror on,
  every conversation has a thread on each. A reply typed in one also appears
  in the other.

## Reply from a thread

A message in a mirror thread goes to the customer the way they came in. That
is the widget, an email, or their Discord ticket. Messages in the channel
outside a thread are ignored.

- Anyone who can post in the thread can reply to the customer.
- When the author's Slack email matches a Median member, the reply shows that
  member's name and picture, and the conversation is assigned to them.
  Otherwise the reply and the assignment carry the Slack name and picture.
- The agent stops answering. Unless it was already paused, the
  conversation notes `Ada took over from Median AI via Slack`, with your
  teammate's and agent's names.
- A resolved or closed conversation reopens. An archived one returns to the
  inbox, and a snooze ends.
- Only the text is sent. Files posted in the thread are not.

## Unlink from Slack

`/median unlink` disconnects the workspace from inside Slack. Use it when the
Median organization that installed the app is gone and there is no settings
page left to disconnect from. A bare `/median` does the same.

- Slack workspace admins and owners can run it. Anyone can once the
  organization is deleted.
- It returns the app's token to Slack, which removes the app.

| Answer | Means |
| --- | --- |
| "Unlinked from" and the organization's name | Done |
| Unlinked. The organization holding this workspace had been deleted. | Done. The workspace is free to connect again |
| This workspace is not linked to Median. | Nothing to unlink |
| Only a workspace admin can unlink Median. | You are not a Slack workspace admin or owner |
| Try /median unlink. | The command got other text |
| Unlinking failed. Try again. | The unlink did not finish |

## Reinstall for new permissions

A workspace keeps the permissions it had when it installed the app. When an
install is missing newer ones, the Slack panel shows a **Permissions** row
reading "This install is missing newer permissions." Press **Update
permissions** to install again. The channel stays picked.

| Symptom | Missing |
| --- | --- |
| `/median`, `/note`, `/c` or `/t` do not appear in Slack | Slash commands |
| The app does not answer direct messages or mentions | The assistant's permissions |

Installing the same workspace again keeps the mirror channel, so there is no need to disconnect first. If the app was removed in Slack, pick the channel again after you add it back.

## Errors

| Message | Cause | Fix |
| --- | --- | --- |
| That Slack workspace is already connected somewhere else in Median. | Another Median organization holds the workspace | Disconnect it there, or run `/median unlink` in Slack |
| Slack connection was not authorized. Try connecting again. | You cancelled on Slack's screen | Select **Add to Slack** again |
| The connection did not finish. Try again. | The install did not complete | Select **Add to Slack** again |
| This connection link has expired or was already used. Start again from Median. | More than 15 minutes passed, a newer **Add to Slack** click replaced this one, or you are no longer an admin or owner | Start again from **Add to Slack** |
| The bot is offline. Try again when it reconnects. | Median's bot is not connected | Wait for **Bot online**. Contact Median support if it stays offline |
| The bot request timed out. Check the connected channel before retrying. | The bot did not answer within 10 seconds | Try again |
| Connect a Slack workspace first. | No workspace is connected | Select **Add to Slack** |
| Slack integration is unavailable. Contact Median support. | Slack is not set up on this deployment | Contact Median support |

A post that fails shows in [Logs](/articles/search-your-logs) as **Integration delivery**,
at most once an hour. A post the bot has not made within an hour is dropped.
